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

Option to add content to generated blog category pages #4363

Closed
4 tasks done
StarfallProjects opened this issue Sep 14, 2022 · 4 comments
Closed
4 tasks done

Option to add content to generated blog category pages #4363

StarfallProjects opened this issue Sep 14, 2022 · 4 comments
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open

Comments

@StarfallProjects
Copy link
Sponsor Contributor

Contribution guidelines

I want to suggest an idea and checked that ...

  • ... to my best knowledge, my idea wouldn't break something for other users
  • ... the documentation does not mention anything about my idea
  • ... there are no open or closed issues that are related to my idea

Description

Each category page for the blog is auto-generated. It would be great to be able to add custom content (such as an intro paragraph)

I imagine two possible approaches:

  • Manual category index pages, with custom content up top, and then the list of posts below
  • Some sort of config file (like the .meta.yml) containing content for category pages

The first is probably more intuitive for users?

Use Cases

The category pages act as hub pages for topics, which as I understand it can be good for SEO.

Screenshots / Mockups

No response

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Sep 14, 2022
@squidfunk
Copy link
Owner

As discussed in #4344 (reply in thread), probably the best and most flexible way is to allow the user to manually create the category pages with custom content. Same goes for archive pages, albeit the use case might not pop up as often:

.
├─ docs/
│  └─ blog/
│     ├─ category/
│     │  ├─ foo.md
│     │  └─ bar.md
│     ├─ posts/
│     └─ index.md
└─ mkdocs.yml

@squidfunk
Copy link
Owner

Added in squidfunk/mkdocs-material-insiders@08ab20cce3a499352ad8fafab9ee57925e4997ec and released as part of 8.5.3+insiders-4.24.0. The documentation includes a new section how to add custom content to generated index pages.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label Sep 27, 2022
@squidfunk
Copy link
Owner

Additionally, there's a new setting called post_excerpt_max_categories, which implements the functionality of your other feature request, allowing to limit the number of categories for post excerpts. authors_in_excerpt has been renamed to post_excerpt_max_authors. Correct me if I'm wrong, but I think that all of the things you mentioned in your feedback should now be possible. Oh, and thanks again for the detailed feedback! Happy to iterate.

@StarfallProjects
Copy link
Sponsor Contributor Author

Wow that was very speedy! Will try this out in the coming days! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants