-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Blog: Allow use of post.title
in templates
#6491
Comments
Thanks for suggesting. The blog plugin already has 52 settings, and we're not planning on adding settings that are solely in place to control templates. You can achieve this quite easily by theme extension by overriding the |
@squidfunk
Could you please give a hint ? |
Oh right, the title is part of the |
Hi @copdips, wondering what blogging system you are moving from? I had a look around and it does seem like some systems/themes do excerpts, while others do not. I always thought that they are a standard feature of blogging systems. The reason I am interested is because I am working on a template for blogs in Material for MkDocs and am wondering about including some advice on migration paths. |
Big up for the idea to evaluate and document migration paths! |
@alexvoss It uses the As a result, many of my blog posts do not have excerpts, but that's OK for me, as it does not display the entire content in list view. |
Thanks for this. Grabbing the first paragraph should be feasible, I think. A hook attaching itself to the on_page_markdown event would do. Fortunately, the blog plugin attaches itself with a low priority, so that it runs after other plugins/hooks. The main question seems to me to be how to parse the Markdown to find the first text paragraph. In a hook as opposed to a more generic plugin it might be possible to make some assumptions, though, which would make that easier. |
it would be nice to add post title in the post.metadata or post.config. |
Okay, I'll reopen this issue so we can check if we can somehow infer the title from the post. That should be possible somehow, but I'm not yet seeing it. I'll investigate in the future when I find some time. |
post.title
in templates
Okay, so I've investigated how we could add this functionality. The problem is not handing the Thus, I recommend using the |
We're currently not considering moving forward with this, due to how much of a hack the blog plugin already is – MkDocs just doesn't like generated content, and excerpts + views are generated. We already need to jump through a lot of hoops to make this happen. We will re-evaluate this feature request once we start working on the blog plugin again. |
Context
No response
Description
Hello,
Current design is that when a blog excerpt is missing, the entire content is shown in the Blog view, the Category view and the Archive veiw.
This setting might seem to me a little bit too intrusive, as I would not like to see the whole content in list view, so is it possible to add an option to only display the blog titles and metadata when the except is missing ?
Thanks.
Related links
https://squidfunk.github.io/mkdocs-material/setup/setting-up-a-blog/#adding-an-excerpt
Use Cases
when people are migrating from another blog system to mkdoc material, and they don't have such
<!-- more -->
excerpt syntax yet in their orignal blogs. Showing the whole content in the list view is not expected.Visuals
No response
Before submitting
The text was updated successfully, but these errors were encountered: