Some big changes for this site: teams and plug-ins

On 06 May 2020 Manton announced Micro.blog for teams: multi-user blogs, so your whole team can write posts on a shared blog.

And now, Custom.micro.blog, has been upgraded. So, here's an open invite to anyone who feels they can contribute, to contact me at miraz@firstbite.co.nz .

Also, on 07 July 2020 Manton announced plug-ins for Micro.blog:

a plug-ins system for Micro.blog that formalizes a lot of the power of Micro.blog themes, but wrapped in a package that is easier to develop and install. Instead of creating a custom theme for your blog and editing the templates yourself, you might be able to find a plug-in that will add the feature. Unlike custom themes, there can also be multiple plug-ins installed for a single blog.

Since plug-ins are directly relevant to customising a blog I'm hoping to make this site a resource centre for plug-ins and plug-in developers.

I'm also always looking for more folks to contribute tutorials, how-tos or just links to helpful resources.

Let's pool our knowledge and make a fabulous resource for anyone wanting to tinker with their Micro.Blog.

I also need to thank Manton for his generosity in making this site free! 😀

Link: Custom 404 page

Some themes include a custom “404 not found” page when a visitor to your blog tries to request a page that is no longer on the web, or if they mistype a URL. You can override this page in 2 different ways:

  • The easiest way is to create a new Micro.blog page under Posts → Pages. For the title, type “404” and save the page. Micro.blog will notice that special title and automatically set up the page filename to be /404.html. You can later edit the title or text content to anything you want.
  • If you need more control, use a custom Micro.blog theme to add a new template in layouts/404.html. This can use any Hugo includes to show headers, footers, or handle other logic.

When neither of these pages are found, Micro.blog will return a basic “Not Found” page.

Source: Custom 404 page - Micro.blog Help.

Link: Help page for Teams includes theme tips

I’ve added a help page for teams in Micro.blog. Includes details on the Hugo parameters for adding author names to custom themes.

Source: Manton Reece.

Extract from the help page for teams:

The Marfa design has a place in the footer of each post that shows the author of that post. Other custom themes may need modifications if you want to include author information.

The Marfa design has a place in the footer of each post that shows the author of that post. Other custom themes may need modifications if you want to include author information. …

If the blog is not a team blog, these parameters will be blank. You can check whether the author is available, and then fall back on the blog’s default author …

List posts chronological within a day

From Jason Becker json on Slack (07 April 2020):

… here’s a template snippet from my layouts/index.html that will allow your posts to be listed in reverse chronological order by day, but within a day be in chronological order. Which I quite like.

{{ $posts := where site.RegularPages “Type” “post” }}
{{ $grouped := $posts.GroupByDate “2006-01-02” }}
{{ $paginated := (.Paginate ($grouped)) }}
​
{{ range $paginated.PageGroups }}
{{ $thedate := (time .Key) }}
<h1> {{ $thedate.Format “January 02” }}</h1>
  {{ range .Pages.Reverse }}
    {{ if eq .Type “post” }}
      {{ .Render “summary”}}
    {{- end }}
  {{ end }}
{{ end }}

Link: Dark mode for Marfa

@bix said on Slack:

FWIW, if you’re using Marfa … right now this is giving me a decent-enough quick-and-dirty “dark mode” theme in Chrome and Firefox and Safari.

@media (prefers-color-scheme: dark) {
  body { filter: invert(100%); }
  img { filter: invert(100%); }
  body { background-color: #000!important; }
} 

Link: Using GLightbox with custom Hugo shortcodes on Micro.blog

I decide … write a custom Hugo shortcode to support using GLightbox. Custom shortcode? Shortcode? If you’re not familiar with this part of Hugo, the static site generator that powers Micro.blog under the hood, well you’re not alone. A shortcode is a Hugo-specific extension to your Markdown posts so that using a specific syntax you can dynamically create complex HTML content.

Source: Using GLightbox with custom Hugo shortcodes on Micro.blog.

Link: The core parts of Micro.blog :

The core parts of Micro.blog are Ruby, MySQL, Redis, with Hugo + Nginx for serving hosted blogs. Split across 5 servers, plus the new photo storage. Also S3 for a couple things, but may migrate that away too.

Manton Reece: 03 December 2019.

Link: Swarm check-ins and Micro.blog:

When a post has location information, you can see the coordinates in the posts list on your account

default Micro.blog themes do not currently do anything with this info… create a custom theme to access coordinates as custom parameters

Link: Changing Your Site Logo in Dark Mode

Changing Your Site Logo in Dark Mode

I have a logo at the top of my blog … it looks great on a white background! In dark mode, however, it looks really bad.

I turned to our old friend, CSS, to get me through this problem. First, I created and uploaded two versions of my logo: a light mode version and a dark mode version.

Now all I had to do was add the Custom CSS to overwrite the light mode logo hard coded into the HTML in the theme files with the dark mode logo.

Link: free Micro.blog test blogs

Micro.blog test blogs

Micro.blog now lets you create a free test blog for your account with a URL like username-test.micro.blog. There’s a button to create the test blog under Posts → Design → Edit Custom Themes. It will appear as a free 2nd blog on your account, and you can post to it, upload files, or try out custom themes.

Link: Search engine indexing

As of 21 August 2019 Micro.Blog automatically adds a robots.txt file to each hosted site: Search engine indexing.

Disabling or customizing your robots.txt file.

If you’d like to disable generating the robots.txt file, you can override it with a custom theme. …

You can also add custom rules to the robots.txt file.