diff --git a/layouts/partials/extend_head.html b/layouts/partials/extend_head.html new file mode 100644 index 0000000..498f5ca --- /dev/null +++ b/layouts/partials/extend_head.html @@ -0,0 +1,27 @@ + +{{ $threshold := .Site.Params.tocWordCountThreshold | default 300 }} +{{ $showToc := false }} +{{ if isset .Params "toc" }} + {{ $showToc = .Params.xparams.toc }} +{{ else }} + {{ $wordCount := countwords .Content }} + {{ $showToc = gt $wordCount $threshold }} +{{ end }} + +{{ if $showToc }} + +{{ end }} + + +{{ if .Params.xparams.math }} + {{ partial "math.html" . }} +{{ end }} + + +{{ if .Params.xparams.mermaid }} + {{ partial "mermaid.html" . }} +{{ end }} + +{{ partial "social-share.html" . }} diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..182f4c9 --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,7 @@ + + + + + + diff --git a/layouts/partials/mermaid.html b/layouts/partials/mermaid.html new file mode 100644 index 0000000..3146eb7 --- /dev/null +++ b/layouts/partials/mermaid.html @@ -0,0 +1,5 @@ + + + diff --git a/layouts/partials/social-share.html b/layouts/partials/social-share.html new file mode 100644 index 0000000..0beaaf9 --- /dev/null +++ b/layouts/partials/social-share.html @@ -0,0 +1,16 @@ +
+ {{/* Mastodon Sharing: Only render if enabled in the post’s YAML */}} + {{ if .Params.social.mastodon }} + {{ $mastodon := .Site.Params.social.mastodon_instance }} + + Share on Mastodon + + {{ end }} + + {{/* LinkedIn Sharing: Only render if enabled in the post’s YAML */}} + {{ if .Params.social.linkedin }} + + Share on LinkedIn + + {{ end }} +