hugo-fresh icon indicating copy to clipboard operation
hugo-fresh copied to clipboard

Question: how to add new layout?

Open maciekChmura opened this issue 4 years ago • 3 comments

First of all, thank you for creating this theme. I love it ❤️

I would like to add a new layout for single page. Small modification. Maybe just remove the title. I followed tips in this thread but nothing seems to work for me.

https://discourse.gohugo.io/t/create-new-layout-for-an-about-page/6223

Could someone please help me figure it out? Maybe someone has a working example?

Thanks.

maciekChmura avatar Sep 01 '20 06:09 maciekChmura

Please checkout this comment https://github.com/StefMa/hugo-fresh/issues/66#issuecomment-520350731

I hope this will help you to override the current layout.

StefMa avatar Sep 02 '20 15:09 StefMa

Thank you for your comment. I am able to override the current layout, but can I have 2 layouts?

I would like to specify which layout to chose in markdown header file. Something like this:

file 1 +++ date = “2017-04-17T11:01:21-04:00” draft = false title = “Pricing” layout = “pricing” +++

file 2 +++ date = “2017-04-17T11:01:21-04:00” draft = false title = “About” layout = “single” +++

Can this be done?

maciekChmura avatar Sep 03 '20 19:09 maciekChmura

I am not sure with that. But I guess you need your own customer code to realize that. It's not simply possibly by creating a new layout and then let's Hugo pick it automatically.

On Thu, Sep 3, 2020, 9:39 PM Maciek Chmura [email protected] wrote:

Thank you for your comment. I am able to override the current layout, but can I have 2 layouts?

I would like to specify which layout to chose in markdown header file. Something like this: file 1 date = “2017-04-17T11:01:21-04:00” draft = false title = “Pricing” layout = “pricing” file 2 date = “2017-04-17T11:01:21-04:00” draft = false title = “About” layout = “single”

Can this be done?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/StefMa/hugo-fresh/issues/118#issuecomment-686715233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOBQ6YBOK5VHYU74O3LWW3SD7WGNANCNFSM4QRLASUQ .

StefMa avatar Sep 04 '20 17:09 StefMa

Closed as answered.

StefMa avatar Jan 19 '23 09:01 StefMa