How to add HrefLang tags to a Jekyll blog
If you are using the standard Jekyll minima 3 theme hosted on Github pages this can be done fairly easily.
Create a file called custom-head.html under _includes and add the following snippet in:
Then for posts written in different languages, add a “lang:” attribute in the post front matter, and set that as the target language. Remember you can also set regional localisation too, for example pt-BR for Portuguese speakers in Brazil, but also in cases like es-JP for Spanish speakers in Japan. Google follows ISO639-1 for languages and ISO 3166-1 Alpha 2 for countries.