diff --git a/.github/workflows/cron-check-int-links.yml b/.github/workflows/cron-check-int-links.yml index 0dc64eaa8..8f25ae1de 100644 --- a/.github/workflows/cron-check-int-links.yml +++ b/.github/workflows/cron-check-int-links.yml @@ -14,7 +14,7 @@ jobs: steps: - name: Install Hugo CLI env: - HUGO_VERSION: 0.147.5 + HUGO_VERSION: 0.152.2 run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb diff --git a/.github/workflows/cron-deploy-hugo-site.yml b/.github/workflows/cron-deploy-hugo-site.yml index 7dc293f1a..00e1d92ab 100644 --- a/.github/workflows/cron-deploy-hugo-site.yml +++ b/.github/workflows/cron-deploy-hugo-site.yml @@ -30,7 +30,7 @@ jobs: - name: Install Hugo CLI env: - HUGO_VERSION: 0.147.5 + HUGO_VERSION: 0.152.2 run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index d69be16bd..50a3c8ca7 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -31,7 +31,7 @@ jobs: - name: Install Hugo CLI env: - HUGO_VERSION: 0.147.5 + HUGO_VERSION: 0.152.2 run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb diff --git a/.github/workflows/pr-article-details.yml b/.github/workflows/pr-article-details.yml index 05500bb03..8e3425d2c 100644 --- a/.github/workflows/pr-article-details.yml +++ b/.github/workflows/pr-article-details.yml @@ -10,7 +10,7 @@ on: env: TARGET_REPO_URL: "https://github.com/espressif/developer-portal.git" TARGET_BRANCH: "main" - HUGO_VERSION: 0.147.5 + HUGO_VERSION: 0.152.2 jobs: check-article-details: diff --git a/.github/workflows/pr-build-preview.yml b/.github/workflows/pr-build-preview.yml index 89132096f..2cb508981 100644 --- a/.github/workflows/pr-build-preview.yml +++ b/.github/workflows/pr-build-preview.yml @@ -17,7 +17,7 @@ jobs: steps: - name: Install Hugo CLI env: - HUGO_VERSION: 0.147.5 + HUGO_VERSION: 0.152.2 run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb diff --git a/.gitlab/ci/build_hugo.yml b/.gitlab/ci/build_hugo.yml index 5fce9d125..4de058f2c 100644 --- a/.gitlab/ci/build_hugo.yml +++ b/.gitlab/ci/build_hugo.yml @@ -1,6 +1,6 @@ build_hugo: stage: build_hugo - image: "hugomods/hugo:debian-base-0.147.5" + image: "hugomods/hugo:debian-base-0.152.2" tags: - build_docs rules: diff --git a/README.md b/README.md index 58933b479..73fcb4c8c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Developer Portal +[![Minimum Hugo Version](https://img.shields.io/static/v1?label=min-Hugo-version&message=0.141.0&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.141.0) +[![Maximum Hugo Version](https://img.shields.io/static/v1?label=max-Hugo-version&message=0.152.2&color=blue&logo=hugo)](https://github.com/gohugoio/hugo/releases/tag/v0.152.2) + + This project stores the files for the [Espressif Developer Portal][] website. GitHub Actions statically generate the website using Hugo and pushes it to a web server for online hosting. [Espressif Developer Portal]: https://developer.espressif.com/ diff --git a/config/_default/params.toml b/config/_default/params.toml index 96c30d320..747d1b70c 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -57,7 +57,7 @@ smartTOCHideUnfocusedChildren = false showDate = true showViews = false showLikes = false - showDateOnlyInArticle = true + showDateOnlyInArticle = false showDateUpdated = true showAuthor = false showHero = true diff --git a/content/_index.md b/content/_index.md index 419837e70..2f9f5188a 100755 --- a/content/_index.md +++ b/content/_index.md @@ -12,9 +12,9 @@ cascade: ## Featured Articles -{{< article link="/blog/2025/11/advanced-porting-libraries-as-components/" >}} +{{< article link="/blog/2025/11/advanced-porting-libraries-as-components/" showSummary=true compactSummary=true >}}
-{{< article link="/blog/2025/11/esp32c2-ram-optimization/" >}} +{{< article link="/blog/2025/11/esp32c2-ram-optimization/" showSummary=true compactSummary=true >}}
{{< button href="blog/" target="_self" >}} @@ -25,7 +25,7 @@ More Articles Dive into our latest workshops and master the skills you need to maximize the power of the ESP32. -{{< article link="/workshops/esp-idf-basic/" >}} +{{< article link="/workshops/esp-idf-basic/" showSummary=true compactSummary=true >}}
{{< button href="workshops/" target="_self" >}} @@ -34,7 +34,7 @@ More Workshops ## Notable Events -{{< article link="/events/devcon25/" >}} +{{< article link="/events/devcon25/" showSummary=true compactSummary=true >}}
{{< button href="events/" target="_self" >}} diff --git a/content/workshops/iot-introduction-with-rainmaker/index.md b/content/workshops/iot-introduction-with-rainmaker/index.md index 7982fbb90..7bd28406c 100644 --- a/content/workshops/iot-introduction-with-rainmaker/index.md +++ b/content/workshops/iot-introduction-with-rainmaker/index.md @@ -6,7 +6,6 @@ tags: ["Workshop", "RainMaker", "ESP-IDF"] authors: - "pedro-minatel" showTableOfContents: false -showAuthor: false --- Welcome to the IoT workshop with [ESP RainMaker](https://rainmaker.espressif.com/). The ESP RainMaker was designed to empower you to build, develop, and deploy customized AIoT solutions effortlessly. ESP RainMaker ensures you can achieve your goals with minimal coding and maximum security. diff --git a/content/workshops/micropython-jupyter-notebooks-in-browser/_index.md b/content/workshops/micropython-jupyter-notebooks-in-browser/_index.md index 6f38d41ef..f81b66992 100644 --- a/content/workshops/micropython-jupyter-notebooks-in-browser/_index.md +++ b/content/workshops/micropython-jupyter-notebooks-in-browser/_index.md @@ -8,7 +8,6 @@ tags: ["Workshop", "MicroPython", "Jupyter", "Browser"] authors: - "daniel-paul" showTableOfContents: false -showAuthor: false summary: "In this workshop, you will learn how to program Espressif SoCs directly in your browser using MicroPython and Jupyter notebooks. We will primarily be using ESP32-C3-DevKit-RUST-2 development board. In the process, we will cover LED control, wireless communication, sensors, and MQTT." --- diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 59d2da489..b581d7c1d 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,75 +1,61 @@ - - + - + data-default-appearance="{{ site.Params.defaultAppearance | default `light` }}" + data-auto-appearance="{{ site.Params.autoSwitchAppearance | default `true` }}"> {{- partial "head.html" . -}} - - - - -
- -
- - {{ i18n "nav.skip_to_main" }} - -
- - {{ $layout := default "basic" .Site.Params.header.layout }} - {{ $exists := printf "partials/header/%s.html" $layout }} - {{ $call := printf "header/%s.html" $layout }} - {{ if templates.Exists $exists }} - {{ partial $call . }} - {{ else }} - {{ partial "header/basic.html" . }} - {{ end }} - -
-
- {{ block "main" . }}{{ end }} - {{ if and (.Site.Params.footer.showScrollToTop | default true) (gt .WordCount 1) }} - {{- partial "scroll-to-top.html" . -}} - {{ end }} -
- - {{- partial "footer.html" . -}} - - {{ if .Site.Params.enableSearch | default false }} - {{- partial "search.html" . -}} + {{- partialCached "init.html" . -}} + + {{ $bodyLayout := "flex flex-col h-screen m-auto leading-7 max-w-7xl px-6 sm:px-14 md:px-24 lg:px-32" }} + {{ $bodyColor := "text-lg bg-neutral text-neutral-900 dark:bg-neutral-800 dark:text-neutral" }} + {{ $bodyScrollbar := "scrollbar-thin scrollbar-track-neutral-200 scrollbar-thumb-neutral-400 dark:scrollbar-track-neutral-800 dark:scrollbar-thumb-neutral-600" }} + + + {{ $header := print "header/" site.Params.header.layout ".html" }} + {{ if templates.Exists ( printf "partials/%s" $header ) }} + {{ partial $header . }} + {{ else }} + {{ partial "header/basic.html" . }} + {{ end }} +
+
+ {{ block "main" . }}{{ end }} + {{ if and (site.Params.footer.showScrollToTop | default true) }} + {{- partial "scroll-to-top.html" . -}} {{ end }} -
- -
+ + {{- partial "footer.html" . -}} + {{ if site.Params.enableSearch | default false }} + {{- partial "search.html" . -}} + {{ end }} +
+ {{/* Remove buymeacoffee widget */}} + + + {{ partial "features/kapa-widget.html" . }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8bd44334e..3899d9885 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -1,88 +1,50 @@ {{ define "main" }} -{{ .Scratch.Set "scope" "single" }} - -
- {{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }} - {{ $heroStyle := .Params.heroStyle }} - {{ if not $heroStyle }}{{ $heroStyle = .Site.Params.article.heroStyle }}{{ end }} - {{ $heroStyle := print "hero/" $heroStyle ".html" }} - {{ if templates.Exists ( printf "partials/%s" $heroStyle ) }} - {{ partial $heroStyle . }} - {{ else }} - {{ partial "hero/basic.html" . }} - {{ end }} - {{ end }} - -
- {{ if .Params.showBreadcrumbs | default (.Site.Params.article.showBreadcrumbs | default false) }} - {{ partial "breadcrumbs.html" . }} - {{ end }} -

- {{ .Title | emojify }} -

-
- {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} -
- - {{ $authorsData := .Site.Data.authors }} - {{ $taxonomies := .Site.Taxonomies.authors }} - {{ $baseURL := .Site.BaseURL }} - {{ $taxonomyLink := 0 }} - {{ $showAuthor := 0 }} - - {{ if not (strings.HasSuffix $baseURL "/") }} - {{ $baseURL = delimit (slice $baseURL "/") "" }} + {{ .Scratch.Set "scope" "single" }} +
+ {{/* Hero */}} + {{ if .Params.showHero | default (site.Params.article.showHero | default false) }} + {{ $heroStyle := .Params.heroStyle }} + {{ if not $heroStyle }}{{ $heroStyle = site.Params.article.heroStyle }}{{ end }} + {{ $heroStyle := print "hero/" $heroStyle ".html" }} + {{ if templates.Exists ( printf "partials/%s" $heroStyle ) }} + {{ partial $heroStyle . }} + {{ else }} + {{ partial "hero/basic.html" . }} + {{ end }} {{ end }} - {{ if not (.Params.showAuthorBottom | default ( .Site.Params.article.showAuthorBottom | default false)) }} - - {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }} - {{ $showAuthor = 1 }} - {{ partial "author.html" . }} + {{/* Header */}} +
+ {{ if .Params.showBreadcrumbs | default (site.Params.article.showBreadcrumbs | default false) }} + {{ partial "breadcrumbs.html" . }} {{ end }} - - {{ range $author := .Page.Params.authors }} - {{ $authorData := index $authorsData $author }} - {{- if $authorData -}} - {{ range $taxonomyname, $taxonomy := $taxonomies }} - {{ if (eq $taxonomyname $author) }} - {{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} - {{ end }} - {{ end }} - - {{ $finalLink := $taxonomyLink }} - {{ $currentLang := $.Site.Language.Lang }} - {{ if eq $.Site.LanguagePrefix "" }} - {{ $finalLink = printf "%sauthors/%s/" $baseURL $author }} - {{ else }} - {{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }} - {{ end }} - - {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }} - {{- end -}} +

+ {{ .Title | emojify }} +

+
+ {{ partial "article-meta/basic.html" (dict "context" . "scope" "single") }} +
+ {{ if not (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }} + {{ template "SingleAuthor" . }} {{ end }} - - {{ if or $taxonomyLink $showAuthor }} -
+
+ + {{/* Body */}} +
+ {{ $enableToc := site.Params.article.showTableOfContents | default false }} + {{ $enableToc = .Params.showTableOfContents | default $enableToc }} + {{ $showToc := and $enableToc (in .TableOfContents " +
+ {{ if $showToc }} + {{ partial "toc.html" . }} + {{ end }} +
+ {{ end }} - {{ end }} - -
- -
- - {{ if or (and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in - .TableOfContents " -
- - {{ if and (.Params.showTableOfContents | default (.Site.Params.article.showTableOfContents | default false)) (in - .TableOfContents " -
- {{ end }}
@@ -92,55 +54,113 @@

{{ end }} + {{ partial "series/series.html" . }} +
- {{ .Content | emojify }} + {{ .Content }} + {{ $defaultReplyByEmail := site.Params.replyByEmail }} + {{ $replyByEmail := default $defaultReplyByEmail .Params.replyByEmail }} + {{ if $replyByEmail }} + + + Reply by Email + + + {{ end }}
+ {{ if (.Params.showAuthorBottom | default (site.Params.article.showAuthorBottom | default false)) }} + {{ template "SingleAuthor" . }} + {{ end }} + + {{ partial "series/series-closed.html" . }} {{ partial "sharing-links.html" . }} - {{ if (eq (.Site.Params.defaultAppearance | default "light") "light") }} - {{ partial "giscus_light" . }} - {{ else }} - {{ partial "giscus_dark" . }} - {{ end }} + {{ partial "features/giscus-auto.html" . }} {{ partial "related.html" . }} - {{ with .File }} - + {{ $translations := .AllTranslations }} + {{ with .File }} + {{ $path := .Path }} + {{ range $translations }} + {{ $lang := print "." .Lang ".md" }} + {{ $path = replace $path $lang ".md" }} + {{ end }} + {{ $jsPage := resources.Get "js/page.js" }} + {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint (site.Params.fingerprintAlgorithm | default "sha512") }} + {{ end }} - {{ $jsPage := resources.Get "js/page.js" }} - {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }} - -
-
+{{ end }} - - +{{ define "SingleAuthor" }} + {{ $authorsData := site.Data.authors }} + {{ $taxonomies := site.Taxonomies.authors }} + {{ $baseURL := site.BaseURL }} + {{ $taxonomyLink := 0 }} + {{ $showAuthor := 0 }} + {{ $isAuthorBottom := (.Params.showAuthorBottom | default ( site.Params.article.showAuthorBottom | default false)) }} + + {{ if not (strings.HasSuffix $baseURL "/") }} + {{ $baseURL = delimit (slice $baseURL "/") "" }} + {{ end }} + + {{ if .Params.showAuthor | default (site.Params.article.showAuthor | default true) }} + {{ $showAuthor = 1 }} + {{ partial "author.html" . }} + {{ end }} + + {{ range $author := .Page.Params.authors }} + {{ $authorData := index $authorsData $author }} + {{- if $authorData -}} + {{ range $taxonomyname, $taxonomy := $taxonomies }} + {{ if (eq $taxonomyname $author) }} + {{ $taxonomyLink = delimit (slice $baseURL "authors/" $author "/") "" }} + {{ end }} + {{ end }} + + {{ $finalLink := $taxonomyLink }} + {{ $currentLang := site.Language.Lang }} + {{ if eq site.LanguagePrefix "" }} + {{ $finalLink = printf "%sauthors/%s/" $baseURL $author }} + {{ else }} + {{ $finalLink = printf "%s%s/authors/%s/" $baseURL $currentLang $author }} + {{ end }} + {{ partial "author-extra.html" (dict "context" . "data" $authorData "link" $finalLink) }} + {{- end -}} + {{ end }} + + {{ if or $taxonomyLink $showAuthor }} +
+ {{ end }} {{ end }} diff --git a/layouts/partials/article-link/card-related.html b/layouts/partials/article-link/card-related.html index 9a366b9af..7b1fda61b 100644 --- a/layouts/partials/article-link/card-related.html +++ b/layouts/partials/article-link/card-related.html @@ -1,82 +1,105 @@ -{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ with .Params.externalUrl }} - - {{ else }} - - {{ end }} -
+{{/* Used by + 1. layouts/partials/related.html (related articles in single page) +*/}} +{{ $disableImageOptimization := site.Store.Get "disableImageOptimization" }} - {{- with $.Params.images -}} - {{- range first 6 . }} - {{ end -}} - {{- else -}} - {{- $images := $.Resources.ByType "image" -}} - {{- $featured := $images.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{ if and .Params.featureimage (not $featured) }} - {{- $url:= .Params.featureimage -}} - {{ $featured = resources.GetRemote $url }} +{{ $page := .Page }} +{{ $featured := "" }} +{{ $featuredURL := "" }} +{{/* frontmatter */}} +{{ with $page }} + {{ with .Params.featureimage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ if site.Params.hotlinkFeatureImage }} + {{ $featuredURL = . }} + {{ else }} + {{ $featured = resources.GetRemote . }} {{ end }} + {{ else }} + {{ $featured = resources.Get . }} + {{ end }} + {{ end }} - {{ if .Params.featureAsset }} - {{- $genericImage := .Params.featureAsset -}} - {{- if not $featured }}{{ $featured = resources.Get $genericImage }}{{ end -}} - {{ end }} + {{/* Allow adding feature images from the assets folder */}} + {{ if .Params.featureAsset }} + {{- $genericImage := .Params.featureAsset -}} + {{- if not $featured }}{{ $featured = resources.Get $genericImage }}{{ end -}} + {{ end }} - {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} - {{- with $featured -}} - {{ if $disableImageOptimization }} - {{ with . }} - - {{ end }} - {{ else }} - {{ with .Resize "600x" }} - - {{ end }} - {{ end }} - {{- else -}} - {{- with $.Site.Params.images }} - {{ end -}} - {{- end -}} - {{- end -}} + {{/* page resources */}} + {{ if not (or $featured $featuredURL) }} + {{ $images := .Resources.ByType "image" }} + {{ range slice "*feature*" "*cover*" "*thumbnail*" }} + {{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }} + {{ end }} + {{ end }} + {{/* fallback to default */}} + {{ if not (or $featured $featuredURL) }} + {{ $default := site.Store.Get "defaultFeaturedImage" }} + {{ if $default.url }} + {{ $featuredURL = $default.url }} + {{ else if $default.obj }} + {{ $featured = $default.obj }} + {{ end }} + {{ end }} - {{ if and .Draft .Site.Params.article.showDraftLabel }} - - {{ partial "badge.html" (i18n "article.draft" | emojify) }} - + {{/* generate image URL if not hotlink */}} + {{ if not $featuredURL }} + {{ with $featured }} + {{ $featuredURL = .RelPermalink }} + {{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }} + {{ $featuredURL = (.Resize "600x").RelPermalink }} {{ end }} + {{ end }} + {{ end }} +{{ end }} -
- {{ with .Params.externalUrl }} -
- - {{ else }} -
{{ .Title | emojify }}
- {{ end }} - -
- {{ partial "article-meta/basic.html" . }} -
- - {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} -
- {{ .Summary | emojify }} -
- {{ end }} -
-
- -
+ {{ end }} + +
+ +
+ {{ partial "article-meta/basic.html" . }}
- \ No newline at end of file + {{ if .Params.showSummary | default (.Site.Params.list.showSummary | default false) }} +
{{ .Summary | plainify }}
+ {{ end }} +
+
+ diff --git a/layouts/partials/article-link/card.html b/layouts/partials/article-link/card.html index 1c16b2f5f..f26e21d49 100644 --- a/layouts/partials/article-link/card.html +++ b/layouts/partials/article-link/card.html @@ -1,83 +1,108 @@ -{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} -{{ with .Params.externalUrl }} - - {{ else }} - - {{ end }} -
+{{/* Used by + 1. list.html and term.html (when the cardView option is enabled) + 2. Recent articles template (when the cardView option is enabled) + 3. Shortcode list.html +*/}} +{{ $disableImageOptimization := site.Store.Get "disableImageOptimization" }} - {{- with $.Params.images -}} - {{- range first 6 . }} - {{ end -}} - {{- else -}} - {{- $images := $.Resources.ByType "image" -}} - {{- $featured := $images.GetMatch "*feature*" -}} - {{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} - {{ if and .Params.featureimage (not $featured) }} - {{- $url:= .Params.featureimage -}} - {{ $featured = resources.GetRemote $url }} +{{ $page := .Page }} +{{ $featured := "" }} +{{ $featuredURL := "" }} +{{ if not .Params.hideFeatureImage }} + {{/* frontmatter */}} + {{ with $page }} + {{ with .Params.featureimage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ if site.Params.hotlinkFeatureImage }} + {{ $featuredURL = . }} + {{ else }} + {{ $featured = resources.GetRemote . }} + {{ end }} + {{ else }} + {{ $featured = resources.Get . }} {{ end }} + {{ end }} - {{ if .Params.featureAsset }} - {{- $genericImage := .Params.featureAsset -}} - {{- if not $featured }}{{ $featured = resources.Get $genericImage }}{{ end -}} + {{/* Allow adding feature images from the assets folder */}} + {{ if .Params.featureAsset }} + {{- $genericImage := .Params.featureAsset -}} + {{- if not $featured }}{{ $featured = resources.Get $genericImage }}{{ end -}} {{ end }} - {{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}} - {{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }} - {{- with $featured -}} - {{ if $disableImageOptimization }} - {{ with . }} -
- {{ end }} - {{ else }} - {{ with .Resize "600x" }} -
- {{ end }} + {{/* page resources */}} + {{ if not (or $featured $featuredURL) }} + {{ $images := .Resources.ByType "image" }} + {{ range slice "*feature*" "*cover*" "*thumbnail*" }} + {{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }} {{ end }} - {{- else -}} - {{- with $.Site.Params.images }} - {{ end -}} - {{- end -}} - {{- end -}} + {{ end }} + {{/* fallback to default */}} + {{ if not (or $featured $featuredURL) }} + {{ $default := site.Store.Get "defaultFeaturedImage" }} + {{ if $default.url }} + {{ $featuredURL = $default.url }} + {{ else if $default.obj }} + {{ $featured = $default.obj }} + {{ end }} + {{ end }} - {{ if and .Draft .Site.Params.article.showDraftLabel }} - - {{ partial "badge.html" (i18n "article.draft" | emojify) }} - + {{/* generate image URL if not hotlink */}} + {{ if not $featuredURL }} + {{ with $featured }} + {{ $featuredURL = .RelPermalink }} + {{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }} + {{ $featuredURL = (.Resize "600x").RelPermalink }} + {{ end }} {{ end }} + {{ end }} + {{ end }} +{{ end }} -
+
+ diff --git a/layouts/partials/dynamic_md_block.html b/layouts/partials/features/dynamic_md_block.html similarity index 100% rename from layouts/partials/dynamic_md_block.html rename to layouts/partials/features/dynamic_md_block.html diff --git a/layouts/partials/features/giscus-auto.html b/layouts/partials/features/giscus-auto.html new file mode 100644 index 000000000..071bf9034 --- /dev/null +++ b/layouts/partials/features/giscus-auto.html @@ -0,0 +1,12 @@ +{{/* + Injects the correct Giscus component depending on the default appearance. + - If the site default theme is "light": loads giscus_light. + - Otherwise: loads giscus_dark. + This only switches on first render; user theme switching handled by Giscus itself. +*/}} + +{{ if (eq (.Site.Params.defaultAppearance | default "light") "light") }} + {{ partial "features/giscus_light" . }} +{{ else }} + {{ partial "features/giscus_dark" . }} +{{ end }} diff --git a/layouts/partials/giscus_dark.html b/layouts/partials/features/giscus_dark.html similarity index 100% rename from layouts/partials/giscus_dark.html rename to layouts/partials/features/giscus_dark.html diff --git a/layouts/partials/giscus_light.html b/layouts/partials/features/giscus_light.html similarity index 100% rename from layouts/partials/giscus_light.html rename to layouts/partials/features/giscus_light.html diff --git a/layouts/partials/features/kapa-widget.html b/layouts/partials/features/kapa-widget.html new file mode 100644 index 000000000..fb6b40491 --- /dev/null +++ b/layouts/partials/features/kapa-widget.html @@ -0,0 +1,29 @@ + diff --git a/layouts/partials/learn_custom.html b/layouts/partials/features/learn_custom.html similarity index 100% rename from layouts/partials/learn_custom.html rename to layouts/partials/features/learn_custom.html diff --git a/layouts/partials/features/mermaid-init.html b/layouts/partials/features/mermaid-init.html new file mode 100644 index 000000000..e149263ff --- /dev/null +++ b/layouts/partials/features/mermaid-init.html @@ -0,0 +1,11 @@ +{{/* + If the page includes Mermaid diagrams (`.Store.Get "hasMermaid"`), + this script loads Mermaid from CDN and initializes it automatically. +*/}} + +{{ if .Store.Get "hasMermaid" }} + +{{ end }} diff --git a/layouts/partials/vendor_custom.html b/layouts/partials/features/vendor_custom.html similarity index 100% rename from layouts/partials/vendor_custom.html rename to layouts/partials/features/vendor_custom.html diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 8149a1a2e..5695b1c79 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -2,67 +2,81 @@ {{/* Footer menu */}} {{ if .Site.Params.footer.showMenu | default true }} {{ if .Site.Menus.footer }} - + {{ end }} + {{ $navClass := printf "flex flex-row pb-4 text-base font-medium text-neutral-500 dark:text-neutral-400 %s" (cond $onlyIcon "overflow-x-auto py-2" "") }} + {{ $ulClass := printf "flex list-none %s" (cond $onlyIcon "flex-row" "flex-col sm:flex-row") }} + {{ $liClass := printf "flex mb-1 text-end sm:mb-0 sm:me-7 sm:last:me-0 %s" (cond $onlyIcon "me-4" "") }} + {{ end }} {{ end }}
- {{/* Copyright */}} {{ if .Site.Params.footer.showCopyright | default true }} -

- {{- with replace .Site.Params.copyright "{ year }" now.Year }} - {{ . | emojify | markdownify }} - {{- else }} - © - {{ now.Format "2006" }} - {{ .Site.Params.Author.name | markdownify | emojify }} - {{- end }} -

+

+ {{- with replace .Site.Params.copyright "{ year }" now.Year }} + {{ . | markdownify | emojify }} + {{- else }} + © + {{ now.Format "2006" }} + {{ .Site.Params.Author.name | markdownify | emojify }} + {{- end }} +

{{ end }} {{/* Theme attribution */}} {{ if .Site.Params.footer.showThemeAttribution | default true }} -

- {{ $hugo := printf `Hugo` - }} - {{ $blowfish := printf `Blowfish` }} - {{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }} -

+

+ {{ $hugo := printf `Hugo` + }} + {{ $blowfish := printf `Blowfish` + }} + {{ i18n "footer.powered_by" (dict "Hugo" $hugo "Theme" $blowfish) | safeHTML }} +

{{ end }} -
- + {{ if not .Site.Params.disableImageZoom | default true }} + + {{ end }} {{ $jsProcess := resources.Get "js/process.js" }} - {{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint "sha512" }} - + {{ $jsProcess = $jsProcess | resources.Minify | resources.Fingerprint (.Site.Params.fingerprintAlgorithm | default "sha512") }} + {{/* Extend footer - eg. for extra scripts, etc. */}} {{ if templates.Exists "partials/extend-footer.html" }} - {{ partialCached "extend-footer.html" . }} + {{ partialCached "extend-footer.html" . }} {{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index c81e43b80..1880b8c68 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -1,145 +1,219 @@ - + {{ with .Site.Language.Params.htmlCode | default .Site.LanguageCode }} - + {{ end }} - - + + + + {{/* Title */}} - {{ if .IsHome -}} - {{ .Site.Title | emojify }} - - {{- else -}} - {{ .Title | emojify }} · {{ .Site.Title | emojify }} - - {{- end }} + {{ if .IsHome }} + {{ .Site.Title | emojify }} + + {{ else }} + {{ .Title | emojify }} · {{ .Site.Title | emojify }} + + {{ end }} + {{/* Metadata */}} - {{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description -}} - - {{- end }} - {{ with .Params.Tags | default .Site.Params.keywords -}} - - {{- end }} + {{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description }} + + {{ end }} + {{ with .Params.Tags | default .Site.Params.keywords }} + + {{ end }} {{ with .Site.Params.robots }} - + {{ end }} {{ with .Params.robots }} - - {{ end }} - - {{ range .AlternativeOutputFormats -}} - {{ printf ` - ` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | - safeHTML }} - {{ end -}} - {{/* Asset bundles */}} - {{ $assets := newScratch }} - {{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "blowfish")) }} - {{ if not $cssScheme }} - {{ $cssScheme = resources.Get "css/schemes/blowfish.css" }} - {{ end }} - {{ $assets.Add "css" (slice $cssScheme) }} - {{ $cssMain := resources.Get "css/compiled/main.css" }} - {{ $assets.Add "css" (slice $cssMain) }} - {{ $cssCustom := resources.Get "css/custom.css" }} - {{ if $cssCustom }} - {{ $assets.Add "css" (slice $cssCustom) }} - {{ end }} - {{ $bundleCSS := $assets.Get "css" | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint - "sha512" }} - {{ $cssCustom := resources.Get "css/custom.css" }} - - - {{ $jsAppearance := resources.Get "js/appearance.js" }} - {{ $jsAppearance = $jsAppearance | resources.ExecuteAsTemplate "js/appearance.js" . | resources.Minify | resources.Fingerprint "sha512" }} - - {{ if .Site.Params.enableSearch | default false }} - {{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }} - {{ $jsSearch := resources.Get "js/search.js" }} - {{ $assets.Add "js" (slice $jsFuse $jsSearch) }} + {{ end }} - {{ if .Site.Params.enableCodeCopy | default false }} - {{ $jsCode := resources.Get "js/code.js" }} - {{ $assets.Add "js" (slice $jsCode) }} + + {{ range .AlternativeOutputFormats }} + {{ printf ` + ` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | + safeHTML + }} {{ end }} - {{ if .Site.Params.rtl | default false }} - {{ $jsRTL := resources.Get "js/rtl.js" }} - {{ $assets.Add "js" (slice $jsRTL) }} - {{ end }} - {{ $jsMobileMenu := resources.Get "js/mobilemenu.js" }} - {{ $assets.Add "js" (slice $jsMobileMenu) }} - {{ if $assets.Get "js" }} - {{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint - "sha512" }} - + + {{/* Me */}} + {{ with .Site.Params.Author.name }} + {{ end }} - {{ if not .Site.Params.disableImageZoom | default true }} - {{ $zoomJS := resources.Get "lib/zoom/zoom.min.js" | resources.Fingerprint "sha512" }} - + {{ with .Site.Params.Author.links }} + {{ range $links := . }} + {{ range $name, $url := $links }} + {{ if not (strings.HasPrefix $url "mailto:") }} + + {{ end }} + {{ end }} + {{ end }} {{ end }} - {{/* Icons */}} - {{ if templates.Exists "partials/favicons.html" }} - {{ partialCached "favicons.html" .Site }} - {{ else }} - - - - + + {{/* Social */}} + {{ template "_internal/opengraph.html" . }} + {{ template "_internal/twitter_cards.html" . }} + {{/* Use defaultSocialImage if feature image does not exist */}} + {{ $featureImage := "" }} + {{ $pageImages := .Resources.ByType "image" }} + {{ range slice "*featured*" "*cover*" "*thumbnail*" }} + {{ if not $featureImage }} + {{ $featureImage = $pageImages.GetMatch . }} + {{ end }} + {{ end }} + {{ if not $featureImage }} + {{ with .Site.Params.defaultSocialImage }} + {{ $socialImage := "" }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $socialImage = resources.GetRemote . }} + {{ else }} + {{ $socialImage = resources.Get . }} + {{ end }} + {{ with $socialImage }} + + + {{ end }} + {{ end }} {{ end }} + {{/* Site Verification */}} {{ with .Site.Params.verification.google }} - + {{ end }} {{ with .Site.Params.verification.bing }} - + {{ end }} {{ with .Site.Params.verification.pinterest }} - + {{ end }} {{ with .Site.Params.verification.yandex }} - + {{ end }} - {{/* Social */}} - {{ template "_internal/opengraph.html" . }} - {{ template "_internal/twitter_cards.html" . }} - {{/* Schema */}} - {{ partial "schema.html" . }} - {{/* Me */}} - {{ with .Site.Params.Author.name }} - {{ end }} - {{ with .Site.Params.Author.links }} - {{ range $links := . }} - {{ range $name, $url := $links }} - {{ end }} + {{ with .Site.Params.verification.fediverse }} + {{ end }} + + {{ $alg := .Site.Params.fingerprintAlgorithm | default "sha512" }} + + {{/* CSS */}} + {{ $cssResources := slice }} + {{ $schemeName := .Site.Params.colorScheme | default "blowfish" }} + {{ $cssScheme := resources.Get (printf "css/schemes/%s.css" $schemeName) | default (resources.Get "css/schemes/blowfish.css") }} + {{ $cssResources = $cssResources | append $cssScheme }} + {{ $cssResources = $cssResources | append (resources.Get "css/compiled/main.css") }} + {{ with resources.Get "css/custom.css" }} + {{ $cssResources = $cssResources | append . }} + {{ end }} + {{ if not .Site.Params.disableImageZoom | default true }} + {{ $cssResources = $cssResources | append (resources.Get "lib/zoom/style.css") }} + {{ end }} + {{ $bundleCSS := $cssResources | resources.Concat "css/main.bundle.css" | resources.Minify | resources.Fingerprint $alg }} + + + {{/* JS loaded immediately */}} + {{ $jsAppearance := resources.Get "js/appearance.js" | resources.ExecuteAsTemplate "js/appearance.js" . | resources.Minify | resources.Fingerprint $alg }} + + {{ $enableA11y := .Site.Params.enableA11y | default false }} + {{ if $enableA11y }} + {{ $jsA11y := resources.Get "js/a11y.js" | resources.Minify | resources.Fingerprint $alg }} + + {{ end }} + {{ $showZenMode := .Params.showZenMode | default (.Site.Params.article.showZenMode | default false) }} + {{ $shouldIncludeZenMode := or $enableA11y $showZenMode }} + {{ if and .IsPage $shouldIncludeZenMode }} + {{ $jsZenMode := resources.Get "js/zen-mode.js" | resources.Minify | resources.Fingerprint $alg }} + + {{ end }} + {{ if not .Site.Params.disableImageZoom | default true }} + {{ $zoomJS := resources.Get "lib/zoom/zoom.min.umd.js" | resources.Fingerprint $alg }} + + {{ end }} + + {{/* JS deferred */}} + {{ $jsResources := slice }} + {{ if site.Params.footer.showScrollToTop | default true }} + {{ $jsResources = $jsResources | append (resources.Get "js/scroll-to-top.js") }} + {{ end }} + {{ if .Site.Params.enableSearch | default false }} + {{ $jsResources = $jsResources | append (resources.Get "lib/fuse/fuse.min.js") | append (resources.Get "js/search.js") }} + {{ end }} + {{ if .Site.Params.enableCodeCopy | default false }} + {{ $jsResources = $jsResources | append (resources.Get "js/code.js") }} + {{ end }} + {{ if .Site.Params.rtl | default false }} + {{ $jsResources = $jsResources | append (resources.Get "js/rtl.js") }} + {{ end }} + {{ $jsResources = $jsResources | append (resources.Get "js/mobilemenu.js") }} + {{ $jsResources = $jsResources | append (resources.Get "js/button-likes.js") }} + {{ $jsResources = $jsResources | append (resources.Get "js/katex-render.js") }} + {{ if $jsResources }} + {{ $bundleJS := $jsResources | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint $alg }} + {{ end }} - {{/* Vendor */}} + + {{/* Conditional loaded resources */}} {{ partial "vendor.html" . }} - {{ partial "vendor_custom.html" . }} - {{ partial "learn_custom.html" . }} - {{ partial "dynamic_md_block.html" . }} + {{ partial "features/vendor_custom.html" . }} + {{ partial "features/learn_custom.html" . }} + {{ partial "features/dynamic_md_block.html" . }} + + {{/* Icons */}} + {{ if templates.Exists "partials/favicons.html" }} + {{ partialCached "favicons.html" .Site }} + {{ else }} + + + + + {{ end }} + + {{/* Schema */}} + {{ partial "schema.html" . }} + {{/* Analytics */}} - {{ partial "analytics/main.html" .Site }} + {{ if hugo.IsProduction }} + {{ partial "analytics/main.html" . }} + {{ end }} + {{/* Extend head - eg. for custom analytics scripts, etc. */}} {{ if templates.Exists "partials/extend-head.html" }} - {{ partialCached "extend-head.html" .Site }} + {{ partialCached "extend-head.html" .Site }} {{ end }} - + + {{/* Uncached extend head - Example: https://gohugo.io/methods/page/hasshortcode/ */}} + {{ if templates.Exists "partials/extend-head-uncached.html" }} + {{ partial "extend-head-uncached.html" . }} + {{ end }} + {{/* Firebase */}} {{ with $.Site.Params.firebase }} - {{ if isset $.Site.Params "firebase" }} - - - - + + + + + {{ end }} {{ end }} + + {{/* Advertisement */}} + {{ with .Site.Params.advertisement.adsense }} + + {{ end }} diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html index 008c0ec03..a593c14a4 100644 --- a/layouts/partials/header/basic.html +++ b/layouts/partials/header/basic.html @@ -1,179 +1,307 @@ - +{{ end }} -
-
- - {{ partial "translations.html" . }} +{{ define "HeaderA11y" }} + {{- $prefix := .prefix | default "" -}} +
+ - {{ if .Site.Params.enableSearch | default false }} - - {{ end }} + - {{/* Appearance switch */}} - {{ if .Site.Params.footer.showAppearanceSwitcher | default false }} - - {{ end }} + +
+{{ end }} + +{{/* ========== Render HTML ========== */}} + {{ if .Site.Menus.subnavigation }} - {{ end }} {{ if .Site.Params.highlightCurrentMenuArea }} - + {{ end }} {{ $styles := resources.Get "css/styles.css" }} diff --git a/layouts/partials/hero/basic.html b/layouts/partials/hero/basic.html index 86ea6f2c6..2a63224aa 100644 --- a/layouts/partials/hero/basic.html +++ b/layouts/partials/hero/basic.html @@ -1,24 +1,69 @@ -{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }} +{{ $disableImageOptimization := site.Store.Get "disableImageOptimization" }} -{{- $images := .Resources.ByType "image" -}} -{{- $featured := $images.GetMatch "*feature*" -}} -{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}} -{{ if .Params.featureimage }} -{{- $url:= .Params.featureimage -}} -{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}} +{{ $useDefault := false }} +{{ $featured := "" }} +{{ $featuredURL := "" }} +{{ with .Params.featureimage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ if site.Params.hotlinkFeatureImage }} + {{ $featuredURL = . }} + {{ else }} + {{ $featured = resources.GetRemote . }} + {{ end }} + {{ else }} + {{ $featured = resources.Get . }} + {{ end }} {{ end }} + +{{/* Allow adding feature images from the assets folder */}} {{ if .Params.featureAsset }} {{- $genericImage := .Params.featureAsset -}} {{- if not $featured }}{{ $featured = resources.Get $genericImage }}{{ end -}} {{ end }} -{{- with $featured -}} - {{ if $disableImageOptimization }} - {{ with . }} -
- {{ end }} - {{ else }} - {{ with .Resize "1200x" }} -
- {{ end }} + +{{ if not (or $featured $featuredURL) }} + {{ $images := .Resources.ByType "image" }} + {{ range slice "*background*" "*feature*" "*cover*" "*thumbnail*" }} + {{ if not $featured }}{{ $featured = $images.GetMatch . }}{{ end }} + {{ end }} +{{ end }} + +{{ if not (or $featured $featuredURL) }} + {{ $default := site.Store.Get "defaultBackgroundImage" }} + {{ if $default.url }} + {{ $featuredURL = $default.url }} + {{ $useDefault = true }} + {{ else if $default.obj }} + {{ $featured = $default.obj }} + {{ $useDefault = true }} + {{ end }} +{{ end }} + +{{/* generate image URL if not hotlink */}} +{{ if not $featuredURL }} + {{ with $featured }} + {{ $featuredURL = .RelPermalink }} + {{ if not (or $disableImageOptimization (eq .MediaType.SubType "svg")) }} + {{ $size := site.Store.Get "backgroundImageWidth" }} + {{ $featuredURL = (.Resize $size).RelPermalink }} {{ end }} -{{- end -}} + {{ end }} +{{ end }} + +{{ with $featuredURL }} + {{ $style := "" }} + {{ $defaultPosition := cond $useDefault site.Params.imagePosition false }} + {{ with $.Params.imagePosition | default $defaultPosition }} + {{ $style = printf "object-position: %s;" . }} + {{ end }} +
+ {{ with $.Params.featureimagealt }}{{ . }}{{ else }}{{ with $.Title }}Featured image for {{ . }}{{ else }}Featured image{{ end }}{{ end }} +
+{{ end }} diff --git a/layouts/partials/home/custom.html b/layouts/partials/home/custom.html index aa13ffae9..520ed7ddd 100644 --- a/layouts/partials/home/custom.html +++ b/layouts/partials/home/custom.html @@ -14,7 +14,4 @@ -
- {{ partial "recent-articles-demo.html" . }} -
diff --git a/layouts/partials/hugo-embedded/shortcodes/figure-default.html b/layouts/partials/hugo-embedded/shortcodes/figure-default.html deleted file mode 100644 index e74d30be1..000000000 --- a/layouts/partials/hugo-embedded/shortcodes/figure-default.html +++ /dev/null @@ -1,43 +0,0 @@ -{{/* - Copied from Hugo v0.146 - Source: https://github.com/gohugoio/hugo/blob/83cfdd78ca6469e6d7265323d9fad1448880e559/tpl/tplimpl/embedded/templates/_shortcodes/figure.html -*/}} - - - {{- if .Get "link" -}} - - {{- end -}} - - {{- $u := urls.Parse (.Get "src") -}} - {{- $src := $u.String -}} - {{- if not $u.IsAbs -}} - {{- with or (.Page.Resources.Get $u.Path) (resources.Get $u.Path) -}} - {{- $src = .RelPermalink -}} - {{- end -}} - {{- end -}} - - {{ with .Get - {{- if .Get "link" }}{{ end -}} - {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} -
- {{ with (.Get "title") -}} -

{{ . }}

- {{- end -}} - {{- if or (.Get "caption") (.Get "attr") -}}

- {{- .Get "caption" | markdownify -}} - {{- with .Get "attrlink" }} - - {{- end -}} - {{- .Get "attr" | markdownify -}} - {{- if .Get "attrlink" }}{{ end }}

- {{- end }} -
- {{- end }} - diff --git a/layouts/partials/recent-articles-demo.html b/layouts/partials/recent-articles-demo.html deleted file mode 100644 index ff045e512..000000000 --- a/layouts/partials/recent-articles-demo.html +++ /dev/null @@ -1,32 +0,0 @@ -{{ $recentArticles := 5 }} -{{ $showMoreLinkDest := "/posts" }} -{{ if index .Site.Params.homepage "showRecentItems" }} -{{ $recentArticles = .Site.Params.homepage.showRecentItems }} -{{ end }} - -

{{ i18n "shortcode.recent_articles" | emojify }}

- -
- {{ partial "recent-articles/cardview.html" . }} -
- - - - - -{{ if .Site.Params.homepage.showMoreLink | default false }} -{{ if index .Site.Params.homepage "showRecentItems" }} -{{ $showMoreLinkDest = .Site.Params.homepage.showMoreLinkDest }} -{{ end }} - -{{ end }} diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html deleted file mode 100644 index 9789b3d8e..000000000 --- a/layouts/partials/toc.html +++ /dev/null @@ -1,65 +0,0 @@ - -
- - {{ i18n "article.table_of_contents" }} - -
- {{ .TableOfContents | emojify }} -
-
- -{{ if .Site.Params.smartTOC }} - -{{ end }} diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html deleted file mode 100644 index 0b429187b..000000000 --- a/layouts/shortcodes/figure.html +++ /dev/null @@ -1,51 +0,0 @@ -{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }} -{{ if .Get "default" }} - {{ partial "hugo-embedded/shortcodes/figure-default.html" . }} -{{ else }} - {{- $url := urls.Parse (.Get "src") }} - {{- $altText := .Get "alt" }} - {{- $caption := .Get "caption" }} - {{- $href := .Get "href" }} - {{- $class := .Get "class" }} - {{- $target := .Get "target" | default "_blank" }} - {{- $nozoom := .Get "nozoom" | default false -}} - -
- {{- with $href }}{{ end -}} - {{- if findRE "^https?" $url.Scheme }} - {{ $altText }} - {{- else }} - {{- $resource := "" }} - {{- if $.Page.Resources.GetMatch ($url.String) }} - {{- $resource = $.Page.Resources.GetMatch ($url.String) }} - {{- else if resources.GetMatch ($url.String) }} - {{- $resource = resources.Get ($url.String) }} - {{- end }} - {{- with $resource }} - {{- if or $disableImageOptimization (eq .MediaType.SubType "svg")}} - {{ $altText }} - {{- else }} - {{ $altText }} - {{- end }} - {{- else }} - {{ $altText }} - {{- end }} - {{- end }} - {{ with $caption }}
{{ . | markdownify }}
{{ end }} - {{ if $href }}
{{ end }} -
-{{- end -}} diff --git a/themes/blowfish b/themes/blowfish index b90210b30..63a119744 160000 --- a/themes/blowfish +++ b/themes/blowfish @@ -1 +1 @@ -Subproject commit b90210b30ee9e9ad7b3ee099ef459f928c64a91a +Subproject commit 63a11974499f2255d19802469857908bdb213536