简体   繁体   English

jekyll和github - 如何更新博客文章?

[英]jekyll and github - how to update the blog post?

Good day. 美好的一天。

Could you help me with a little problem I am experiencing. 你能解决我遇到的一个小问题吗?

I have a jekyll blog on the github. 我在github上有一个jekyll博客。 The problem is after I updated my old post, committed and pushed it, the blog post doesn't show any changes, but I see that the commit has been pushed successfully. 问题是在我更新了我的旧帖子,提交并推送它之后,博客文章没有显示任何更改,但我看到提交已成功推送。

If I run jekyll --server locally, it shows updated blog post and it doesn't report any errors. 如果我在本地运行jekyll --server,它会显示更新的博客帖子,并且不会报告任何错误。 I have no jekyll plugins installed. 我没有安装jekyll插件。

What am I doing wrong or misunderstanding? 我做错了什么或误解了什么? Thanks a lot. 非常感谢。


Added by Nawaz : Nawaz补充道:

I'm facing exactly same problem. 我面临完全相同的问题。 My I pushed added one markdown post and few css, and modified layouts and includes, then I pushed them to github. 我推了添加了一个降价帖和几个CSS,并修改了布局和包含,然后我将它们推送到github。 It is done successfully. 它成功完成了。 My github is showing all the changes in the repository, but the github blog (ie the generated html posts out of markdown) are still same. 我的github显示了存储库中的所有更改,但github博客(即从markdown生成的html帖子)仍然相同。 No change to them at all. 根本没有变化。 It is showing some posts which doesn't even exist in the repository. 它显示了一些甚至不存在于存储库中的帖子。 But when I do jekyll --server locally, then every update is being shown on my (local) blog hosted at http://localhost:4000 . 但是当我在本地执行jekyll --server ,每个更新都会在我的(本地)博客上显示,该博客位于http://localhost:4000

Please help me! 请帮我!

If your Jekyll site is not rendering properly after you push it to GitHub, it's useful to run Jekyll locally so you can see any parsing errors. 如果你将Jekyll网站推送到GitHub后没有正确呈现,那么在本地运行Jekyll会很有用,这样你就可以看到任何解析错误。 In order to do this, you'll want to use the same version that we use. 为此,您需要使用我们使用的相同版本。
GitHub's Pages servers currently use Jekyll 0.11.0 with Liquid 2.2.2 , and run it using this command: GitHub的Pages服务器目前使用Jekyll 0.11.0Liquid 2.2.2 ,并使用此命令运行它:
$ jekyll --pygments --safe

More info 更多信息

I'm now trying to solve the problems with my pygments highlighting (works locally, doesn't show on github at all, even though I'm receiving mails about succesful build). 我现在正试图解决我的pygments突出显示的问题(在本地工作,根本没有在github上显示,即使我收到有关成功构建的邮件)。 Findings so far: 到目前为止的调查结果:

  • Make sure that youre repository' default branch is 'master' (go to your repository Admin page). 确保您的存储库'默认分支是'master'(转到存储库管理页面)。
  • Put your Jekyll source files in some other branch, and put the _site content to your master branch. 将您的Jekyll源文件放在其他分支中,并将_site内容放入主分支。 There will be no _config.yml , no YAML front matter so github will render your stuff as is, and you would be building it locally on that other branch. 没有_config.yml ,没有YAML前端问题所以github将按原样呈现你的东西,你将在其他分支上本地构建它。 This actually worked for me. 这实际上对我有用。 It requires some manual labour when moving _site from that other branch to your master, but I'm fine with that - at least I do not have to rely on github build process which seems to be a bit buggy, plus, I can have whatever plugins I wish. 将_site从另一个分支移动到你的主人时需要一些手工劳动,但我对此很好 - 至少我不必依赖github构建过程,这似乎有点马车,而且,我可以有任何东西插件我希望。

When ever you generate your jekyll site locally for testing, always run jekyll --no-auto --server . 当你在本地生成你的jekyll网站进行测试时,总是运行jekyll --no-auto --server This would display if there were any errors encountered during the generation of your site. 如果在您的网站生成过程中遇到任何错误,则会显示此信息。 Also, before generating your site delete _site directory and then run the command as described above. 此外,在生成站点之前,请删除_site目录,然后按上述方法运行命令。

Let me know if you see any errors as such. 如果您发现任何错误,请告诉我。 We can debug further 我们可以进一步调试

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

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