githubjekyllgithub-pagesjekyll-theme

How to setup twitter and github username Jekyll


So I'm exploring what we can do through github hosting static website service. However, I could'nt find an explanation why in the _config.yml file, the setting twitter_username and github_username aren't rendering nor working.

This is my _config.yml file :

title: Hacker theme
description: This is Bilal MAJJAD personal page
show_downloads: false
google_analytics: G-QTNDKBBZ67
theme: jekyll-theme-hacker
twitter_username: byhlel
github_username: byhlel

My guess is that it's not supported by the Hacker theme of Jekyll or maybe I need to import something else?

source code (https://github.com/byhlel/page/blob/main/_config.yml).


Solution

  • It's not supported/in the code, see https://github.com/pages-themes/hacker - you'd need to access the variable from the somewhere, e.g. the layout.

    See https://jekyllrb.com/docs/variables:

    Example:

    <div>https://twitter.com/{{ site.twitter_username}}</div>

    Not sure if this is the correct URL to a profile though.