使用 jekyll 和 github 页面构建静态站点时可用的变量

标签 variables jekyll github-pages

在使用 github pages 和 jekyll 构建网站时,我们可以使用像 site.github.repository_name 这样的变量。等。这些变量值在构建站点时由 github 页面提供。但是我无法在 github 页面的文档或 jekyll 文档中关于 github 页面的页面中找到这些变量的完整列表。
我已经入住了

  • https://jekyllrb.com/docs/github-pages/
  • https://jekyllrb.com/docs/variables/
  • https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/about-github-pages-and-jekyll
  • 最佳答案

    GitHub Pages 使用一些默认启用且无法禁用的插件。其中之一是jekyll-github-metadata .
    其中,如描述中所述:

  • 传播 site.github带有 repository metadata 的命名空间
  • site.title作为存储库名称,如果没有设置
  • site.description如果没有设置,则作为存储库标语
  • site.url作为 GitHub Pages 域(cname 或用户域),如果没有设置
  • site.baseurl如果没有设置,作为项目页面的项目名称
  • site.github.repository_name来自上面提到的存储库元数据,以及 site.github.wiki_url还有很多其他的东西。

    关于使用 jekyll 和 github 页面构建静态站点时可用的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64681150/

    相关文章:

    node.js - 无法部署到 github 页面

    java存储实例变量并使用键值之一进行访问

    Java:子类中父类的变量未初始化并保留 null

    javascript - 谷歌反向地理编码返回变量

    docker - 如何使用docker compose geting来运行jekyll-服务的不受支持的配置选项: 'site'

    jekyll - 如何更改 Jekyll 中的路径和 URL?

    ruby - Jekyll 不在本地提供站点服务

    html - 设置 GitHub Pages 元素页面。页面打开但图像和 main.css 未加载

    markdown - kramdown 中的三级嵌套列表

    objective-c - 用其他类型重新定义变量名