diff --git a/assets/css/site.css b/assets/css/site.css index b61aae9..b421504 100644 --- a/assets/css/site.css +++ b/assets/css/site.css @@ -824,6 +824,7 @@ h2 + p:first-letter { } body {counter-reset: h2} +body {counter-reset: glossN} h2 {counter-reset: h3} h3 {counter-reset: h4} h4 {counter-reset: h5} @@ -875,6 +876,48 @@ details { text-decoration-color: red; } +.glosscontainer { + display: grid; + grid-template-columns: auto 1fr; + grid-template-rows: 1fr; + gap: 0px 0px; + grid-template-areas: + "glossnumber gloss"; +} + +.gloss { + display: grid; + grid-template-columns: 1fr; + /*grid-template-rows: repeat(3, 1fr);*/ + gap: 0px 0px; + grid-template-areas: + "glosstop" + "glossmiddle" + "glossbottom"; + grid-area: gloss; +} +.glosstop { grid-area: glosstop; } +.glossbottom { grid-area: glossbottom; } +.glossmiddle { grid-area: glossmiddle; } +.glossnumber { + grid-area: glossnumber; +} +.glossnumber::before { + counter-increment: glossN; + content: "(" counter(glossN) ")"; + padding-right: 0.3rem; +} + +.glosswords { + display: inline-block; + margin-left: -0.3rem; +} + +.glossword { + margin-left: 0.3rem; + margin-right: 0.5rem; +} + @media (max-width: 767px) { html { box-sizing: border-box; diff --git a/layouts/shortcodes/gloss.html b/layouts/shortcodes/gloss.html new file mode 100644 index 0000000..cb48c1b --- /dev/null +++ b/layouts/shortcodes/gloss.html @@ -0,0 +1,28 @@ +
+
+ {{- range $g := split .Inner "\n" -}} + {{- if hasPrefix $g "{t}" -}} +
+ {{- substr $g 3 -}} +
+ {{- else if hasPrefix $g "{m}" -}} +
+ {{- range (split (substr $g 3) "|") -}} + {{- with . -}} +
+ {{- range (split . "," ) -}} +
{{- . -}}
+ {{- end -}} +
+ {{- end -}} + {{- end -}} +
+ {{- else if hasPrefix $g "{b}" -}} +
+ {{- substr $g 3 -}} +
+ {{- end -}} + {{- end -}} +
+
+
\ No newline at end of file