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

Views and lists of content based on page metadata (e.g. for blogs, galleries, site navigation, etc) #840

Open
agoose77 opened this issue Jan 11, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@agoose77
Copy link
Contributor

agoose77 commented Jan 11, 2024

Proposal

There are many cases where somebody wants to display views of subsets of content and data. For example:

  • Blogs and Content lists: Show a list of content in blog/*, with optional filtering by tag, category, etc.
  • Galleries: Render a collection of analyses with an image for each as a gallery grid.

To first order, a blog could be considered as a dynamic view over appropriately annotated documents. If we add support for additional metadata, such as tags, and the ability to select and render subtrees according to these tags, then we could implement basic blog support. We might also want to be able to specify the authoring date.

The blog theme would benefit from a filter / home view that previews the various subdocuments. We'd be interested in getting this working for 2i2c's blog, and later this might bear fruit for The Turing Way's "Pathway" mechanism.

Inspiration

  • Data views in obsidian are a great example of this in action. If we sorted a directive like this, it wouldn't require any kind of special case metadata. Then over time we could add different kinds of support like showing content or images from pages instead of just the title and metadata
  • Example of where this would be useful for us is in our little gallery of tutorials
  • Sphinx Gallery creates example galleries from content
  • Jupyter Book gallery is built with YAML
@agoose77 agoose77 added the enhancement New feature or request label Jan 11, 2024
@agoose77
Copy link
Contributor Author

agoose77 commented Feb 7, 2024

@agoose77 agoose77 moved this to Waiting 🕛 in Sprint Board Feb 8, 2024
@agoose77 agoose77 self-assigned this Feb 15, 2024
@choldgraf
Copy link
Collaborator

In my mind, blogging is a special case of "show a list of site content that is filtered and/or sorted by page metadata values". So I think there are two nested issues here:

  1. Provide support for "dynamic views of a site's content based on page metadata". e.g., give authors the ability to render content views like "show me all the pages in my MyST site that have valueX for fieldY in the page's metadata. (or valueX > N or whatever). This could be used for many usecases, for example the Turing Way use-case of "give users different lists of pages based on user persona".
  2. Use this functionality to implement blogging functionality. This might special-case some fields (e.g. define a folder that tracks blog posts in myst.yml) and include the extra things that are unique to blogs (like RSS feeds or links to external posts for cross-posting purposes).

I'm separating these out in-part because I think that use-cases like the ones described in the issue below could also be served by this functionality:

Once you created the ability to "give me a list of pages based on their metadata", you could extend that to something like a "notebook sharing gallery" that could show a gallery of MyST content (each backed by a notebook) where the metadata used for filtering was something like "uses dataset X/Y/Z".

@choldgraf choldgraf changed the title Build out support for blogging and other "dynamic" views Support for views and lists of content based on page metadata (e.g. for blogs, galleries, site navigation, etc) Apr 1, 2024
@choldgraf
Copy link
Collaborator

I just realized that this is very similar to the dataviews plugin for obsidian, so I added a link there in the top comment

https://blacksmithgu.github.io/obsidian-dataview/

@choldgraf choldgraf changed the title Support for views and lists of content based on page metadata (e.g. for blogs, galleries, site navigation, etc) Views and lists of content based on page metadata (e.g. for blogs, galleries, site navigation, etc) Aug 8, 2024
@choldgraf
Copy link
Collaborator

A hand-rolled blog for inspiration

I spent some time updating my blog to use the new myst engine. As part of this, I wrote a very basic Python plugin for MyST that parses source files in my blog and displays it as a list + RSS feed. I'll share links below in case it's helpful for any inspiration.

https://github.com/choldgraf/choldgraf.github.io/blob/main/src/blogpost.py

And here are two little posts about it:

https://chrisholdgraf.com/blog/2024/mystmd-with-the-blog
https://chrisholdgraf.com/blog/2024/blog-list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants