简体   繁体   English

如何设置 twitter 和 github 用户名 Jekyll

[英]How to setup twitter and github username Jekyll

So I'm exploring what we can do through github hosting static website service.所以我正在探索我们可以通过 github 托管 static 网站服务来做些什么。 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.但是,我找不到解释为什么在_config.yml文件中,设置twitter_usernamegithub_username既不渲染也不工作。

This is my _config.yml file:这是我的 _config.yml 文件:

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?我的猜测是 Jekyll 的 Hacker 主题不支持它,或者我需要导入其他东西?

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

It's not supported/in the code, see https://github.com/pages-themes/hacker - you'd need to access the variable from the somewhere, eg the layout.它不受支持/在代码中,请参阅https://github.com/pages-themes/hacker - 您需要从某个地方访问变量,例如布局。

See https://jekyllrb.com/docs/variables :请参阅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.不确定这是否是配置文件的正确 URL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM