Medium-sized photos

Update on this, in front matter we now also have a new “small” size. Note that like “medium” it’s not always present, so best to check before using it. For example:

{{ range .Params.photos_with_metadata }}
  {{ if .sizes.small }}
     <img src="{{ .sizes.small }}">
  {{ else }}
     <img src="{{ .url }}">
  {{ end }}
{{ end }}

To summarize the scaling Micro.blog does for JPEGs:

  • default for photos: 1800x1800
  • medium: 1000x1000
  • small: 300x300

The front matter should look like this:

photos_with_metadata:
- url: https://cdn.uploads.micro.blog/10/2024/example.jpg
  width: 600
  height: 600
  sizes:
    medium: https://cdn.uploads.micro.blog/10/2024/example-m.jpg
    medium: https://cdn.uploads.micro.blog/10/2024/example-s.jpg