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

support an array for collections frontmatter key #1333

Open
thescientist13 opened this issue Dec 1, 2024 · 3 comments
Open

support an array for collections frontmatter key #1333

thescientist13 opened this issue Dec 1, 2024 · 3 comments
Assignees
Labels
CLI Content as Data documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.32.0
Milestone

Comments

@thescientist13
Copy link
Member

thescientist13 commented Dec 1, 2024

Type of Change

Enhancement

Summary

Currently, Greenwood supports defining content collections through a frontmatter key

---
collection: navigation
order: 2
---

# About Page

Lorum Ipsum

However, it was observed / requested that content could belong in more than one collection, so allowing it be an array would be really nice.

---
collection:
  - navigation
  - other
order: 2
---

# About Page

Lorum Ipsum

Details

Aside from implementing this, would also want to update the documentation to demonstrate this capability / option.

@thescientist13 thescientist13 added enhancement Improve something existing (e.g. no docs, new APIs, etc) documentation Greenwood specific docs CLI Content as Data labels Dec 1, 2024
@thescientist13 thescientist13 added this to the 1.0 milestone Dec 1, 2024
@thescientist13 thescientist13 changed the title support and array for for collections frontmatter support an array for for collections frontmatter key Dec 1, 2024
@thescientist13 thescientist13 changed the title support an array for for collections frontmatter key support an array for collections frontmatter key Dec 6, 2024
@lschierer
Copy link
Contributor

This would fill a significant hole in mirroring the PageSpec functionality of ikiwiki. I have a very old install of that I used heavily from about 2005 to 2018 that I recently needed to adjust something on, and last night I briefly looked at what it would take to move it to a platform more consistent with everything else that I'm now doing.

@thescientist13
Copy link
Member Author

Great, thanks for sharing your case that is definitely helpful.

Let me queue this up for the next release line (0.32.0), and can probably get it out in an alpha at least in the next couple of weeks.

@thescientist13 thescientist13 self-assigned this Jan 31, 2025
@lschierer
Copy link
Contributor

to elaborate slightly, since I had configured ikiwiki to use git for dates anyway, by running some slightly scary find | sed commands across the repository, I can change a bunch of ikiwiki meta tags to frontmatter fields with reasonable levels of manual intervention despite just about 3k files. From there I can use the info in git's metadata, the compilation, and content-by-route to replace nearly everything except the matching on tags. While I could probably reimplement that with custom front matter, the collections (with getContentByCollection already existng) are filling very nearly the same role as the way ikiwiki used tags.

there's lots of things that ikiwiki plugins could do that would still require custom development work, but I wasn't using many plugins that do much except enforce good behavior (on either my part as the author or on the tool's part in the form of output). So this isn't a generic conversion solution, but I think that's one of the things I like about both Greenwood and Ikiwiki - there's lots of room for personal use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Content as Data documentation Greenwood specific docs enhancement Improve something existing (e.g. no docs, new APIs, etc) v0.32.0
Projects
Status: 🔖 Ready
Development

No branches or pull requests

2 participants