Git Jekyll没有更新所有文件
我有以下设置:Git Jekyll没有更新所有文件,git,jekyll,Git,Jekyll,我有以下设置: NAS with GIT Server ---> Raspberry Pi with Jekyll ---> rsync to web-server 当NAS收到Git提交时,它会登录到my Pi并激活一个脚本。此脚本称为Jekyll: #!/usr/bin/env bash MYDATE="$(date)" PROJECT=website.git REMOTE=username@username.example.com:html NAS=username
NAS with GIT Server ---> Raspberry Pi with Jekyll ---> rsync to web-server
当NAS收到Git提交时,它会登录到my Pi并激活一个脚本。此脚本称为Jekyll:
#!/usr/bin/env bash
MYDATE="$(date)"
PROJECT=website.git
REMOTE=username@username.example.com:html
NAS=username@nas.internal.example.com:333
# Log commit
logger "[GIT] Received commit in $PROJECT on $MYDATE"
# Change to git directory
cd ~/$PROJECT
if [ $? -ne 0 ]; then
logger "[GIT] Directory ~/$PROJECT does not exist on $MYDATE"
cd ..
exit
fi
# Pull new version from the server
git pull origin master #ssh://$NAS/~/$PROJECT
if [ $? -eq 0 ]; then
logger "[GIT] Successfully pulled new code from $PROJECT from NAS"
else
logger "[GIT] Unable to pull code from $PROJECT from NAS"
exit
fi
# Build Website
export JEKYLL_ENV=production
bundle exec jekyll build --incremental
if [ $? -eq 0 ]; then
logger "[GIT] Successfully built website from repository $PROJECT"
else
logger "[GIT] Jekyll returned an error on $PROJECT"
exit
fi
# Upload to hoster
rsync -aP -e ssh /home/username/$PROJECT/_site/ $REMOTE --delete
if [ $? -eq 0 ]; then
logger "[GIT] Successfully synced website $PROJECT with remote host"
else
logger "[GIT] Unable to sync folder of site $PROJECT with remote host"
exit
fi
从我的输出到日志和控制台,就返回代码而言,一切都井然有序。Jekyll正在更新文章,但没有更新链接文章的概述
这是我最新文章的主题:
---
layout: post
title: redacted
date: 2019-08-23 10:00:00
categories: gist
post_image: /images/cpp.jpg
excerpt: redacted
---
正如你所看到的,这不是一个前沿问题。/g/index.html
中的概述页面是这样的,当我推送一篇新文章时,应该更新该页面:
<div style="padding-top: 2vh;"></div>
<div class="row">
{% for post in site.categories.gist limit:20 %}
<div class="col s12 m4 l4 dark-primary-color">
<div class="card">
<div class="card-image">
<img src="{{ site.url }}{{ post.post_image }}">
<span class="card-title"></span>
</div>
<div class="card-content default-primary-color primary-text-color">
<p class="length-limit">{{ post.excerpt }}</p>
</div>
<div style="padding-left: 0.5vw;" class="default-primary-color primary-text-color">
<a href="{{ site.url }}{{ post.url }}">Read</a>
</div>
<div style="padding-bottom: 2px;" class="default-primary-color"></div>
</div>
</div>
{% endfor %}
</div>
很难在这里发现问题,但如果我理解您的设置,它可能是一个时间问题:开发计算机和Raspberry之间的时间差 为了检查这一点,您可以更改脚本并告诉jekyll发布所有帖子,即使是有未来日期的帖子 更改:
bundle exec-jekyll-build——增量
注意:incremental
仅适用于jekyll-service
收件人:bundle-exec-jekyll-build-future
如果你的帖子出现了:这是时间问题
为了避免这个问题,您可以在jekyll中设置时区()
\u config.yml
timezone: Europe/Paris
这将迫使jekyll根据原始时区进行渲染,并相应地计算发布日期
timezone: Europe/Paris