huge upgrade to theme and pagefind search bar.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{{- $attributes := .Attributes -}}
|
||||
{{- $class := printf "book-hint %s" ($.AlertType | lower) -}}
|
||||
{{- if isset $attributes "class" -}}
|
||||
{{- $class = printf "%s %s" $class (index $attributes "class") -}}
|
||||
{{ end -}}
|
||||
{{- $attributes = merge $attributes (dict "class" $class) -}}
|
||||
<blockquote {{ range $key, $value := $attributes }}{{printf "%s='%s'" $key $value | safeHTMLAttr}}{{ end }}>
|
||||
{{ .Text -}}
|
||||
</blockquote>
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- with .Inner -}}
|
||||
<span>\[ {{ .| htmlEscape | safeHTML }} \]</span>
|
||||
{{- end -}}
|
||||
{{- if not (.Page.Store.Get "katex") -}}
|
||||
{{- /* Include katex only first time */ -}}
|
||||
<link rel="stylesheet" href="{{ "katex/katex.min.css" | relURL }}" />
|
||||
{{- /* remove whitespaces */ -}}
|
||||
<script defer src="{{ "katex/katex.min.js" | relURL }}"></script>
|
||||
{{- with resources.Get "katex.json" | minify -}}
|
||||
<script defer src="{{ "katex/auto-render.min.js" | relURL }}" onload="renderMathInElement(document.body, {{ .Content | safeJS }});"></script>
|
||||
{{- end -}}
|
||||
{{- .Page.Store.Set "katex" true -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- /* remove whitespaces */ -}}
|
||||
<pre class="mermaid">{{ .Inner | htmlEscape | safeHTML -}}</pre>
|
||||
{{- if not (.Page.Store.Get "mermaid") -}}
|
||||
{{- /* Include mermaid only first time */ -}}
|
||||
<script src="{{ "mermaid.min.js" | relURL }}"></script>
|
||||
{{- with resources.Get "mermaid.json" | minify -}}
|
||||
<script>mermaid.initialize({{ .Content | safeJS }})</script>
|
||||
{{- end -}}
|
||||
{{- .Page.Store.Set "mermaid" true -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,10 @@
|
||||
{{- with (index .Attributes "filename") -}}
|
||||
{{- $href := index $.Attributes "href" -}}
|
||||
{{- if $href -}}
|
||||
{{- $href = partial "docs/links/portable-link" (dict "Page" $.PageInner "Destination" $href) -}}
|
||||
{{- end -}}
|
||||
<div class="book-codeblock-filename">
|
||||
<a {{ with $href }}href="{{ . }}"{{ end }}>{{ . }}</a>
|
||||
</div>
|
||||
{{- end -}}
|
||||
{{- (transform.HighlightCodeBlock . .Options).Wrapped -}}
|
||||
@@ -0,0 +1,6 @@
|
||||
<h{{ .Level }} id="{{ .Anchor }}" {{- with .Attributes.class -}}class="{{ . }}"{{- end -}}>
|
||||
{{- .Text -}}
|
||||
{{- if default true .Attributes.anchor -}}
|
||||
<a class="anchor" href="#{{ .Anchor }}">#</a>
|
||||
{{- end -}}
|
||||
</h{{ .Level }}>
|
||||
@@ -0,0 +1,6 @@
|
||||
{{- $destination := .Destination -}}
|
||||
{{- if .Page.Site.Params.BookPortableLinks -}}
|
||||
{{- $destination = partial "docs/links/portable-image" . -}}
|
||||
{{- end -}}
|
||||
<img src="{{ $destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }}title="{{ . }}"{{ end }}/>
|
||||
{{- /**/ -}}
|
||||
6
themes/hugo-book.backup/layouts/_markup/render-link.html
Normal file
6
themes/hugo-book.backup/layouts/_markup/render-link.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{- $destination := .Destination -}}
|
||||
{{- if .Page.Site.Params.BookPortableLinks -}}
|
||||
{{- $destination = partial "docs/links/portable-link" . -}}
|
||||
{{- end -}}
|
||||
<a href="{{ $destination | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
{{- /**/ -}}
|
||||
Reference in New Issue
Block a user