diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/_markup/render-codeblock.html | 6 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 17 | ||||
-rw-r--r-- | layouts/_default/list.html | 32 | ||||
-rw-r--r-- | layouts/_default/rss.xml | 72 | ||||
-rw-r--r-- | layouts/_default/single.html | 24 | ||||
-rw-r--r-- | layouts/partials/favicon.html | 2 | ||||
-rw-r--r-- | layouts/partials/footer.html | 4 | ||||
-rw-r--r-- | layouts/partials/header.html | 6 | ||||
-rw-r--r-- | layouts/partials/nav.html | 25 | ||||
-rw-r--r-- | layouts/partials/seo_tags.html | 20 | ||||
-rw-r--r-- | layouts/partials/social_card.html | 136 | ||||
-rw-r--r-- | layouts/partials/style.html | 173 | ||||
-rw-r--r-- | layouts/robots.txt | 3 | ||||
-rw-r--r-- | layouts/shortcodes/highlight.html | 5 | ||||
-rw-r--r-- | layouts/shortcodes/rawhtml.html | 2 |
15 files changed, 308 insertions, 219 deletions
diff --git a/layouts/_default/_markup/render-codeblock.html b/layouts/_default/_markup/render-codeblock.html new file mode 100644 index 0000000..6e1a075 --- /dev/null +++ b/layouts/_default/_markup/render-codeblock.html @@ -0,0 +1,6 @@ +<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html --> +{{ .Page.Store.Set "hasCodeBlock" true }} + +<!-- https://www.veriphor.com/articles/code-block-render-hooks/ --> +{{ $result := transform.HighlightCodeBlock . }} +{{ $result.Wrapped }}
\ No newline at end of file diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 6bce2dc..475d6f9 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -11,12 +11,23 @@ {{- partial "seo_tags.html" . -}} <meta name="referrer" content="no-referrer-when-downgrade" /> + {{ $style := resources.Get "style.css" | minify }} + <link href="{{ $style.RelPermalink }}" rel="stylesheet"> + + {{ if (.Page.Store.Get "hasCodeBlock") }} + {{ $syntax := resources.Get "syntax.css" | minify }} + <link href="{{ $syntax.RelPermalink }}" rel="stylesheet"> + {{ end }} + + {{ with .Params.style }} + {{ $extra := resources.Get . | minify }} + <link href="{{ $extra.RelPermalink }}" rel="stylesheet"> + {{ end }} + {{ with .OutputFormats.Get "rss" -}} {{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - {{- partial "style.html" . -}} - <!-- A partial to be overwritten by the user. Simply place a custom_head.html into your local /layouts/partials-directory --> @@ -27,7 +38,7 @@ <header> {{- partial "header.html" . -}} </header> - <main> + <main id="main-content"> {{- block "main" . }}{{- end }} </main> <footer> diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 90cbee5..354bc9c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,10 +1,7 @@ {{ define "main" }} <content> {{ if .Data.Singular }} - <h3 style="margin-bottom:0">Filtering for "{{ .Title }}"</h3> - <small> - <a href="{{ "blog" | relURL }}">Remove filter</a> - </small> + <h3 class="blog-filter">{{ i18n "filtering-for" }} "{{ .Title }}"</h3> {{ end }} <ul class="blog-posts"> {{ range .Pages }} @@ -12,27 +9,28 @@ <span> <i> <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> - {{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }} + {{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} </time> </i> </span> - <a href="{{ .Permalink }}">{{ .Title }}</a> + {{ if .Params.link }} + <a href="{{ .Params.link }}" target="_blank">{{ .Title }} ↪</a> + {{ else }} + <a href="{{ .Permalink }}">{{ .Title }}</a> + {{ end }} </li> {{ else }} <li> - No posts yet + {{ i18n "no-posts" }} </li> {{ end }} </ul> - {{ if .Data.Singular }} - {{else}} - <small> - <div> - {{ range .Site.Taxonomies.tags }} - <a href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a> - {{ end }} - </div> - </small> - {{ end }} + {{ if not .Data.Singular }} + <div> + {{ range .Site.Taxonomies.tags }} + <a class="blog-tags" href="{{ .Page.Permalink }}">#{{ .Page.Title }}</a> + {{ end }} + </div> + {{ end }} </content> {{ end }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml new file mode 100644 index 0000000..70d1193 --- /dev/null +++ b/layouts/_default/rss.xml @@ -0,0 +1,72 @@ +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = .Site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := .Site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} +{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }} +<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"> + <channel> + <title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> + <link>{{ .Permalink }}</link> + <description>Recent content {{ if not .IsHome }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description> + <generator>Hugo -- gohugo.io</generator> + <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} + <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} + <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }} + <copyright>{{ . }}</copyright>{{ end }}{{ if not .Date.IsZero }} + <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }} + {{- with .OutputFormats.Get "RSS" }} + {{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }} + {{- end }} + {{- range $pages }} + <item> + <title>{{ .Title }}</title> + <link>{{ .Permalink }}</link> + <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate> + {{- with $authorEmail }}<author>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</author>{{ end }} + <guid>{{ .Permalink }}</guid> + <description>{{ .Summary | transform.XMLEscape | safeHTML }}</description> + <content:encoded>{{ `<![CDATA[` | safeHTML }}{{ .Content | safeHTML }}{{ `]]>` | safeHTML }}</content:encoded> + </item> + {{- end }} + </channel> +</rss> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7d57351..6f6c699 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,20 +1,26 @@ {{ define "main" }} -{{ if eq .Type "blog" }}{{ if not .Params.menu }} +{{ if not .Params.menu }} <h1>{{ .Title }}</h1> -<p> - <i> - <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> - {{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }} - </time> - </i> +<p class="byline"> + <time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> + {{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} + </time> + {{ with .Params.author }}· {{.}}{{ end }} </p> -{{ end }}{{ end }} +{{ end }} <content> {{ .Content }} </content> <p> {{ range (.GetTerms "tags") }} - <a href="{{ .Permalink }}">#{{ .LinkTitle }}</a> + <a class="blog-tags" href="{{ .Permalink }}">#{{ .LinkTitle }}</a> {{ end }} </p> +{{ with .Site.Params.author.email }} + <p> + <a href='mailto:{{ . }}?subject={{ i18n "email-subject" }}"{{ default $.Site.Title $.Page.Title }}"'> + {{ i18n "email-reply" }} ↪ + </a> + </p> +{{ end }} {{ end }} diff --git a/layouts/partials/favicon.html b/layouts/partials/favicon.html index ccf1a5d..d391a86 100644 --- a/layouts/partials/favicon.html +++ b/layouts/partials/favicon.html @@ -1,2 +1,2 @@ {{ with .Site.Params.favicon }} -<link rel="shortcut icon" href="{{ . | absURL }}" />{{ end }} +<link rel="shortcut icon" href="{{ absURL . }}" />{{ end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8eca955..9290715 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1 +1,3 @@ -{{ if ne .Site.Params.hideMadeWithLine true }}Made with <a href="https://github.com/janraasch/hugo-bearblog/">Hugo ʕ•ᴥ•ʔ Bear</a>{{ end }} +<small> + {{ .Site.Copyright }} | {{ markdownify .Site.Params.madeWith }} +</small>
\ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 9bb5112..5a66907 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,4 +1,4 @@ -<a href="{{ "" | relURL }}" class="title"> - <h2>{{ .Site.Title }}</h2> -</a> +<a class="skip-link" href="#main-content">{{ i18n "skip-link" }}</a> + +<a href="{{ relURL .Site.Home.Permalink }}" class="title"><h1>{{ .Site.Title }}</h1></a> <nav>{{- partial "nav.html" . -}}</nav> diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index f4fabed..5f40267 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -1,7 +1,22 @@ -<a href="{{ "" | relURL }}">Home</a> -{{ range .Site.Menus.main }} -<a href="{{ .URL }}">{{ .Name }}</a> +{{ range .Site.Menus.main.ByWeight }} + <a href="{{ .URL }}">{{ .Name }}</a> {{ end }} -{{ with .Site.GetPage "/blog" }} -<a href="{{ "blog" | relURL }}">Blog</a> +<a href='{{ absURL "index.xml" }}'>RSS</a> + +<!-- Convert this page's translations into a dict --> +{{ $translations := dict }} +{{ range .Translations }} + {{ $translations = merge $translations (dict .Language.Lang .) }} +{{ end }} + +<!-- Create a link to every translation --> +{{ range where .Site.Languages "Lang" "!=" .Page.Lang }} + {{ with (index $translations .Lang) }} + <a href="{{ .Permalink }}">{{ .Language.LanguageName }}</a> + {{ else }} + <!-- The complicated setup was necessary to make a grayed out link --> + {{ if not .Params.hideUntranslated }} + <a class="disabled" role="link" aria-disabled="true">{{ .LanguageName }}</a> + {{ end }} + {{ end }} {{ end }} diff --git a/layouts/partials/seo_tags.html b/layouts/partials/seo_tags.html index 0b01f8b..81e498f 100644 --- a/layouts/partials/seo_tags.html +++ b/layouts/partials/seo_tags.html @@ -3,11 +3,19 @@ <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> <meta name="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" /> -<!-- Open Graph / Facebook --> -{{ template "_internal/opengraph.html" . }} +<!-- Only generate social card if: --> +<!-- - generateSocialCard = true --> +<!-- - there aren't images set in frontmatter --> +<!-- - page is of .Kind "page" --> +{{ if and (and (default false .Site.Params.generateSocialCard) (not (isset .Params "images"))) (eq .Kind "page") }} + {{ partial "social_card.html" . }} +{{ else }} + <!-- Open Graph / Facebook --> + {{ template "_internal/opengraph.html" . }} -<!-- Twitter --> -{{ template "_internal/twitter_cards.html" . }} + <!-- Twitter --> + {{ template "_internal/twitter_cards.html" . }} -<!-- Microdata --> -{{ template "_internal/schema.html" . }} + <!-- Microdata --> + {{ template "_internal/schema.html" . }} +{{ end }} diff --git a/layouts/partials/social_card.html b/layouts/partials/social_card.html new file mode 100644 index 0000000..1568475 --- /dev/null +++ b/layouts/partials/social_card.html @@ -0,0 +1,136 @@ +<!-- Dynamic social card generation --> +{{ $font := resources.GetRemote "https://github.com/google/fonts/raw/main/ofl/firamono/FiraMono-Bold.ttf" }} +{{ $fg := resources.Get "images/social_card_fg.png"}} +{{ $bg := resources.Get "images/social_card_bg.png"}} + +{{ if gt (len .Title) 45 }} + {{ $fg = $fg.Filter (images.Text .Title (dict + "font" $font + "color" "#fafafa" + "size" 95 + "linespacing" 16 + "x" 0 + "y" 0 + )) }} +{{ else }} + {{ $fg = $fg.Filter (images.Text .Title (dict + "font" $font + "color" "#fafafa" + "size" 130 + "linespacing" 20 + "x" 0 + "y" 0 + )) }} +{{ end }} + +{{ $date := .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }} +{{ $author := (default $.Site.Params.author.name ($.Param "author") ) }} +{{ $byline := (printf "%s | %s" $author $date) }} + +{{ $fg = $fg.Filter (images.Text $byline (dict + "font" $font + "color" "#c9d1d9" + "size" 60 + "linespacing" 30 + "x" 0 + "y" 425 +)) }} + +{{ $card := $bg.Filter (images.Overlay $fg 112 140 ) }} +{{ $card := $card.Resize "900x webp q100" }} + +<!-- Open Graph / Facebook --> +<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/opengraph.html --> +<meta property="og:title" content="{{ .Title }}" /> +<meta property="og:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> +<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}" /> +<meta property="og:url" content="{{ .Permalink }}" /> + +<meta property="og:image" content="{{ $card.Permalink | absURL }}"/> + +{{- if .IsPage }} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +<meta property="article:section" content="{{ .Section }}" /> +{{ with .PublishDate }}<meta property="article:published_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }} +{{ with .Lastmod }}<meta property="article:modified_time" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end }} +{{- end -}} + +{{- with .Params.audio }}<meta property="og:audio" content="{{ . }}" />{{ end }} +{{- with .Params.locale }}<meta property="og:locale" content="{{ . }}" />{{ end }} +{{- with .Site.Params.title }}<meta property="og:site_name" content="{{ . }}" />{{ end }} +{{- with .Params.videos }}{{- range . }} +<meta property="og:video" content="{{ . | absURL }}" /> +{{ end }}{{ end }} + +{{- /* If it is part of a series, link to related articles */}} +{{- $permalink := .Permalink }} +{{- $siteSeries := .Site.Taxonomies.series }} +{{- if $siteSeries }} +{{ with .Params.series }}{{- range $name := . }} + {{- $series := index $siteSeries ($name | urlize) }} + {{- range $page := first 6 $series.Pages }} + {{- if ne $page.Permalink $permalink }}<meta property="og:see_also" content="{{ $page.Permalink }}" />{{ end }} + {{- end }} +{{ end }}{{ end }} +{{- end }} + +{{- /* Deprecate site.Social.facebook_admin in favor of site.Params.social.facebook_admin */}} +{{- $facebookAdmin := "" }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $facebookAdmin = .facebook_admin }} + {{- end }} +{{- else }} + {{- with site.Social.facebook_admin }} + {{- $facebookAdmin = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.facebook_admin instead." }} + {{- end }} +{{- end }} + +{{- /* Facebook Page Admin ID for Domain Insights */}} +{{ with $facebookAdmin }}<meta property="fb:admins" content="{{ . }}" />{{ end }} + +<!-- Twitter --> +<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/twitter_cards.html --> +<meta name="twitter:card" content="summary_large_image"/> +<meta name="twitter:image" content="{{ $card.Permalink | absURL }}"/> +<meta name="twitter:title" content="{{ .Title }}"/> +<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/> + +{{- /* Deprecate site.Social.twitter in favor of site.Params.social.twitter */}} +{{- $twitterSite := "" }} +{{- with site.Params.social }} + {{- if reflect.IsMap . }} + {{- $twitterSite = .twitter }} + {{- end }} +{{- else }} + {{- with site.Social.twitter }} + {{- $twitterSite = . }} + {{- warnf "The social key in site configuration is deprecated. Use params.social.twitter instead." }} + {{- end }} +{{- end }} + +{{- with $twitterSite }} + {{- $content := . }} + {{- if not (strings.HasPrefix . "@") }} + {{- $content = printf "@%v" $twitterSite }} + {{- end }} +<meta name="twitter:site" content="{{ $content }}"/> +{{- end }} + +<!-- Microdata --> +<!-- Source: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/schema.html --> +<meta itemprop="name" content="{{ .Title }}"> +<meta itemprop="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}"> + +{{- if .IsPage -}} +{{- $iso8601 := "2006-01-02T15:04:05-07:00" -}} +{{ with .PublishDate }}<meta itemprop="datePublished" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}} +{{ with .Lastmod }}<meta itemprop="dateModified" {{ .Format $iso8601 | printf "content=%q" | safeHTMLAttr }} />{{ end}} +<meta itemprop="wordCount" content="{{ .WordCount }}"> + +<meta itemprop="image" content="{{ $card.Permalink | absURL }}"/> + +<!-- Output all taxonomies as schema.org keywords --> +<meta itemprop="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" /> +{{- end -}} diff --git a/layouts/partials/style.html b/layouts/partials/style.html deleted file mode 100644 index 122a641..0000000 --- a/layouts/partials/style.html +++ /dev/null @@ -1,173 +0,0 @@ -<style> - body { - font-family: Verdana, sans-serif; - margin: auto; - padding: 20px; - max-width: 720px; - text-align: left; - background-color: #fff; - word-wrap: break-word; - overflow-wrap: break-word; - line-height: 1.5; - color: #444; - } - - h1, - h2, - h3, - h4, - h5, - h6, - strong, - b { - color: #222; - } - - a { - color: #3273dc; - /*color: #ff5e6c;*/ - } - - .title { - text-decoration: none; - border: 0; - } - - .title span { - font-weight: 400; - } - - nav a { - margin-right: 10px; - } - - textarea { - width: 100%; - font-size: 16px; - } - - input { - font-size: 16px; - } - - content { - line-height: 1.6; - } - - table { - width: 100%; - } - - img { - max-width: 100%; - } - - code { - padding: 2px 5px; - background-color: #f2f2f2; - } - - pre code { - color: #222; - display: block; - padding: 20px; - white-space: pre-wrap; - font-size: 14px; - overflow-x: auto; - } - - div.highlight pre { - background-color: initial; - color: initial; - } - - div.highlight code { - background-color: unset; - color: unset; - } - - blockquote { - border-left: 1px solid #999; - color: #222; - padding-left: 20px; - font-style: italic; - } - - footer { - padding: 25px; - text-align: center; - } - - .helptext { - color: #777; - font-size: small; - } - - .errorlist { - color: #eba613; - font-size: small; - } - - /* blog posts */ - ul.blog-posts { - list-style-type: none; - padding: unset; - } - - ul.blog-posts li { - display: flex; - } - - ul.blog-posts li span { - flex: 0 0 130px; - } - - ul.blog-posts li a:visited { - color: #8b6fcb; - } - - @media (prefers-color-scheme: dark) { - body { - background-color: #333; - color: #ddd; - } - - h1, - h2, - h3, - h4, - h5, - h6, - strong, - b { - color: #eee; - } - - a { - color: #8cc2dd; - } - - code { - background-color: #777; - } - - pre code { - color: #ddd; - } - - blockquote { - color: #ccc; - } - - textarea, - input { - background-color: #252525; - color: #ddd; - } - - .helptext { - color: #aaa; - } - } - -</style> diff --git a/layouts/robots.txt b/layouts/robots.txt index 0326f5c..4f4ca44 100644 --- a/layouts/robots.txt +++ b/layouts/robots.txt @@ -1,2 +1,3 @@ -User-Agent: * +User-agent: * +Allow: / Sitemap: {{ "sitemap.xml" | absURL }} diff --git a/layouts/shortcodes/highlight.html b/layouts/shortcodes/highlight.html new file mode 100644 index 0000000..6c86ca8 --- /dev/null +++ b/layouts/shortcodes/highlight.html @@ -0,0 +1,5 @@ +<!-- https://github.com/jmooring/hugo-testing/blob/hugo-forum-topic-40998/layouts/_default/_markup/render-codeblock-katex.html --> +{{ .Page.Store.Set "hasCodeBlock" true }} + +<!-- https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/highlight.html --> +{{ if len .Params | eq 2 }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) (.Get 1) }}{{ else }}{{ highlight (trim .InnerDeindent "\n\r") (.Get 0) "" }}{{ end }}
\ No newline at end of file diff --git a/layouts/shortcodes/rawhtml.html b/layouts/shortcodes/rawhtml.html new file mode 100644 index 0000000..520ec17 --- /dev/null +++ b/layouts/shortcodes/rawhtml.html @@ -0,0 +1,2 @@ +<!-- raw html --> +{{.Inner}}
\ No newline at end of file |