Skip to content

Commit 6e84cf9

Browse files
committed
Taxonomy initial work. Still WIP
1 parent fb57d07 commit 6e84cf9

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

config/_default/params.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,6 @@ links:
104104
# icon: "fa fa-envelope"
105105
# desc: "Discuss development issues around the project"
106106

107-
taxonomies:
108-
publish: publish
109-
tag: tags
110-
category: categories
111-
publication_type: publication_types
112-
author: authors
113-
114107
related:
115108
threshold: 80
116109
includeNewer: true

config/_default/taxonomies.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
taxonomies:
2+
tag: tags
3+
category: categories
4+
author: authors
5+
item_type: item_type

layouts/bibliography/list.html

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
{{ define "main" }}
22

3+
{{- warnf "Bib types: %v" .Site.Taxonomies.item_type -}}
4+
{{ warnf "All taxonomies: %s" (.Site.Taxonomies | jsonify) }}
5+
{{ range $taxName, $terms := .Site.Taxonomies }}
6+
{{- $pairs := slice -}}
7+
{{- range $term, $pages := $terms }}
8+
{{- $pairs = $pairs | append (printf "%s(%d)" $term (len $pages)) -}}
9+
{{- end }}
10+
{{ warnf "Taxonomy %s: %s" $taxName (delimit $pairs ", ") }}
11+
{{ end }}
12+
13+
<label for="itemTypeFilter">Filter by Type:</label>
14+
<select id="itemTypeFilter">
15+
<option value="all">All</option>
16+
{{ range $key, $value := .Site.Taxonomies.item_type}}
17+
<option value="{{ $key }}">{{ $key | title }}</option>
18+
{{ end }}
19+
</select>
20+
21+
322
{{ .Content }}
423

524
<style>
@@ -33,9 +52,9 @@
3352

3453
{{- /* Render the list of publications */ -}}
3554

36-
<ul class="pub-list">
55+
<ul class="pub-list" id="bibliographyList">
3756
{{ range $pages }}
38-
<li>
57+
<li data-type>
3958
{{- $rawTitle := or .Params.title .Title -}}
4059
{{- $rendered := replaceRE "^<p>(.*)</p>$" "$1" $rawTitle -}}
4160
{{- $rendered = $rendered | plainify | htmlEscape -}}
@@ -53,7 +72,7 @@
5372
{{- end }}
5473
<time datetime="{{ $d.Format "2006-01-02" }}">{{ $d.Format "2006-01-02" }}</time><br>
5574

56-
{{ with .Params.abstract -}}
75+
{{ with .Params.abstract -}}config/_default
5776
{{- $plain := . | plainify | htmlEscape | replaceRE `\s+` " " -}}
5877
{{- $words := split $plain " " -}}
5978
{{- $previewWords := cond (gt (len $words) 24) (first 24 $words) $words -}}
@@ -75,4 +94,6 @@
7594
</li>
7695
{{ end }}
7796
</ul>
78-
{{ end }}
97+
{{ end }}
98+
99+

0 commit comments

Comments
 (0)