@matti I want to update Hugo soon, but I want to make sure nothing will break. I'd like to have both old and new versions available so we can slowly move to it. Most likely there will be a way to "opt in" to the new version first.
@matti I'm touching up the plugins to get them all in line with the best practices and parameter paradigm I developed along the way. Afterwards, I'll register them with @manton's new process.
You can install the prism plugin right now the same way that I do. Go to Design -> Edit Custom Themes -> New Plugin
Name it whatever you like and stick the repository address in https://github.com/moonbuck/plugin-prism
. The plugin will be cloned in the exact same manner as through the registered list of plugins.
I believe the README is up to date for the current version. Regardless, it's what I use for all the syntax highlighting so holler if you end up with questions: the blog post README version
@Moondeer Thanks! Sadly, this has the same problem that my attempt of adding prismjs directly to the template had: Double curly braces are not rendered correctly, neither literal ones, nor htmlencoded ones. Hard to believe that mb has no reliable syntax highlighting…
@matti I created a shortcode for syntax highlighting shortcodes. I use it for the opening braces and less than … same thing oughta work for just the braces. I have gotten around a lot of quirks bit new ones are always popping up. So far I've figured out how to highlight anything I've thrown at it … but I don't always remember how I did it. The shortcode post
@matti you also have to be careful when opening up posts to tinker with encodings … they get decoded when you reopen and you have to re-encode them. I use my test blog to see how the highlighting looks … tinker with whatever went wrong and then post to my main.
@Moondeer Yeah. I'm doing and have noticed the same. Posts with go html/template code blocks break the post editor in a way that prevents select all from working correctly.
@matti I run into that all the time when copying/pasting templates. Yet to figure out what separates the ones that break it and the ones that don't.
@matti The Hugo parser is constantly getting in the way. To go around it I've had to do thinks like the shortcode (cause then whatever is inside doesn't get parsed again) and in other cases I literally have to parse and correct the content with regular expressions. Nothing has made appreciate what I had with Swift than d$cking around with Hugo and Javascript
@matti It's funny. Trying to get the Hugo in all the READMEs to render was a b$tch. I just remembered that some double curlies would be cool and others would totally break. Not sure if I figured that one out or decided I didn't need to show the partial. This was before I figured out the shortcode hack. Thst probably would have solved it.
@Moondeer I would be totally fine with using Hugo's highlight shortcode, which seems to be working here locally in a quick test I just did without problems. I couldn't test it on Version 0.54 though since that version is just so old.
@matti They may have fixed the false positive parsing entirely for all we know, what are they up to now, like 0.late-80s? In 0.54 … we can't even merge maps.
@Moondeer I tested it with hugo version 0.54.0 and mb's default theme locally and it totally works.
@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).
@matti @moondeer We could monkey patch the built-in highlight shortcode to play better with Micro.blog. As an interim solution until @manton updates Hugo to a newer version. I have a plug-in working with decent results on the default theme.
Feel free to install and play around with Highlight Monkey. 🙈
@sod @manton @matti I've head great success with mine as well (just gotta jump through some hoops when the code is Hugo code): plugin-prism. It also loads various prism plugins (so you can have a code copy button, for example).
You can see it in action via the walkthrough I've been working on.
You can find a bunch more by entering README into my site's search box.
@Moondeer Yeah, I stumbled upon your plug-in; it's awesome and way more polished than my approach. Mine is mostly a proof of concept. Nevertheless, I thought it worthwhile to experiment with monkey patching the built-in highlight
shortcode for two reasons.
First, it works without JavaScript, and second, Hugo template code "just works." So no jumping through hoops is necessary.
But, with @manton rolling out changes today, my plug-in will probably soon be obsolete.
@sod Very nice. Thanks for the info! Seems like it won't be necessary anymore but nice nonetheless.
@sod I think it's going to be a while until we can upgrade everyone to a new Hugo (some things definitely break in my initial tests), so the plug-in may be useful for some time.
@sod @manton @matti I tend to tinker just to see what can be done (why I never really finished any of the iOS apps). My approach rebuilding the cards plugin is way beyond what I was doing when I started. So now I'm going back through and getting all the plugins inline with plugin-cards … which is mostly about consistency and parameterizing the sh$t out of everything since any Javascript or stylesheets will be templated and built at compile time. I've gotten to a few of them but no READMEs have been updated. Side note: plugin-programmable-search-engine and plugin-toc are pretty sick as well. I created the site search plugin just before rebuilding plugin-cards and I actually created the table of contents plugin when I realized just how ginirmous that walkthrough I linked was getting.
@manton raises hand I think I would be a good test candidate for the new Hugo version: I do not have that much content, since I have only been here a few months. 😉
@manton could we get a page on what versions were on for future plug-ins? What version are we on now?
@mandaris The default right now is 0.54. We're going to jump to 0.91 but it will be opt-in for a while, on the Design page. I expect themes will need updates.
@matti Okay, there's an option for Hugo version now on the Design page. Enjoy! Probably some rough edges still.
@maique I think the home and photos pages need to be updated to show posts. I'll be going through the themes and updating them as I run into problems.
@manton Oops! Spoke too soon! Maybe I checked before the rebuild was done? It's broken, you're right...
@sod It occurs to me I probably oughta look at how you did it … I'm on an island figuring this stuff out through mostly trial and error (I did at least consume some fresh books on Javascript and CSS to refresh my memory (and solidify my love for the Swift programming language … what I would give to be coding this stuff in Swift)).