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

Data models in Hugo similar to Jekyll and Mixture #476

Closed
igregson opened this issue Sep 4, 2014 · 9 comments
Closed

Data models in Hugo similar to Jekyll and Mixture #476

igregson opened this issue Sep 4, 2014 · 9 comments

Comments

@igregson
Copy link
Contributor

igregson commented Sep 4, 2014

Greetings,

Can't say enough good things about Hugo. Many thanks for all the work on it.

I've yet only fiddled with Hugo but am currently considering it as my primary static site generator. Before doing so, I'm wondering about one core feature: data models. Essentially, is it possible to store and loop through objects stored in JSON/YAML files within views?

Two existing examples of such a feature can be seen here with Jekyll and here with Mixture.

@igregson
Copy link
Contributor Author

igregson commented Sep 4, 2014

After a bit more research, it looks like the Hugo approach to this type of functionality is "content types." Is this correct?

Rather than storing lots of different objects in one data file, store them as individual files with front-matter for logic for calling/looping in the views? If this is correct, I only have one last question before I fully fall in love with Hugo: Is it possible to use Markdown in Yaml frontmatter?

@spf13
Copy link
Contributor

spf13 commented Sep 4, 2014

Not today, but I was thinking of adding a template function to treat the input as markdown.

@igregson
Copy link
Contributor Author

igregson commented Sep 4, 2014

This would be wonderful. I believe it's possible in Jekyll to use markdown with yaml data by calling it through their markdownify filter... do you have the same type of implementation in mind?

@spf13
Copy link
Contributor

spf13 commented Sep 23, 2014

There's a discussion around this happening on the forum. http://discuss.gohugo.io/t/load-data-from-yaml-xml-json-files/100/5

@spf13
Copy link
Contributor

spf13 commented Sep 23, 2014

@Isaaki can you file your request for markdown in front matter as a separate issue?

@igregson
Copy link
Contributor Author

@spf13 Sure thing... created it here: #524

Didn't know Hugo has a Discourse forum! Sweet. Very glad to see this... should be a huge benefit to the community.

@spf13 spf13 added this to the v0.13 milestone Oct 19, 2014
@anthonyfok
Copy link
Member

See also Pull Request #748, Feature: GetJson and GetJson in short codes or other layout files by @SchumacherFM

bep pushed a commit to bep/hugo that referenced this issue Feb 8, 2015
@bep bep closed this as completed in 773812d Feb 9, 2015
@bep
Copy link
Member

bep commented Feb 9, 2015

tychoish pushed a commit to tychoish/hugo that referenced this issue Aug 13, 2017
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants