【问题标题】:Jekyll custom date in Github PagesGithub Pages 中的 Jekyll 自定义日期
【发布时间】:2015-02-09 01:01:18
【问题描述】:

现已修复

我想用我的语言自定义日期。例如,而不是 08 Feb 2015,我可以有08 Février 2015。我怎样才能改变这个, 在我的 Jekyll 网站上?

我的问题是我由 Github Pages 托管,所以没有插件 允许。

PS:我检查了this questions,但不是答案。

另外,我的类似内容总是被重定向到域0.0.7.222,我该如何解决这个问题?

这是相关内容的代码;

<div class="related">
  <h2>Contenu relié</h2>
  <ul class="related-posts">
    {% for post in site.related_posts limit:3 %}
      <li>
        <h3>
          <a href="{{ site.baseurl }}{{ post.url }}">
            {{ post.title }}
            <small>{% include custom_date_full_fr.html date = post.date %}</small>
          </a>
        </h3>
      </li>
    {% endfor %}
  </ul>
</div>

来自Lanyon theme

坦克

【问题讨论】:

  • 我已经回答了如何输出自定义国际化日期here
  • 你能告诉我们一些关于你重定向的代码吗?
  • @DavidJacquel 当然,查看问题,添加即可。而且,感谢您的回答,这很有趣。
  • 更有用的,请提供存储库 url。我有一个想法,但我想确认一下我的想法。

标签: jekyll github-pages


【解决方案1】:

好的,我明白了。

设置baseurl

作为从根子域提供的服务,您必须将baseurl 设置为""

baseurl: ""

链接到页面和资源

通过此 url 链接到帖子或页面是 {{site.baseurl}}{{page.url}},因为页面/帖子 url 以 / 为前缀。

链接到css或js或图像等资源需要额外的/

<link rel="stylesheet" href="{{ site.baseurl }}/public/css/poole.css"> 

【讨论】:

  • 这需要我一点时间,但它已经解决了。这个主题与baseurlurl 并不完美。我需要更改很多东西和文件,但没关系。谢谢
猜你喜欢
  • 2015-04-07
  • 1970-01-01
  • 2013-12-27
  • 2013-12-16
  • 1970-01-01
  • 2021-12-31
  • 2015-11-29
  • 1970-01-01
  • 2023-01-24
相关资源
最近更新 更多