Relatively Ignorant A blog on things about which I may or may not know stuff05c7270bb9acde1e4952912c9e3f5dbd854b57f1

Putting tags into HTML meta keywords


I wanted to include a page’s tags in an HTML meta tag as keywords.

Given a page with these tags:

I want the HTML header to contain:

<meta name="keywords" content="gradle,spring-boot"> 

I achieved that simply by adding this into the head.html include file:

  {% if page.tags %}
  <meta name="keywords" content="{{ page.tags | join: ',' }}">
  {% endif %}