Skip to content

Is it Possible to Specify Featured Image in Markdown Files and Use a Centralized Image Location? #1672

Closed Answered by f-hollow
Armoghan-ul-Mohmin asked this question in Q&A
Discussion options

You must be logged in to vote

I am implementing exactly this in my PR.

First fo all, the file themes/blowfish/layouts/partials/hero/basic.html contains the following code (the comments are mine):

# This looks for an image with the substring `feature` in its name in your article's folder.
# If no luck, it tries the substrings `cover` and `thumbnail`.
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
# If still no luck, it checks if the front matter parameter `featureimage` is declared.
# It defines a URL of an image and is documented in `https://blowfish.page/docs/front-matter/`.
# Us…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Armoghan-ul-Mohmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants