diff --git a/.prettierrc b/.prettierrc index a992bf4..431c50a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,40 +1,40 @@ { - "plugins": [ - "prettier-plugin-sh", - "prettier-plugin-pkg", - "prettier-plugin-go-template", - "prettier-plugin-css-order", - "prettier-plugin-toml", - "prettier-plugin-tailwindcss" - ], - "overrides": [ - { - "files": ["*.html"], - "options": { - "parser": "go-template", - "goTemplateBracketSpacing": true, - "bracketSameLine": true, - "embeddedLanguageFormatting": "off", - "htmlWhitespaceSensitivity": "strict" - } - }, - { - "files": ["*.md"], - "options": { - "embeddedLanguageFormatting": "off" - } - }, - { - "files": ["*.toml"], - "options": { - "indentTables": true, - "indentEntries": true, - "alignEntries": true - } - } - ], - "tailwindStylesheet": "./assets/css/main.css", - "tailwindConfig": "./tailwind.config.js", - "tailwindFunctions": ["tw"], - "cssDeclarationSorterOrder": "smacss" + "plugins": [ + "prettier-plugin-sh", + "prettier-plugin-pkg", + "prettier-plugin-go-template", + "prettier-plugin-css-order", + "prettier-plugin-toml", + "prettier-plugin-tailwindcss" + ], + "overrides": [ + { + "files": ["*.html"], + "options": { + "parser": "go-template", + "goTemplateBracketSpacing": true, + "bracketSameLine": true, + "embeddedLanguageFormatting": "off", + "htmlWhitespaceSensitivity": "css" + } + }, + { + "files": ["*.md"], + "options": { + "embeddedLanguageFormatting": "off" + } + }, + { + "files": ["*.toml"], + "options": { + "indentTables": true, + "indentEntries": true, + "alignEntries": true + } + } + ], + "tailwindStylesheet": "./assets/css/*.css", + "tailwindConfig": "./tailwind.config.js", + "tailwindFunctions": ["tw"], + "cssDeclarationSorterOrder": "smacss" } diff --git a/assets/css/main.css b/assets/css/main.css index 85790d7..5630734 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -1,6 +1,10 @@ @import "tailwindcss"; @source "hugo_stats.json"; +:root { + --accent-color: var(--color-amber-500); +} + @layer components { html { width: 100%; @@ -49,15 +53,25 @@ } p { - @apply block text-sm/tight font-medium; + @apply block text-base/normal font-medium; margin-block: unset; @apply py-2; } } +header, +main { + border-color: var(--accent-color); +} + a :is(h1, h2, h3, h4, h5, h6) { @apply no-underline; } + +.anchor { + @apply no-underline; +} + a .anchor-icon { visibility: hidden; } @@ -72,6 +86,7 @@ a:hover .anchor-icon { code { display: inline-block; + margin: 0.125em; padding: 0.0625rem 0.25rem; font-size: 85%; @apply rounded-sm no-underline; @@ -123,7 +138,11 @@ nav label { } .post-preview > span > p { - @apply mt-5; + @apply mt-2; +} + +.post-metadata p { + text-decoration-color: var(--accent-color); } .main :is(ul, ol) { @@ -260,10 +279,9 @@ article h2 { } .tags { - @apply ml-2 p-1 font-mono; + @apply ml-2 p-1; } -p + p, p + a + h1, p + a + h2, p + a + h3, @@ -296,35 +314,35 @@ h2 + h3 { } .alert-note { - @apply bg-blue-100 text-blue-700; + @apply bg-blue-50 text-blue-700; code { @apply border-blue-700; } } .alert-tip { - @apply bg-orange-100 text-orange-700; + @apply bg-amber-50 text-amber-700; code { - @apply border-orange-700; + @apply border-amber-700; } } .alert-important { - @apply bg-lime-100 text-lime-700; + @apply bg-lime-50 text-lime-700; code { @apply border-lime-700; } } .alert-caution { - @apply bg-yellow-100 text-yellow-700; + @apply bg-yellow-50 text-yellow-700; code { @apply border-yellow-700; } } .alert-warning { - @apply bg-red-100 text-red-700; + @apply bg-red-50 text-red-700; code { @apply border-red-700; } @@ -357,6 +375,7 @@ hr { } code { @apply border-1; + margin: 0; } } @@ -381,7 +400,8 @@ Dark Mode @media (prefers-color-scheme: dark) { code { - @apply border-neutral-600 font-mono text-amber-500; + border-color: var(--accent-color); + color: var(--accent-color); } img { @@ -389,17 +409,20 @@ Dark Mode } tr { - @apply border-t-1 border-neutral-600; + @apply border-t-1; + border-color: var(--accent-color); } th { - @apply border-1 border-neutral-600; + @apply border-1; + border-color: var(--accent-color); } td { - @apply border-1 border-neutral-600; + @apply border-1; + border-color: var(--accent-color); code { - @apply border-1 border-neutral-600; + @apply border-1; } } @@ -407,19 +430,23 @@ Dark Mode p, blockquote { code { - @apply border-1 border-neutral-600; + @apply border-1; + border-color: var(--accent-color); } } .labeled-highlight__label { translate: 0% -50%; code { - @apply border-neutral-600 bg-zinc-800; + /* @apply border-neutral-600 bg-zinc-800; */ + @apply bg-zinc-800; + border-color: var(--accent-color); } } .highlight { - @apply border-1 rounded-sm border-neutral-600; + @apply border-1 rounded-sm; + border-color: var(--accent-color); } .tags { @@ -427,7 +454,7 @@ Dark Mode } :is(.read-more, .pager) a { - @apply text-amber-500; + color: var(--accent-color); } nav a { @@ -444,22 +471,29 @@ Light Mode */ @media (prefers-color-scheme: light) { + :root { + --accent-color: var(--color-orange-700); + } code { - @apply font-mono text-orange-700; + color: var(--accent-color); } tr { - @apply border-t-1 border-neutral-600; + @apply border-t-1; + border-color: var(--accent-color); } th { - @apply border-1 border-neutral-600; + @apply border-1; + border-color: var(--accent-color); } td { - @apply border-1 border-neutral-600; + @apply border-1; + border-color: var(--accent-color); code { - @apply border-1 border-orange-700; + @apply border-1; + border-color: var(--accent-color); } } @@ -471,14 +505,16 @@ Light Mode p, blockquote { code { - @apply border-1 border-orange-700; + @apply border-1; + border-color: var(--accent-color); } } .labeled-highlight__label { translate: 0; code { - @apply border-orange-500 bg-neutral-100; + @apply bg-neutral-100; + border-color: var(--accent-color); } } @@ -491,6 +527,6 @@ Light Mode } :is(.read-more, .pager) a { - @apply text-orange-700; + color: var(--accent-color); } } diff --git a/layouts/404.html b/layouts/404.html index e66600a..13a51dd 100644 --- a/layouts/404.html +++ b/layouts/404.html @@ -1,5 +1,5 @@ {{ define "main" }} -

{{ ":question: HTTP 404 Page not found :question:" | .RenderString }}

-

{{ "The page you requested cannot be found. Don't know what you're looking for but it's not here." | .RenderString }}

-

Return to the home page.

+

{{ ":question: HTTP 404 Page not found :question:" | .RenderString }}

+

{{ "The page you requested cannot be found. Don't know what you're looking for but it's not here." | .RenderString }}

+

Return to the home page.

{{ end }} diff --git a/layouts/_default/_markup/render-blockquote-alert.html b/layouts/_default/_markup/render-blockquote-alert.html index 6ff2423..14ddbe2 100644 --- a/layouts/_default/_markup/render-blockquote-alert.html +++ b/layouts/_default/_markup/render-blockquote-alert.html @@ -1,25 +1,26 @@ {{- $svgs := dict -"caution" "fas fa-circle-exclamation" -"important" "fas fa-star" -"note" "fas fa-note-sticky" -"tip" "fas fa-lightbulb" -"warning" "fas fa-triangle-exclamation" + "caution" "fas fa-circle-exclamation" + "important" "fas fa-star" + "note" "fas fa-note-sticky" + "tip" "fas fa-lightbulb" + "warning" "fas fa-triangle-exclamation" }} + {{- if eq .Type "alert" }} -
-
- - - - - {{- with .AlertTitle }} -

{{- . }}

- {{- else }} -

{{- or (i18n .AlertType) (title .AlertType) }}

- {{- end }} -
-
- {{- .Text | emojify }} -
-
+
+
+ + + + + {{- with .AlertTitle }} +

{{ . }}

+ {{- else }} +

{{ or (i18n .AlertType) (title .AlertType) }}

+ {{- end }} +
+
+ {{ .Text | emojify }} +
+
{{- end }} diff --git a/layouts/_default/_markup/render-heading.html b/layouts/_default/_markup/render-heading.html index b2898ed..7370260 100644 --- a/layouts/_default/_markup/render-heading.html +++ b/layouts/_default/_markup/render-heading.html @@ -2,4 +2,5 @@ {{ .Text }} - + + diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 14869c4..906c110 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,18 +1,20 @@ - + - {{- partial "head.html" . }} + {{- partial "head.html" . }} -
- {{- partial "header.html" . }} +
+ {{- partial "header.html" . }}
-
- {{- block "main" . -}}{{- end -}} +
+ {{- block "main" . }}{{ end -}}
- {{- partial "footer.html" . -}} + {{ partial "footer.html" . -}}
diff --git a/layouts/_default/home.html b/layouts/_default/home.html index 69ab098..5fe5ee4 100644 --- a/layouts/_default/home.html +++ b/layouts/_default/home.html @@ -1,27 +1,31 @@ -{{- define "main" }} - {{ .Content | emojify }} - {{- $pages := where .Site.RegularPages "Section" "in" .Site.MainSections }} - {{- $paginator := .Paginate $pages }} - {{- range $paginator.Pages }} -
-

{{ .LinkTitle }}

- {{- if eq .Truncated false -}} -

There is no summary. Someone got lazy.

- Read Anyway → - {{- else -}} - -{{ .Summary | emojify }} +{{- define "main" -}} +{{ .Content | emojify }} +{{- $pages := where .Site.RegularPages "Section" "in" .Site.MainSections }} +{{- $paginator := .Paginate $pages }} +{{- range $paginator.Pages }} +
+

+ {{ .LinkTitle }} +

+{{- if eq .Truncated false }} +

There is no summary. Someone got lazy.

+ + Read Anyway → - {{- end -}} - {{- if .Truncated -}} - Read More → - {{- end -}} -
- {{- end -}} -
- {{- partial "pagination.html" . }} - -{{- end -}} +{{- else }} + + {{ .Summary | emojify }} + +{{- end }} +{{- if .Truncated }} + + Read More → + +{{- end }} +
+
+{{- end }} +{{- partial "pagination.html" . }} + +{{- end }} {{- /* Trim EOF */ -}} diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 7049f90..5b65fe3 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -1,13 +1,17 @@ {{ define "main" }} - {{ .Content | emojify }} - - +{{ .Content | emojify }} + {{ end }} diff --git a/layouts/about/single.html b/layouts/about/single.html index 11e1e62..fb7ea55 100644 --- a/layouts/about/single.html +++ b/layouts/about/single.html @@ -1,7 +1,7 @@ {{- define "main" }} - {{ partial "post-meta.html" . }} -
- {{ .Content | emojify }} -
- +{{ partial "post-meta.html" . }} +
+ {{ .Content | emojify }} +
+ {{ end -}} diff --git a/layouts/partials/fonts.html b/layouts/partials/fonts.html index c6eeeae..24e7040 100644 --- a/layouts/partials/fonts.html +++ b/layouts/partials/fonts.html @@ -1,4 +1,4 @@ {{- range resources.Match "fontawesome/webfonts/**" -}} - {{- .Publish -}} + {{- .Publish -}} {{- end -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 38c1d30..1b61efb 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -1,35 +1,44 @@
- {{- /* Copyright */ -}} - {{- with .Site.Copyright -}} -

{{ . | markdownify }}

- {{- else }}

© {{ now.Format "2006" }} {{ $.Site.Params.Author.name }}

{{ end -}} -

Built with and Simpl. Powered by Hugo. {{ with .GitInfo -}}{{- .AbbreviatedHash -}}{{- end -}}

+{{- /* Copyright */ -}} +{{- with .Site.Copyright }} +

{{ . | markdownify }}

+{{- else -}} +

© {{ now.Format "2006" }} {{ $.Site.Params.Author.name }}

+{{- end -}} +

Built with and +Simpl. +Powered by Hugo. +{{- with .GitInfo }}{{ .AbbreviatedHash }}{{- end -}} +

{{- /* Trim EOF */ -}} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index ed43d9f..23e8255 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,44 +1,41 @@ - - -{{- if .IsHome -}} - {{- site.Title | emojify }} -{{- else -}} - {{ .Title | emojify }} · {{ .Site.Title | emojify }} - -{{- end -}} + + +{{- if .IsHome }} +{{- site.Title | emojify }} +{{- else }} +{{ .Title | emojify }} · {{ .Site.Title | emojify }} + +{{ end -}} -{{- if .Description -}} - +{{ if .Description -}} + {{- else -}} - + {{- end -}} {{- if .Keywords -}} - + {{- else -}} {{- with .Site.Params.keywords -}} - -{{- end -}}{{- end -}} + +{{- end -}} +{{- end -}} {{- with .Site.Params.robots -}} - + {{- end -}} {{- with .Params.robots -}} - + {{ end -}} - + {{- range .AlternativeOutputFormats }} - {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | emojify | safeHTML -}} -{{- end -}} -{{ partialCached "head/css.html" . -}} -{{- partialCached "fonts.html" . -}} -{{- partialCached "head/js.html" . -}} - - - - - -{{- with .OutputFormats.Get "rss" }} - {{- printf `` .Rel .MediaType.Type .Permalink site.Title | safeHTML -}} -{{- end -}} +{{- printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | emojify | safeHTML -}} +{{- end }} +{{ partialCached "head/css.html" . }} +{{- partialCached "fonts.html" . }} +{{- partialCached "head/js.html" . }} + + + + {{- partial "head-custom.html" . -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html index 2b3fd0d..1a57b82 100644 --- a/layouts/partials/head/css.html +++ b/layouts/partials/head/css.html @@ -1,42 +1,60 @@ -{{ with (templates.Defer (dict "key" "global")) -}} - {{ $t := debug.Timer "tailwindcss" -}} - {{ with resources.Get "css/main.css" -}} - {{ $opts := dict "inlineImports" true "minify" true "optimize" (not hugo.IsDevelopment) -}} - {{ with . | css.TailwindCSS $opts }} - {{- if hugo.IsDevelopment -}} - - {{- else -}} - {{ with . | fingerprint }} - - {{- end -}} - {{- end -}} +{{- with (templates.Defer (dict "key" "global")) -}} + {{- $t := debug.Timer "tailwindcss" -}} + {{- with resources.Get "css/main.css" -}} + {{- $opts := dict "inlineImports" true "minify" true "optimize" (not hugo.IsDevelopment) -}} + {{- with . | css.TailwindCSS $opts }} + {{- if hugo.IsDevelopment -}} + + {{- else -}} + {{- with . | fingerprint }} + {{- end -}} + {{- end -}} {{- end -}} - {{- $t.Stop -}} + {{- end -}} + {{- $t.Stop -}} +{{- end }} +{{- with (templates.Defer (dict "key" "global")) -}} +{{- $t := debug.Timer "tailwindcss" -}} +{{- with resources.Get "css/syntax.css" -}} +{{- $opts := dict "inlineImports" true "minify" true "optimize" (not hugo.IsDevelopment) -}} +{{- with . | css.TailwindCSS $opts -}} +{{- if hugo.IsDevelopment -}} + +{{- else -}} +{{- with . | fingerprint }} + +{{- end -}} {{- end -}} -{{ with (templates.Defer (dict "key" "global")) -}} - {{ $t := debug.Timer "tailwindcss" -}} - {{ with resources.Get "css/syntax.css" -}} - {{ $opts := dict "inlineImports" true "minify" true "optimize" (not hugo.IsDevelopment) }} - {{ with . | css.TailwindCSS $opts }} - {{- if hugo.IsDevelopment -}} - - {{- else -}} - {{- with . | fingerprint }} - - {{- end -}} - {{- end -}} - {{- end -}} - {{- end -}} - {{- $t.Stop -}} {{- end -}} -{{ with resources.Get "fontawesome/css/all.css" -}} - {{ if hugo.IsDevelopment -}} - - {{- else -}} - {{ with . | postCSS | minify | fingerprint }} - - {{ end -}} +{{- end -}} +{{- $t.Stop -}} +{{- end }} +{{- with resources.Get "fontawesome/css/all.css" }} +{{- if hugo.IsDevelopment -}} + +{{- else -}} + {{- with . | postCSS | minify | fingerprint }} + + {{- end -}} +{{- end -}} +{{- end }} + +{{- $t := debug.Timer "accent-tailwindcss" -}} +{{- with $.Site.Params.accentColor -}} + {{- $cssPath := printf "css/%s.css" . -}} + {{- with resources.Get $cssPath -}} + {{- $opts := dict "inlineImports" true "minify" true "optimize" (not hugo.IsDevelopment) -}} + {{- with . | css.TailwindCSS $opts }} + {{- if hugo.IsDevelopment -}} + + {{- else -}} + {{- with . | fingerprint }} + + {{- end -}} + {{- end -}} {{- end -}} + {{- end -}} {{- end -}} +{{- $t.Stop -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html index cf5e47c..33cf1ed 100644 --- a/layouts/partials/head/js.html +++ b/layouts/partials/head/js.html @@ -1,14 +1,14 @@ {{- with resources.Get "js/main.js" -}} - {{- if eq hugo.Environment "development" -}} - {{- with . | js.Build }} - - {{- end -}} - {{- else -}} - {{ $opts := dict "minify" true }} - {{- with . | js.Build $opts | fingerprint }} - - {{- end -}} - {{- end }} +{{- if eq hugo.Environment "development" -}} +{{- with . | js.Build }} + +{{- end -}} +{{- else -}} +{{ $opts := dict "minify" true }} +{{- with . | js.Build $opts | fingerprint }} + +{{- end -}} +{{- end }} {{- end -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 88a5743..02720c6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,11 +1,25 @@ {{- $lastmod := .Lastmod | time.Format ":date_long" -}} {{- if .IsHome -}} -

{{site.Title}}

+

+ + {{ site.Title }} + +

{{- else -}} -

{{site.Title}}

+

+ + {{ site.Title }} + +

+ {{- end -}} {{- partial "menu.html" (dict "menuID" "main" "page" .) -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html index 83bd571..e915198 100644 --- a/layouts/partials/menu.html +++ b/layouts/partials/menu.html @@ -1,43 +1,44 @@ {{- $page := .page -}} {{- $menuID := .menuID -}} {{- with index site.Menus $menuID -}} - + {{- end -}} + {{- define "partials/inline/menu/walk.html" -}} - {{- $page := .page }} - {{- range .menuEntries }} - {{- $attrs := dict "href" .URL }} - {{- if $page.IsMenuCurrent .Menu . }} - {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} - {{- else if $page.HasMenuCurrent .Menu . }} - {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} - {{- end -}} - {{- $name := .Name }} - {{- with .Identifier }} - {{- with T . }} - {{- $name = . }} - {{- end -}} - {{- end -}} - - {{- end -}} +{{- $page := .page }} +{{- range .menuEntries }} +{{- $attrs := dict "href" .URL }} +{{- if $page.IsMenuCurrent .Menu . }} + {{- $attrs = merge $attrs (dict "class" "active" "aria-current" "page") }} +{{- else if $page.HasMenuCurrent .Menu . }} + {{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }} {{- end -}} +{{- $name := .Name }} +{{- with .Identifier }} +{{- with T . }} + {{- $name = . }} +{{- end -}} +{{- end -}} + +{{- end -}} +{{- end -}} + {{- /* Trim EOF */ -}} diff --git a/layouts/partials/pager.html b/layouts/partials/pager.html index 530ad2d..c79dd82 100644 --- a/layouts/partials/pager.html +++ b/layouts/partials/pager.html @@ -2,14 +2,24 @@ diff --git a/layouts/partials/pagination.html b/layouts/partials/pagination.html index 9beff8e..8048aee 100644 --- a/layouts/partials/pagination.html +++ b/layouts/partials/pagination.html @@ -1,18 +1,18 @@ {{- with .Paginator -}} - {{- $currentPageNumber := .PageNumber -}} -
- -
+{{- $currentPageNumber := .PageNumber -}} +
+ +
{{- end -}} {{- /* Trim EOF */ -}} diff --git a/layouts/partials/post-meta.html b/layouts/partials/post-meta.html index 408d321..e72cf88 100644 --- a/layouts/partials/post-meta.html +++ b/layouts/partials/post-meta.html @@ -1,21 +1,23 @@ diff --git a/layouts/partials/terms.html b/layouts/partials/terms.html index 48ba445..8c64e07 100644 --- a/layouts/partials/terms.html +++ b/layouts/partials/terms.html @@ -11,17 +11,17 @@ {{- $taxonomy := .taxonomy }} {{- with $page.GetTerms $taxonomy }} - {{- $label := (index . 0).Parent.LinkTitle }} -
- {{ $label }}: - -
- "partials/terms.html" +{{- $label := (index . 0).Parent.LinkTitle }} +
+ {{ $label }}: + +
+{{/* "partials/terms.html" */}} {{ end -}} {{- /* Trim EOF */ -}} diff --git a/layouts/posts/list.html b/layouts/posts/list.html index d0dfdcc..e723127 100644 --- a/layouts/posts/list.html +++ b/layouts/posts/list.html @@ -1,29 +1,36 @@ {{ define "main" }} - {{ $pages := where site.RegularPages "Section" "posts" }} - {{ $paginator := .Paginate $pages }} - {{ range $paginator.Pages }} -
-

- {{ .LinkTitle }} -

- {{ if eq .Truncated false }} -

There is no summary. Someone got lazy.

- Read Anyway → - {{ else }} - - {{ .Summary | emojify }} - - {{ end }} - {{ if .Truncated }} - - - - {{ end }} -
-
- {{ end }} - {{ partial "pagination.html" . }} - +{{ $pages := where site.RegularPages "Section" "posts" }} +{{ $paginator := .Paginate $pages }} +{{ range $paginator.Pages }} + +
+{{ end }} +{{ partial "pagination.html" . }} + {{ end }} {{- /* Trim EOF */ -}} diff --git a/layouts/posts/single.html b/layouts/posts/single.html index 5067e91..f56fd60 100644 --- a/layouts/posts/single.html +++ b/layouts/posts/single.html @@ -1,9 +1,9 @@ {{ define "main" }} - {{ partial "post-meta.html" . }} -
- {{ .Content | emojify }} -
- {{- partial "pager.html" . }} - +{{ partial "post-meta.html" . }} +
+ {{ .Content | emojify }} +
+{{- partial "pager.html" . }} + {{ end }} {{- /* Trim EOF */ -}} diff --git a/layouts/shortcodes/labeled-highlight.html b/layouts/shortcodes/labeled-highlight.html index 1511cd2..75211ba 100644 --- a/layouts/shortcodes/labeled-highlight.html +++ b/layouts/shortcodes/labeled-highlight.html @@ -3,6 +3,7 @@ {{- $options := cond .IsNamedParams (.Get "options") (.Get 2) -}} {{- $inner := trim .Inner "\n\r" -}} {{- $highlight := "" -}} + {{- if hasPrefix $inner "```" -}} {{- /* Inner is a code fence, so render with markdownify */ -}} {{- $highlight = $inner | markdownify -}} @@ -10,6 +11,7 @@ {{- /* Inner is not a code fence, so render with highlight */ -}} {{- $highlight = highlight $inner $lang $options -}} {{- end -}} + {{- /* Output */ -}}
{{- with $label }}