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

page_gen: #34

Closed
sgraham3 opened this issue Jul 28, 2022 · 5 comments
Closed

page_gen: #34

sgraham3 opened this issue Jul 28, 2022 · 5 comments

Comments

@sgraham3
Copy link

I have tested both metadata_one and metadata_two and they both build on there own. When I uncomment and add the data names as the readme states, it builds with no errors and the site is empty. I have tried multiple combinations of commenting and adding with no luck.
Does the metadata: need to be commented out?

[optional: only used if you need to tweak CB defaults or generate from more than one data file]:

page_gen:

  • data: 'metadata_one'
  • data: 'metadata_two'
@evanwill
Copy link
Contributor

@sgraham3 can you share your repository to me?
I am not exactly sure what you are trying to do, but here is some info that I think is the issue.
The metadata and page_gen values do two separate things:

  • The metadata value is used by the template to select which CSV to use for creating all the features, such as list of items on Browse, Timeline, Map, etc. You need a valid metadata value even if you are customizing the page_gen. If you don't have a metadata value (which sounds like your issue) then all the template pages will be blank, because there is no data configured for them to pull in. The metadata value is essentially the main set of items for your collection. It is used throughout the template as site.data[site.metadata] to pull in the item info.
  • The page_gen values can be used to customize the page generation options or to generate pages from multiple CSVs. By default (if page_gen is commented out) the cb_page_gen plugin assumes you want to generate pages from the CSV set in the metadata value. If you add values (like your example), the plugin generates pages from those CSVs instead. But the page_gen value does not set the metadata value for the rest of the site--it only generates pages.

So I think in your case, you have metadata commented out, all the default pages will be empty, but there still will be pages built for your two CSVs--thus no errors.

Basically you can't use page_gen to concatenate multiple CSVs into one collection (by default)--generally you will want to combine those CSVs before putting into the collection. We set up page_gen config to allow you to generate other types of custom pages, which will require some customization to use.
For example of how it can be used, HJCCC collection uses it--the main collection CSV set in metadata populates the Browse page etc (and generates each individual item page), a second CSV generates pages for each Glossary entry (e.g. a glossary term page).

@sgraham3
Copy link
Author

Thanks for fast and detailed response. I defiantly misunderstood what the page_gen was doing. I was trying to pull both csv files into one collection. Seemed like a good idea(easier to manage) to have separate csv for different types-formats.

@evanwill
Copy link
Contributor

@sgraham3 yeah--I am thinking about that option now too and seeing if there is a way to cleanly build it into the template with out making anything too complicated! It would also be nice to for your type of use case to just set multiple in the metadata value (if you don't need to customize page_gen). The problem being we try to keep CB-GH options interchangeable with CB-CSV, and it would be hard to build into GH.

For now I tried to clarify a bit in the doc page the current limitations.

@sgraham3
Copy link
Author

sgraham3 commented Jul 28, 2022

@evanwill I think it would be a good idea but see how it may be overly complicated or not needed for most users needs. I am using cb it a little differently.

  • I maintain cemeteries in gis mapping and export to the csv as updated.
  • I also have other objects that are separate from the gis (photos, etc )

The updated docs defiantly clarify and explain much better, Thanks

@evanwill
Copy link
Contributor

closing this, and opening a feature issue #35 to think about!
Thanks @sgraham3

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