DailyDogo 71 🐶
PuppyCast 009 🐶🎙
Happy about the progress. It’s very cold. Napu looses her teeth!
.@help How do you restore one of those special pages if you have deleted it? I’m talking about the archive page on my test blog in this case.
Adventures with Hugo: Configure Hugo's Native Syntax Highlighting On Micro.Blog
If you are one of the brave people that uses Hugo Version 0.91 and wants to take advantage of Hugo’s native syntax highlighting capabilities on a light theme (like the default theme in this example), you might be surprised:
As you can see… you can’t really see much.
Thankfully this can be changed, by changing the configuration for syntax highlighting. But in order to do that you have to know the following:
[@matti](https://micro.blog/matti) interesting … so much is still a blackbox for me. I just tinker until I get results. My two favorite finds are the config directory (which take precedent ahead of the json files) and the assets directory (with which you can build Javascript and Sass files from templates).
You have to know about the precedence because for some reason, changing the config.json in your theme won’t do the trick. This is how it works:
Get A Functioning Custom “New-Plugin-Style”-Default-Theme For Your Blog
EDIT 18.02.2022: The following is not up to date anymore. Plugin-Themes now behave much more convenient: Just install the theme, activate for your blog, create a custom theme and only add config/_default/markup.json
template.
First of all make sure you are on the Hugo version 0.91 (dropdown in the Design screen, remember to save) and install the default theme as a plugin (Plug-ins screen). Then go to Design again and click on “Edit Custom Themes”, on the next screen click on the default theme and duplicate it with the button in the next screen. You should now be back in the custom themes overview list. Click Design in the sidebar once more and choose your custom theme, save. Click “Edit Custom Themes” again and then on your copy of the Default theme.[^1]
Change Configuration
You should now be inside your custom theme screen. Click on “New Template”. You will be presented wie the template editor and theme preview split view.
Name the template config/_default/markup.json
and set its contents to:
{
"highlight": {
"anchorLineNos": false,
"codeFences": true,
"guessSyntax": false,
"hl_Lines": "",
"lineAnchors": "",
"lineNoStart": 1,
"lineNos": true,
"lineNumbersInTable": true,
"noClasses": true,
"style": "monokailight",
"tabWidth": 4
}
}
This is basically the default config from the Hugo documentation, except that for style we use monokailight
instead of monokay
. Click “Update Template”, your site should be rebuilding as indicated by the spinner. When Hugo is done, syntax highlighting should now be working as intended and the code be legible.
Example:
{{ define "main" }}
<div class="home h-feed">
<ul class="post-list">
{{ $paginator := .Paginate (where (where .Site.RegularPages.ByDate.Reverse "Type" "post") "Params.title" "!=" nil ) (index .Site.Params "archive-paginate" | default 25) }}
{{ range $paginator.Pages }}
<li class="h-entry">
<h1><a href="{{ .Permalink }}">{{ .Title }}</a></h1>
<a href="{{ .Permalink }}" class="u-url"><span class="post-meta"><time class="dt-published" datetime="{{ .Date.Format "2006-01-02 15:04:05 -0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time></span></a>
<div class="e-content">
{{ .Content }}
</div>
</li>
{{ end }}
</ul>
<p class="rss-subscribe">subscribe <a href="{{ "feed.xml" | absURL }}">via RSS</a></p>
</div>
{{ end }}
[^1]: I’m not sure if this is all necessary or even the right way to go about it. It seems pretty involved and I don’t even know how you would migrate your customizations in an easy way if you happen to have used the old style of choosing a theme… but this way works, that much I could prove.
DailyDogo 70 🐶
Found a way to run the old hugo version 0.54.0 locally (thanks to this asdf version manager plugin) to see if the highlight shortcode works in principle with this version AND IT TOTALLY DOES! In other words: That syntax highlighting is broken is a problem of micro.blog, not Hugo.
DailyDogo 69 🐶
DailyDogo 68 🐶
DailyDogo 67
It's Impossible To Take Your Time With Everything
There is this weird dream logic inside me that wants to do everything I want to do in a progressively better way until it reaches an optimum which then also can be sustained.1 I imagine that, no matter what it is, if I would just start to try to achieve anything and keep iterating on it, that any improvements needed to reach a sustainable optimum would be in reach. Reached optima somehow would become free of effort. They would just happen. In this way I could at least potentially do an infinite amount of things.
Of course, this is not how it works. Everything has a cost and in reality life is quite limited. There is even a cost associated to making something cost less to do. Effortlessness does only exist in a certain, unrealistic, frame.
-
This implies that most if not all things I want to do are ongoing goals, not projects, which is true. Projects are only a step or part of an overarching ongoing goal to me. ↩︎
DailyDogo 66 🐶
I Really Like Console Games
Have to say that I really enjoy the xbox experience a lot. The whole idea of a gaming console on which the games that are produced for it just work is amazing.
The game pass is great for players like me, too. If my xbox one doesn’t cut it anymore I would not hesitate to get me an xbox series s.
The whole experience of playing games on consoles is very frictionless. Something that a time constrained man like me appreciates a lot.
DailyDogo 65 🐶
.@help I can’t seem to find this post to add a picture. That the pic is missing, could that be related to that upload problem with the mac app I mentioned? Or is it just that replies can’t have pics/can’t be edited (why?)? Didn’t I make it a post by starting it with a dot?
.@manton Also: Why are theme errors not shown in the log? But here?
.@manton The design/template UI workflow is really not that good. Instead of using a two column layout which includes the editor and the preview it would be enormously better if it would be a three column layout so I wouldn’t need to click back and choose a different file all the time, click forward to edit and preview it. Especially because often times different files interact with each other. The way it is now, is just not ergonomic at all.
2021 - Year Of Strain
A difficult year. In better moments it was a so-so year. In other moments in which I take the bigger lines and shapes of my life into account it has been a bad year.
There is a dog now in the family and that makes me happy. We had a great summer vacation in northern Finnland. But this year was not without strain to keep moving in a positive direction or at least not lose ground. Like making it through fast flowing rapids. There was lots of stress: self-made and unavoidable at once. I broke my arm in the end of 2020 and needed to heal the first few months of 2021. Things at the job were hard and at times disappointing. Looking back, this year showed me the strength of my now six year long relationship; That we managed to get through this year together, trying to understand each other even more, giving each other space, when we knew there were lots of things going on. I am proud of us being able to talk, to forgive and to move on. Around midnight, when the neighbors were lighting fireworks, we acknowledged the year for what it was, especially for us two (the dogo was sleeping through the explosions…). Me being the more optimistic person even went as far as being hopeful for the new year. It carries the opportunity of a fresh start. We smiled and kissed.
The pandemic didn’t help. Being here in Finnland’s north meant that we both experienced increasing cabin fever: a new topic was discovered. Do we need to move? How do we manage giving space and time to each other in a loving, non-condescending way? One fascinating aspect of being in a long-term relationship is how the relationship and with it oneself and the other changes over time. I wonder what captures this dynamic better: The continued reveal of yet another onion skin or a more evolutionary abstract image of ever-changing symbiotic organisms. It is the question between an essentialist and non-essentialist viewpoint. Whatever it is: Not knowing (or rather: deciding) makes this dynamic no less interesting to me.
This year was hard and in many ways one I’d like to forget. But I won’t reduce the year to that. There were beautiful, funny, heartwarming, delightful moments. And these I won’t forget.
I am grateful for the past year’s me trying to keep the ship afloat even when I wasn’t feeling like it.
I am grateful that I continued to be interested in cooking dinner for us. I feel like I have improved a little.
I am grateful for the dog coming into our lives, our little chaos agent, that brought us so much happiness in a year of strain.
I am grateful for my relationship and my partner being there and giving me the reality check that I sometimes needed. Or the back rub. Or the space and time. Or the normality of everyday life. I love you for your honesty, humor, your smile and you holding me accountable. You, like no other can make me reconsider a strongly held belief. You, like no other can make me belief I could be a decent man if I tried. Thank you for being here with me, E.
DailyDogo 64 🐶
PuppyCast 008 🐶🎙
A new year. Puppy School. Being more vocal/communicating more.
.@help Somehow while playing with my testblog I ended up with a weird situation: Note that 1.) The content of the titles page is test and 2.) The content is red and an h1 even though the layout for that page has been deleted.
DailyDogo 63 🐶
DailyDogo 62 🐶