-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Ability to create pages dynamically? #140
Comments
I think I understand the feature, but not the use case. What do you use it for? Best, -- On November 25, 2013 at 6:35:47 AM, gkostyanikov ([email protected]) wrote: Using this feature provided by Middleman http://middlemanapp.com/dynamic-pages/ quite often. So maybe somebody will point me to the machinery of doing similar stuff in Hugo or consider adding this feature in future releases? — |
I'm using it for generating tens of thousands pages when most of the data comes from db. |
I also need to fill static pages with data from a db (large tables mostly) so I began to hack on that part on my fork here. My main problem with the approach I chose is that the data formats and queries are hardcoded in hugolib/db.go. So to use this an enduser would have to maintain a fork of hugo. Simple query strings could go into the frontmatter but what bugs me more is that I don't know how to construct the types for the returned rows to scan into at runtime. I'm not sure it's possible at all because of go's static typing but maybe there is some kind of dark reflection magic i'm not aware of, yet? Another option would be to boil every column down to a string but than you would loose a lot of options (like using .Format on time.Time objects).. |
See how we parse config and front matter data from json, toml & yaml. It should provide a good example of reflection. |
+1. This would be an amazing feature. |
Here is an implementation of one solution on a per page basis: http://cyrillschumacher.com/2014/12/21/dynamic-pages-with-gohugo.io/ I need some more tipps from the hugo core team to create hugo idiomatic code. |
I really like this idea of an approach. |
+1 Very, very nice. Esp. the remote feature. One concern to think about here is maybe add some kind of cache ... I would hate for my livereload to have to wait for hundreds of remote resources to finish. |
Update: @SchumacherFM has submitted a wonderful Pull Request #748: "Feature: GetJson and GetJson in short codes or other layout files" as a solution to this issue. |
We now have both Data Files and Data driven content -- this is as dynamic as one would get for a static site. |
Hi guys,
I would like to get 3 pages with details of given book (generated using same layout). Is that possible? |
@lukasz-kaniowski not with Hugo alone ... |
@bep any recommendations? I'm creating this json file using node scrapper so I can change the sctructure, i.e. devide it into single json file per book. will this help? |
@lukasz-kaniowski no, you would need to create a script outside Hugo to generate the content pages. |
@bep bummer. thanks for your help. |
Here is your solution: http://cyrillschumacher.com/2015/02/09/virtual-pages-with-gohugo.io/ I never made a PR with this feature. It needs more love => Refactoring and hooking into other internal hugo stuff ... Edit: Source => SchumacherFM@0f32b37 |
@SchumacherFM nice one. i will have a go with it. |
Good luck. |
Why is this issue closed ? Is it because there is no hope to see pages generated for each record in a data set ? Or is it because this was implemented in some way since 2015 ? If this was not done already I want to advocate for this feature. |
@bep @spf13 There is no way to generate dynamic page currently in Hugo out of the box and it will not be implemented? Details: It will be very useful for me if you clarify that. THANKS |
So this thing has been bugging me for a while now (especially as I wanted to make it easier for contributors on my website to add content without manually creating folders & files). It's a JS wrapper that generates pages from data (and it cleans after itself!). Cheers |
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. |
Using this feature provided by Middleman http://middlemanapp.com/dynamic-pages/ quite often. So maybe somebody will point me to the machinery of doing similar stuff in Hugo or consider adding this feature in future releases?
Edit: New link at https://middlemanapp.com/basics/dynamic-pages/
The text was updated successfully, but these errors were encountered: