Open muffinresearch opened 4 years ago
This might also be achievable with https://github.com/mozilla/markdown-it-heading-wrapper/ (assuming it's specific to an H1)
Doing this would probably mean we'd want to be able to use frontmatter as a mechanism for opting-out of this wrapping as well as passing data to the markup.
Looking into this further, there's almost no differences between the two hero templates:
The main differences are class names, whether or not a image is able to be used, and whether a topic is passed through to the page. Topic is not used that much, and in fact as a result of the migration it's not showing anywhere. This should be removed.
Here's a few concrete steps we can take:
Update: See latest comments on this, this can potentially be even simpler than described here.
In order to wrap the hero image block, instead of this:
An special markdown container "fence" could be used like so:
This will wrap the hero area in a block with that image used as a background.
The output would be the same as before (in other works refactoring the markup is not considered in scope):
Using
markdown-it-container
this could be added with something like:The aim here is to make it easier to add content without having to cross reference a bunch of templates.