Reversing the order of post title & metadata in blogs #7762
Replies: 2 comments
-
Possible, but not simple. The metadata is structured data derived from front matter, and rendered in The blog plugin could theoretically always strip the title from the excerpt and make it available to the template in a structured way, but that would mandate another run of post processing the rendered HTML, as MkDocs already provides It would also mean even more hacking than the plugin already absolutely needs to do to add reasonable blogging functionality to a framework that is intended for a 1:1 correspondence of pages (= documentation) and does not provide canonical primitives for working with dynamic, generated content. All of this is not a limitation of Material for MkDocs, but MkDocs, i.e., the way page titles are handled when providing them to the template and plugins. I've analyzed this in #7310 (comment). How this could be achieved is by writing a hook that removes the cc @alexvoss – we should keep this in mind when working on page title deduction. |
Beta Was this translation helpful? Give feedback.
-
This was discussed in a previous Issue: I didn't respond previously, because I couldn't find it initially and assumed it's a false memory, that it was in an Issue, and the information is somewhere else, found it in the end. 😅 So to confirm, this functionality requires extending how the blog plugin operates and "hacks" the data provided by Markdown / MkDocs. Currently Material isn't planning on hacking MkDocs any further, but while working on mkdocs-nype I've developed a custom cards view which is visible here on the Fiori Tracker page. The title extraction uses a filter to process the
Additional reference: |
Beta Was this translation helpful? Give feedback.
-
Hi everyone!
Wondering if anyone could help me out with a quick override question as I haven't had success configuring it manually.
I'm using the blogs plugin and so far so good.
The only thing I don't like about the out of the box config is the ordering within the index page.
In the screenshot, I'd like to reverse the order of 1 & 2 (ie, have the title come first, then the post metadata, then my excerpt):
Anyone have success setting this up and, if so, please share a snippet!
TIA!
Beta Was this translation helpful? Give feedback.
All reactions