equilibriumuk · equk.co.uk

11ty logo

I wanted to reimplement seo features on the site for a few reasons.
There were some bugs with the plugin I was using & I also wanted to remove unused tags for social media as opengraph seems to be the standard.

Everything is implemented using nunjucks templates & metadata.js instead of using a plugin.

SEO Features #

Core tags take data set in src/_data/metadata.js

  • page number in title on pagination
  • use excerpt from post for description if exists
  • set og:type to website/article depending on page
  • use canonical link for og:url

Pull Request #

You can find the full pull request for these changes on github.

fix opengraph & meta tags pull request on github

Changes #

  • remove plugin
  • add opengraph tags
  • add meta tags
  • add dynamic title for pages
  • add feature for setting ogtype
  • add current page using pagination in nunjucks
  • add dynamic description tags for blog posts
  • add canonical url
  • fix opengraph image
  • update README with new info

Notes #

Note

One thing I don't understand is people generating og:image for each post.
Often duplicating the same data included in opengraph.
This seems a waste of resource for a simple blog site.

Read the original on equk.co.uk ↗