@Mtt That's really cool and I think all theme should be based on a similar strategy. cc @ericgregorich 😬
@Mtt thank you for creating this! As someone with only basic knowledge of web design, templates etc I’ve always been very reluctant to modify a theme. Microhooks is going to let me customise a bit without fear of breaking the underlying theme.
@Mtt Thank you. I love TinyTheme. My one wish is to have a previous/next post link at the end of each individual post but I have no idea how to accomplish that.
@Mtt Just installed 2.0 and I love that I can make changes that will hold over through updates. That’s the trade off for doing it the other way, so thank you! If we could fit in a microhook for the main page so we could display specific categories, that would be amazing. I can do that by editing the file, but that’ll get overridden. I also need to ferret out a CSS change that put images back to 100%. Usually I want them to float inline.
@Mtt So, I had edited the earlier vision to display long posts (category Macro) and then used a nav link to link to posts. I can definitely do that again.
@gdp Oh, I can work that in. What do you think is better for your use case?
A microhook that enables you to edit only the lines applicable to displaying specific categories.
A microhook that, when used, replaces the full list of posts with custom design.
@Mtt The first option seems more direct to the point, but the second option seems to be more flexible in case others wanted to do something different. I’m not sure I have a preference one way or the other.
@gdp I’m leaning toward the 2nd, more comprehensive, option. The people who are likely to use this particular microhook are those who are deeper down the rabbit hole than the average user.
@gdp I just pushed out an update (2.1) that will add a new microhook microhook-post-list.html
. It will allow you to re-work the blog's main page. This includes the full post list AND pagination.
@pratik I just updated Tiny theme (2.1) to include a new microhook microhook-post-list.html
that allows you to re-work the full post list and pagination. In case someone might prefer something like reverse chronological order of posts on a per day basis. Know anyone who does this? 😁
@Mtt Perfect! I updated, but the index.html page didn't push over so I had to go grab it from GitHub. And Micro.blog was throwing an error on the design page, so I'm sure I missed something somewhere on the template page. I've deleted it and will try again later today.
@Mtt Not yet. That’s my next step later. I was just seeing if I could get it going quickly. No worries. I’ll wrestle with it until I win. 😁
@gdp I just tried it in a couple different places and it seems to work. You can re-install directly from the plugins page (as opposed to updating).
@Mtt That's awesome and yup, this might be the nudge I needed. But not sure if you want me bugging you to get things EXACTLY how I need them to be. Also, may have to clear my schedule if I do this :)
@Mtt I'm all set. Now, what I never realized was that if you create a custom theme from a plug-in theme, those files were overwritten when you updated the plug-in version. I always assumed that took them off the table. This is a great update!
@abc I've got a video walkthrough of it for you (excuse the background noise as someone has an air compressor on outside my office). And here is the code you'll need after watching the video.
@Mtt I just followed your video and inserted the code you supplied and everything is working perfectly. Thank you very much. That was very kind of you. Just one question, what will I need to do if you update the main theme?
@Mtt thank you for creating this! Is there a microhook that makes it possible to not display posts from a specific category on the homepage? i have an automation that brings my letterboxd entries to my blog, filtered as "movies" category. I'm looking for an easy way to not show this posts in my homepage, but only on the category page.
@felipetavares This is probably the most common question I get, but there isn’t a perfect one size fits all solution (yet). However…
The microhook you’ll want to use is microhook-post-list.html
. Activating it will allow you to re-work the home page in any way you like.
I am working on a more detailed tutorial for that, but it isn’t complete yet. @jsonbecker may have more to add as he has attempted to solve that issue for others as well.
@Mtt I'm playing with Tiny Theme since it allowed me to modify how the navigation looks like. I wonder if it's some way to do something to get Tiny Theme to display descriptions below photos? For example if I have this markdown snippet ![](photo url "This is a description")
I would like to get
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxx
This is a description
@jemostrom Micro.blog provides the Markdown → HTML processing, not Tiny Theme. Having said that, you can use Markdown Render Hooks to modify how Micro.blog does that. I also think the glightbox plugin by @jsonbecker may do something similar to that (among many other features).
@Mtt Thanks, it looks like the exact thing I want to do is available in the Hugo documentation
@jemostrom @mtt yes, I use the image render hook in my plugin and can confirm no issues with using this on Micro.blog.
@jsonbecker Yep, I played around a bit and it seem to work just fine. One question, you don't happen to know if it's possible to prevent image tags to be wrapped in p-tags, I would like to use the figure tag (with figcaption etc) but I can't really put those within a p-tag.
@jemostrom it appears this option arrived in goldmark (the engine Hugo used for markdown) just over a year ago. Possibly this is too recent, but maybe you can add the option to your config on latest Hugo available on MB.
@jsonbecker yes, is it possible to do that config ... i.e. can I do Hugo configs on micro.blog. I imagined that I would be impossible to do those configs in micro.blog but I'm happy to be wrong
@jemostrom you are wrong! You can add that to your theme’s config.json and it’ll merge and override anything in the default Hugo configs. Please excuse image— seemed easiest from my phone— but this is an example bit of my own config.json