Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Homepage front matter #109

Merged

Conversation

jamesericdavidson
Copy link
Contributor

Use the native content/_index.md file and {{ .Content }} variable to display front matter.

An example of the feature has been added to exampleSite/content/_index.md in 73476bf - discard this commit if you don't want to use it.

  • Set the enableFrontMatter parameter in config.toml to "true" to enable the feature

    • If the parameter isn't present, or has a value other than "true", the <section> will not be created
  • Documentation for the enableFrontMatter parameter is available in exampleSite/content/posts/theme-documentation-basics/

Hope this is useful. Appreciate any feedback or improvements, as I'm inexperienced with Hugo, and by no means a design buff. I delegate the HTML and CSS prettiness to you, which is why I use this theme to begin with 😉

For reference, the upstream Hugo documentation is available here: https://gohugobrasil.netlify.app/templates/homepage/#add-content-and-front-matter-to-the-homepage

A new parameter enableFrontMatter can be set to true to display the
contents of content/_index.md

The home-content section inherits the CSS properties of home-about

See the documentation:
https://gohugobrasil.netlify.app/templates/homepage/#add-content-and-front-matter-to-the-homepage
@netlify
Copy link

netlify bot commented Aug 2, 2022

Deploy Preview for gokarna-hugo ready!

Name Link
🔨 Latest commit 41ed62d
🔍 Latest deploy log https://app.netlify.com/sites/gokarna-hugo/deploys/62ee7a36a38c41000885b045
😎 Deploy Preview https://deploy-preview-109--gokarna-hugo.netlify.app/posts/theme-documentation-basics
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@yashmehrotra
Copy link
Collaborator

@jamesericdavidson Hi, sorry I was making some changes in the PR and deleted the config.toml by mistake. Can you re-add it. Also, have suggested some changes in the comments. Please have a look.

@jamesericdavidson
Copy link
Contributor Author

jamesericdavidson commented Aug 4, 2022 via email

@jamesericdavidson
Copy link
Contributor Author

Apologies for the delay - internet foibles 😃

@yashmehrotra
Copy link
Collaborator

Thanks for the PR @jamesericdavidson
LGTM, merging

@yashmehrotra yashmehrotra merged commit 84e00a5 into gokarna-theme:main Aug 9, 2022
@jamesericdavidson jamesericdavidson deleted the homepage-front-matter branch August 9, 2022 10:54
@jamesericdavidson
Copy link
Contributor Author

Thanks for merging 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants