Labeling block quotes

Yes, it’s the render template. I don’t think you need to do anything with it, and it may work with arbitrary alert text, I’m not totally sure.

Yeah, it’s also possible that you can just achieve a speech balloon (if that’s what you want more generally) by simply using CSS on a blockquote. There’s no need for any alert stuff to just style a blockquote and have something like an emoji appear. You can just use

blockquote::before {
  content: "💬"
}
1 Like

Yep–if all my blockquotes are the same style. I could just strip out the label before publishing, which is what I’m doing now anyway.

The Hugo documentation mentioned editing the i18n file, so I may need to insert that code. It needs to go in a template somewhere.

I’ve been working on adding this render hook to a theme that I’m working on.

If you are feeling brave, you can look at the following links that I’m pulling from.

I’m planning on mixing this up with a way to inline svg as described in this post.

@mandaris Very cool—thanks for those links. I’ll give them a read a bit later.

kt

Update: I learned that the Commander plugin supports simple macros, and I created one to do the following:

  • Run a series of regex replacements via the Regex Rulesets plugin
    • Remove level 1 header (I use the post/page title instead)
    • Remove %% comments
    • Remove labels on blockquotes/callouts (I haven’t tweaked my blog styling to take advantage of support in Hugo yet).
  • pause one second
  • Publish post via micro.publish
  • pause one second
  • Undo edits (one undo restores everything removed in the first step)

I discovered that the undo step worked fine when I ran the process manually, but it didn’t work properly in the macro. I added the pauses, and that fixed the problem—likely the publish and undo steps were colliding. I did notice that the undo step executes while I’m still in the micro.publish dialogue, but the post still publishes correctly. The plugin must dump the text into a buffer which isn’t affected by the undo command.

Since I need to remove the post title and comments anyway, I’ll continue to use this even after I get callouts to work. It’s a quick way to prep a post for publishing while still allowing me to use comments and annotations that I don’t want to show up in the blog. This capability is built into Longform (sort of), which gave me the idea to try building it myself.