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

How can one implement dynamic pages. [feature request][discussion] #49

Open
karan-ta opened this issue Feb 22, 2017 · 4 comments
Open

Comments

@karan-ta
Copy link

In the demo example - what do we do if we need to implement an event detail page.
for each event - if we need an event detail page - do we create each page in index.yaml ?

for 1000's of events - this could be a pain area.

example for event data - we have some more fields that need to be shown on event detail page.

  • date:
    • 2009-04-20
    • 2009-04-22
      speaker:karan
      id:10
      title: Seminar on web security
      videos:
      list of attendees:

and the event detail pages will be as :

events.html/9
events.html/10
events.html/11
events.html/12

and so on.

I am not stuck on this right away, but soon this could come up to work on for my site.
so discussing ways to implement dynamic pages would be great.

maybe we add queryparam to fetch the params from the data.
and then for each param the page is generated.

@jgm
Copy link
Owner

jgm commented Feb 22, 2017 via email

@karan-ta
Copy link
Author

Thank you john for fast and clear reply.
i wonder if i will be able to understand hakyll as easily as i got into yst.
i came to yst from the hakyll docs and saw the raw simplicity of yst which is appealing.
i have made good progress with my site with yst yesterday and today.
so for now i shall stick with yst.

I shall see if i can add this feature when i urgently need it.

i came across one more similar case of this type of feature need.

suppose i have a list of topics.
and each topic has a list of links.
and i want a display such as :
topic 1
link1 of topic 1
link2 of topic 2
link 3 of topic 3

topic 2
link1 of topic 2
link2 of topic 2
link 3 of topic 2

then my yaml starts becoming kinda long as follows
suppose the topics are philosophy, business, haskell, conrod,rust.

data :
topics : FROM topics.yaml ORDER BY position
philosophylinks : FROM philosophy.yaml ORDER BY step LIMIT 5
businesslinks : FROM business.yaml ORDER BY step LIMIT 5
haskelllinks : FROM haskell.yaml ORDER BY step LIMIT 5
metalearninglinks : FROM metalearning.yaml ORDER BY step LIMIT 5
conrodlinks : FROM conrod.yaml ORDER BY step LIMIT 5
rustlinks : FROM rust.yaml ORDER BY step LIMIT 5

and so on....

so a generator template / macro could be the answer for this too.

so i shall study hakyll and other solutions to try and implement this when my data starts getting bigger.

so maybe this issue can remain open for now for future refrence :)
or if you like - i can close it from here - as you wish.

@jgm
Copy link
Owner

jgm commented Feb 22, 2017 via email

@karan-ta
Copy link
Author

+1
yes exactly.
This could also be useful for pagination use case.

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

No branches or pull requests

2 participants