Skip to content

Commit 7a25b43

Browse files
Fix #1840. Restore glossary page rendering. (#1841)
1 parent 0397609 commit 7a25b43

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

layouts/shortcodes/def.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
{{ $_hugo_config := `{ "version": 1 }` }}
21
<!--
32
Usage (in english):
43
{% def
54
id="a unique id for anchor"
65
name="The term to define (optional if abbr is provided)"
76
abbr="an acronym (optional)"
87
abbr_first="1 (When the acronym is more important, such as RSA or SSL)" %}
9-
the definition
8+
the definition
109
{% /def %}
11-
10+
1211
<p><dfn id="a unique id for anchor">The term to define</dfn>: the definition</p>
1312
<p><dfn id="a unique id for anchor"><abbr>an acronym</abbr</dfn>: the definition</p>
1413
<p><dfn id="a unique id for anchor">The term to define</dfn> (<abbr>an acronym</abbr>): the definition</p>
1514
1615
Usage (in other languages):
17-
{% def
18-
id="a unique id for anchor - the SAME than for english"
16+
{% def
17+
id="a unique id for anchor - the SAME than for english"
1918
name="The term to define (optional if english or abbr is provided)"
2019
abbr="an acronym (optional)"
2120
english="the english term (optional - if present the abbr is in english too)"

layouts/shortcodes/renderglossary.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
<dl>
12
{{ range (.Page.Scratch.GetSortedMapValues "glossary") }}
2-
<p class="definition">
3+
<dt class="term">
34
<a href="#def-{{.id }}">
45
{{- if and (.abbr) (eq (.abbr_first) "1") -}}
56
<dfn id="def-{{.id }}"><abbr lang="en">{{ .abbr }}</abbr></dfn>
@@ -24,8 +25,8 @@
2425
{{- end -}}
2526
{{- end -}}
2627
</a>
27-
{{ .Site.Params.beforeColon | safeHTML }}: {{ .content }}
28-
</p>
29-
28+
</dt>
29+
<dd class="definition">{{ .content | markdownify }}</dd>
3030
{{ end }}
3131

32+
</dl>

static/css/glossary.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ dfn {
1212
padding-right: .25em; /* Prevent italics text from hitting the ":" */
1313
}
1414

15+
.definition {
16+
margin-bottom: 1em;
17+
}
18+
1519
.definition>a:first-child {
1620
text-decoration: none;
1721
color: inherit;

0 commit comments

Comments
 (0)