【问题标题】:Changing personal site configuration with jekyll使用 jekyll 更改个人站点配置
【发布时间】:2021-07-05 07:42:12
【问题描述】:

我正在尝试使用 jekyll 构建 a site。我设法使数学工作并上传了一些文件。现在内容的整体分布并不理想。

  • 我获得了一个指向“HEAD”的链接,其中列出了 Jekyll 的一系列更新。我想摆脱它。
  • 主 url 重定向到一些博客条目,而您必须单击“关于”才能转到有关我的一些一般信息。我想以相反的方式来做,即在页面https://rjraya.github.io/ 的主 url 中显示 about 部分,并在一些派生 url 中显示博客,如https://rjraya.github.io/blog

Here 是页面的来源。我怎样才能做这个简单的改变?我了解我正在使用 Minima 模板。

【问题讨论】:

    标签: jekyll minima


    【解决方案1】:

    回复:头

    我认为“HEAD”来自History.markdown 文件。奇怪的是,“HEAD”没有出现在本地jekyll serve 开发环境中。我怀疑code below 在渲染header.html 时会在jekyll 中拾取History.markdown,以及about.md

    https://github.com/rjraya/rjraya.github.io/blob/ddc6a2f5c5804961da6ac79472b7f77052bef267/_includes/header.html#L20-L27

        <div class="trigger">
          {%- for path in page_paths -%}
            {%- assign my_page = site.pages | where: "path", path | first -%}
            {%- if my_page.title -%}
            <a class="page-link" href="{{ my_page.url | relative_url }}">{{ my_page.title | escape }}</a>
            {%- endif -%}
          {%- endfor -%}
        </div>
    

    RE:页面标题 URL Computational reflections

    在此行中将 href/ 更改为 /blog https://github.com/rjraya/rjraya.github.io/blob/ddc6a2f5c5804961da6ac79472b7f77052bef267/_includes/header.html#L7

    <a class="site-title" rel="author" href="{{ "/blog" | relative_url }}">{{ site.title | escape }}</a>
    

    RE:关于网址

    about.md 页面中删除permalink : /about/about.md 将在下一步中进入主页(例如/)。 https://github.com/rjraya/rjraya.github.io/blob/gh-pages/about.md

    RE: 在主页rjraya.github.io 上显示about.md 信息并在rjraya.github.io/blog 下显示_posts 降价文件

    jekyll 使用基于降价文件名分配永久链接的默认行为。

    index.md 重命名为blog.md。这会将_posts 文件列表从/ 移动到/blog

    about.md 重命名为index.md。这会将about.md 的内容从/about 移动到/

    【讨论】:

    • 酷,非常感谢,我会尝试并接受如果它有效
    • 抱歉,我没有得到我想要的配置。我在主 url 中获得博客,而我想获得的是 about 部分。
    • @Rodrigo,我可能误解了您的要求。对于主 url,您希望链接转到 about.md。关于链接呢,你想把它放在哪里?
    • 所以基本上我希望rjraya.github.io 重定向到about.md 中的内容,链接rjraya.github.io/blog 重定向到_posts 中的内容,即现在rjraya.github.io 中显示的内容。
    • 没错,这就是我想要的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-19
    • 2020-08-04
    • 2011-03-21
    • 2020-05-19
    • 2015-03-30
    • 2018-12-14
    相关资源
    最近更新 更多