diff --git a/exampleSite/content/posts/basic-markdown-syntax/index.en.md b/exampleSite/content/posts/basic-markdown-syntax/index.en.md index af2500745..008f1ad14 100644 --- a/exampleSite/content/posts/basic-markdown-syntax/index.en.md +++ b/exampleSite/content/posts/basic-markdown-syntax/index.en.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "This article shows the basic Markdown syntax and format." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["Markdown", "HTML"] categories: ["Markdown"] diff --git a/exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md b/exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md index 1cb68c63f..02588e5b2 100644 --- a/exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md +++ b/exampleSite/content/posts/basic-markdown-syntax/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "这篇文章展示了基本的 Markdown 语法和格式." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["Markdown", "HTML"] categories: ["Markdown"] diff --git a/exampleSite/content/posts/emoji-support/index.en.md b/exampleSite/content/posts/emoji-support/index.en.md index a3dc72531..9354bb518 100644 --- a/exampleSite/content/posts/emoji-support/index.en.md +++ b/exampleSite/content/posts/emoji-support/index.en.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Guide to emoji usage in Hugo and DoIt." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["emoji"] categories: ["Markdown"] diff --git a/exampleSite/content/posts/emoji-support/index.zh-cn.md b/exampleSite/content/posts/emoji-support/index.zh-cn.md index 0b76ef71b..a0e1767df 100644 --- a/exampleSite/content/posts/emoji-support/index.zh-cn.md +++ b/exampleSite/content/posts/emoji-support/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Hugo 和 DoIt 中的 Emoji 的用法指南." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["emoji"] categories: ["Markdown"] diff --git a/exampleSite/content/posts/pwa-support/index.en.md b/exampleSite/content/posts/pwa-support/index.en.md index ba35bba3c..880d3f8fb 100644 --- a/exampleSite/content/posts/pwa-support/index.en.md +++ b/exampleSite/content/posts/pwa-support/index.en.md @@ -7,9 +7,7 @@ draft: false author: "PCloud" authorLink: "https://github.com/HEIGE-PCloud" description: "Guide to setup PWA in DoIt" -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["PWA"] categories: ["Documentation"] diff --git a/exampleSite/content/posts/pwa-support/index.zh-cn.md b/exampleSite/content/posts/pwa-support/index.zh-cn.md index 0b333e15a..6d240305b 100644 --- a/exampleSite/content/posts/pwa-support/index.zh-cn.md +++ b/exampleSite/content/posts/pwa-support/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "PCloud" authorLink: "https://github.com/HEIGE-PCloud" description: "Guide to setup PWA in DoIt" -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["PWA"] categories: ["Documentation"] diff --git a/exampleSite/content/posts/theme-documentation-basics/index.en.md b/exampleSite/content/posts/theme-documentation-basics/index.en.md index 8d83365fd..e48f8f574 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.en.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.en.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Discover what the Hugo - DoIt theme is all about and the core-concepts behind it." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["installation", "configuration"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md index 1f941cbb3..aec67519d 100644 --- a/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-basics/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "探索 Hugo - DoIt 主题的全部内容和背后的核心概念." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["installation", "configuration"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md index 23972d25a..cb4abbef4 100644 --- a/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md +++ b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.en.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Hugo provides multiple built-in shortcodes for author convenience and to keep your markdown content clean." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["shortcodes"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md index acb1f6b31..f59fcb369 100644 --- a/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-built-in-shortcodes/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Hugo 提供了多个内置的 Shortcodes, 以方便作者保持 Markdown 内容的整洁." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["shortcodes"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-content/index.en.md b/exampleSite/content/posts/theme-documentation-content/index.en.md index 4c284a361..f58fcdca1 100644 --- a/exampleSite/content/posts/theme-documentation-content/index.en.md +++ b/exampleSite/content/posts/theme-documentation-content/index.en.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "Find out how to create and organize your content quickly and intuitively in DoIt theme." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["content", "Markdown"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-content/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-content/index.zh-cn.md index 0f35c9181..7296c573b 100644 --- a/exampleSite/content/posts/theme-documentation-content/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-content/index.zh-cn.md @@ -7,9 +7,7 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "了解如何在 DoIt 主题中快速, 直观地创建和组织内容." -resources: -- name: "featured-image" - src: "featured-image.webp" +featuredImage: "featured-image.webp" tags: ["content", "Markdown"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md index a82831c62..93f7a79df 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.en.md @@ -8,10 +8,8 @@ author: "Dillon" authorLink: "https://dillonzq.com" description: "DoIt theme provides multiple shortcodes on top of built-in ones in Hugo." resources: -- name: "featured-image" - src: "featured-image.webp" -- name: "featured-image-preview" - src: "featured-image-preview.webp" +featuredImage: "featured-image.webp" +featuredImagePreview: "featured-image-preview.webp" tags: ["shortcodes"] categories: ["documentation"] diff --git a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md index 999bfd6da..ce247a657 100644 --- a/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md +++ b/exampleSite/content/posts/theme-documentation-extended-shortcodes/index.zh-cn.md @@ -7,11 +7,8 @@ draft: false author: "Dillon" authorLink: "https://dillonzq.com" description: "DoIt 主题在 Hugo 内置的 shortcode 的基础上提供多个扩展的 shortcode." -resources: -- name: "featured-image" - src: "featured-image.webp" -- name: "featured-image-preview" - src: "featured-image-preview.webp" +featuredImage: "featured-image.webp" +featuredImagePreview: "featured-image-preview.webp" tags: ["shortcodes"] categories: ["documentation"] diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 8f206e8f4..5b50b0856 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -2,14 +2,19 @@
{{- /* Featured image */ -}} - {{- $image := $params.featuredimagepreview | default $params.featuredimage -}} + {{- $image := $params.featuredImagePreview | default $params.featuredImage -}} {{- $height := "auto" -}} {{- $width := "auto" -}} + {{- with .Resources.GetMatch (printf "%s" ($image)) -}} + {{- $image = .RelPermalink -}} + {{- $height = .Height -}} + {{- $width = .Width -}} + {{- end -}} {{- with .Resources.GetMatch "featured-image" -}} {{- $image = .RelPermalink -}} {{- $height = .Height -}} {{- $width = .Width -}} - {{- end -}} + {{- end -}} {{- with .Resources.GetMatch "featured-image-preview" -}} {{- $image = .RelPermalink -}} {{- $height = .Height -}}