Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
1 reply
-
You can use the replace functionality in vs code with regex to replace a one line variable to a 2 variable-2line result. You “just” need to tweak your search 😉
…________________________________
Van: Pedro Lima ***@***.***>
Verzonden: Tuesday, March 22, 2022 9:47:01 PM
Aan: chipzoller/hugo-clarity ***@***.***>
CC: Tim Schaeps ***@***.***>; Comment ***@***.***>
Onderwerp: Re: [chipzoller/hugo-clarity] Use the same variable in front matter for thumbnail and featured image (Discussion #273)
I can do a batch search and replace a variable with VS Code, I've done that to try multiple themes that use different variable names for featured images. The problem is that I only have one variable name available in the front matter of hundreds of markdown files.
If I need to use an extra variable I have to create it manually. It wouldn't be a problem if it was a new blog.
—
Reply to this email directly, view it on GitHub<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchipzoller%2Fhugo-clarity%2Fdiscussions%2F273%23discussioncomment-2417799&data=04%7C01%7C%7C17e9652a6bdf4a76929e08da0c451dca%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637835788235919696%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Ql1X0xmVBwtwR7V9pDvkez7ERAeeLeydN%2FsyatPZQIk%3D&reserved=0>, or unsubscribe<https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FADD52Q7NAIP5VHL4ZYU6ZKLVBIWULANCNFSM5RL7GEBA&data=04%7C01%7C%7C17e9652a6bdf4a76929e08da0c451dca%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637835788235919696%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=wvOXLwm3DasWNiq53kmTymZmqLYkDfuTASEUsbV0rIs%3D&reserved=0>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
rootwork
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
I'm in the process of migrating a WordPress blog to Hugo.
The most popular plugin to convert WordPress posts to markdown generates the following variables in the front matter:
title:
author:
type:
date:
url:
featureImage:
categories:
tags:
How can I use
featureImage
variable to also be used as the source of the thumbnail?I really would like to avoid creating a thumbnail variable in the front matter for hundreds of posts, since I want to use the same image as the featured.
How can I use the same variable for thumbnails and featured images?
For example, in the Mainroad theme, If I set a thumbnail: image.jpg in the front matter, it's used as a thumbnail shown at the homepage and on top of a post/page.
Beta Was this translation helpful? Give feedback.
All reactions