diff --git a/customizations/Dotawo/assets/css/site.css b/customizations/Dotawo/assets/css/site.css index 34a1dbd..7330f2d 100644 --- a/customizations/Dotawo/assets/css/site.css +++ b/customizations/Dotawo/assets/css/site.css @@ -735,3 +735,63 @@ details { display: none; } } + +@media print { + @page { + size: 156mm 234mm; + marks: crop cross; + } + + h2 { + break-before: page; + } + + html { + font-size: 0.9rem; + box-sizing: border-box; + margin: 0 auto; + padding: 0; + } + + .grid { + display: inline; + } + + .coretitle { + margin-top: 3rem; + margin-bottom: 2rem; + font-size: 2.2rem; + } + + .leftcolumn { + display: none; + } + + .has, + .afterhas { + font-size: 1.1rem; + } + + .mantle, + .crust { + margin-bottom: 0.2em; + } + + .content { + padding: 0px; + margin: 0 auto; + margin-top: 4rem; + } + + .hpar { + display: none; + } + + .mantletitle { + font-size: 1.7rem; + } + + .sessiongrid { + display: none; + } +} diff --git a/customizations/Dotawo/layouts/_default/_markup/render-image.html b/customizations/Dotawo/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..f7a390c --- /dev/null +++ b/customizations/Dotawo/layouts/_default/_markup/render-image.html @@ -0,0 +1,50 @@ +{{- $text_link := .Text -}} + +{{ $_ := newScratch }} +{{- range $k, $v := .Page.Site.Data.sandpointsnamegraph -}} + {{ $_.Add "triads" $k }} +{{- end -}} + +{{- if strings.HasPrefix .Destination "bib:" -}} + {{- $destination := (substr .Destination 4) -}} + {{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}} + {{- if index $.Page.Site.Data.books.catalog $destination -}} + {{- $b := index $.Page.Site.Data.books.catalog $destination -}} + {{- $bibhref := printf "%sBROWSE_LIBRARY.html#/book/%s" (safeURL ($c_prefix)) $destination }} + {{ $bibtitle := "" }} + {{ with $b.title }} + {{- $bibtitle = printf "%s" $b.title }} + {{ end }} + {{ .Page.Scratch.Add "bibs" (slice (slice $bibhref $bibtitle)) }} + {{- if not $text_link -}} + {{- delimit $b.authors ", " " & " -}}{{- with $b.pubdate -}}, {{- substr . 0 4}}{{- end -}}.bib⁄‘{{- $b.title -}}’. {{- with $b.publisher -}}{{- . -}}.{{- end -}} + {{- else -}} + {{- $text_link -}} + {{- end -}} + {{- else -}} + {{- $text_link -}}⦚bib:{{- $destination -}} not found + {{- end -}} +{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}} + {{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} + {{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}} + {{ .Page.Scratch.Add "links" (slice $session) }} + {{- if not $text_link -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}} + {{- else -}} + {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}} + {{- end -}} + {{- else -}} + {{- $text_link -}}⦚{{- .Destination -}} not found + {{- end -}} +{{- else if strings.HasPrefix .Destination "audio:" -}} + {{- $a_destination := (substr .Destination 6) -}} + {{- if findRE "^.*static" $a_destination -}} + {{ .Text }} + {{- else -}} + {{ .Text }} + {{- end -}} +{{- else if findRE "^.*static" .Destination -}} + {{- .Text -}} +{{- else -}} + {{- .Text -}} +{{- end -}} diff --git a/customizations/Dotawo/layouts/_default/_markup/render-link.html b/customizations/Dotawo/layouts/_default/_markup/render-link.html new file mode 100644 index 0000000..b81c7a4 --- /dev/null +++ b/customizations/Dotawo/layouts/_default/_markup/render-link.html @@ -0,0 +1 @@ +{{- .Page.Scratch.Add "urls" (slice .Destination) -}}{{- $t := .Text -}}{{- $sup := "" -}}{{- if and (strings.HasPrefix .Destination "{") (.Destination | strings.Count "}") -}}{{- range first 1 (split .Destination "}") -}}{{- range $frmt := (split (substr . 1) ",") -}}{{- if eq $frmt "sc" -}}{{- $t -}}{{- end -}}{{- end -}}{{- end -}}{{- else }}{{- if strings.HasPrefix .Destination "http" -}}{{- $sup = "www" -}}{{- end -}}{{- if strings.HasPrefix .Destination "#" -}}{{- $sup = "§" -}}{{- end -}}{{- $sup -}}⁄{{ .Text | safeHTML }}{{- end -}}