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
excerptfrom post fordescriptionif exists - set
og:typeto 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.