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

tag and category support? #1411

Closed
laoshaw opened this issue Feb 21, 2018 · 4 comments
Closed

tag and category support? #1411

laoshaw opened this issue Feb 21, 2018 · 4 comments

Comments

@laoshaw
Copy link
Contributor

laoshaw commented Feb 21, 2018

can mkdocs somehow honor yaml/json-based header at the top of markdown files that contains tags/categories keyword and generate tags and categories out of it, similar to what jekyll and hexo are doing?

@waylan
Copy link
Member

waylan commented Feb 21, 2018

This could be handled via a Plugin. We already support meta-data (or frontmatter as Jekyll calls it). A plugin could easily access page.meta for each page and generate some sort of page listing all tags and/or categories. Everything else would be theme dependent (which is also customization).

If, in the course of developing such a plugin, you encounter a deficiency in the plugin API, please file a report and we'll try to accommodate you, but I don;t see any need for this to be in MkDocs proper.

@waylan waylan added this to the Post 1.0 milestone Feb 21, 2018
@laoshaw
Copy link
Contributor Author

laoshaw commented Feb 21, 2018

I saw a meta plugin here: https://squidfunk.github.io/mkdocs-material/extensions/metadata/

is this the one you were referring to?

if not, I just read http://www.mkdocs.org/user-guide/custom-themes/#pagemeta but do not know how to do a theme, so how does the page-meta work in real? can I add some "front-matter header" in the post and it will be picked up by mkdocs without any extension/plugins now?

@waylan
Copy link
Member

waylan commented Feb 21, 2018

MkDocs meta-data is currently documented here. While that documentation will be pushed to the site with the next release. the functionality is already available in the current release.

Also the meta-data is available as page.meta to plugins in any of the "page" events beginning with on_page_markdown.

@Stanzilla
Copy link

Stanzilla commented Nov 29, 2019

I recently implemented a super weird version of "tags" using markdown-yaml-metadata-parser full_yaml_metadata and a javascript script that generates a sort of sitemap out of that metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants