首页 文章

Github页面没有更新

提问于
浏览
67

我正在与Github页面遇到一个奇怪的问题 . 我将一个新提交推送到我的个人页面maltzj.github.io,但新文章没有出现在那里 . 当我在本地执行服务器时,帖子位于 localhost:4000/posts/the-price-of-inconsistent-code/ . 但是,当我去http://maltzj.github.io/posts/the-price-of-inconsistent-code时,我得到了一个404.我还添加了一个新文件,该文件应该在http://maltz.github.io/test.html,但是这也会抛出404 .

一切都在本地构建和运行我的git repo是最新的,并且github状态页面上没有关于构建问题的任何内容,所以我对这个问题的处理方式有点不知所措 . 如何使用我添加的新contnet更新我的页面?

作为参考,支持我的页面的仓库的位置是http://github.com/maltzj/maltzj.github.io

24 回答

  • 3

    我的解决方案是获取index.html文件并转到它(例如example.github.io/index.html),然后重新加载它,您的更改将会更新 . 然后你回到(example.github.io)它应该更新 . 您可以使用master.css文件等执行相同的操作 .

  • 1

    在我的情况下,碰巧是我提到了引用图像的相对路径,例如 - ./test.png似乎不允许,可能是安全问题或者是什么 . 无论如何,如果您已经做过类似的事情,请将其删除并将其称为test.png

  • 2

    对我来说,我等了约5分钟,它已经更新了

    如果有人从头开始(手动)创建分支gh-pages,问题是你需要一个文件调用params.json才能使它工作 .

    我没有这个 params.json 文件,但它仍然可以工作......

  • 33

    我有一个未公开的 <a> 标签,导致构建永久挂起 . 修复解决了这个问题 . 理解GitHub会验证您的链接 .

  • 6

    对于其他人,还要检查帖子的日期 . 我刚遇到这个问题 . 我在UTC 11,我很确定服务器是UTC . 因此,如果我用当地时间约会我的帖子,服务器认为他们将来也不会构建它们 . 使用UTC避免了这个问题 .

    正如joao cenoura在下面的评论中所提到的:

    • 你可以通过将 future: true 添加到_config.yml来告诉jekyll显示"future"帖子

    • 和/或添加 timezone: TIMEZONE 以指定您的时区 .

    有关详细信息,请参阅https://jekyllrb.com/docs/configuration/ .

  • 1

    这一切都没有为我解决 . 解决方案是将index.html文件编辑到github网站 .

  • 0

    我有一个未经验证的电子邮件的问题 . 此更新首次发布,但在此之后失败 . 需要经过验证的电子邮件才能触发github页面构建 . 此外,部署密钥不能用于此,因为它不会触发构建 .

    资料来源:https://help.github.com/articles/troubleshooting-github-pages-build-failures/

  • 0

    对于未来的人发现这个:我有一个空的CNAME文件 . 检查您是否遇到类似问题 .

  • 0

    就我而言,以上解决方案都不起作用 . 最后我发现原因是:我的_config.yml中有“relative_permalinks”选项 . 最近在Jekyll 3.0中不推荐使用此选项 .

    参考:https://help.github.com/articles/removing-relative-permalinks/

  • 0

    我知道这可能听起来很简单,但要确保你在正确的分支和正确的文件中 . 在我的情况下,我做了一个gh页面,并尝试从主分支上的本地仓库提交 . 我也在更新我的文件名而不是index.html . 这些是我的错误 . 我不得不切换到gh-pages分支并在index.html提交中更新,推送然后一切正常 .

  • 9

    请参阅Jerkyll故障排除网站,因为有多个错误来源:https://help.github.com/articles/troubleshooting-jekyll-builds/

    在我的情况下,降价文件中的德语变音符号(“ö”)引起了问题 .

  • 0

    在我的情况下,在这里的一些解决方案的试验和错误之后,修复它的是将编码添加到_config文件中

    encoding: UTF-8
    

    更多故障排除选项here

  • 1

    对我来说,这是一个没有正确使用.gitmodules文件的问题 . 我能够在我的仓库的设置选项卡中进行故障排除,在GitHub页面部分下,这表示构建问题并且有助于故障排除 .

  • 2

    好吧,我走到了尽头,没有什么对我有用,所以我会与你分享我为了让我的工作所做的一切 . 很奇怪(并且简单地)我创建了一个新的分支,使该分支成为“默认”分支并从那里推出 . 这对我有用,我希望它适用于那些使其达到最低点而仍未找到答案的人, 哈哈 .

  • 3

    我知道这只是添加到长尾列表的解决方案,但在我的情况下,我忘了在 _config.yaml 中定义 kramdown

    # Build settings
    markdown: kramdown
    

    这是我从主题转换时引起的没有 kramdown 要求的主题 .

  • 1

    今天我有一个静态页面出现这个错误 - 原因实际上是GitHub Pages本身的服务失败 . 您可以在https://status.github.com/messages查看服务信息 .

  • 3

    如果有人从头开始(手动)创建分支gh-pages,问题是你需要一个文件调用params.json才能使它工作 .

    这是该文件的一个示例:

    {
      "name": "nameOfProyect",
      "tagline": "name of proyect",
      "body": "### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:\r\n\r\n```\r\n$ cd your_repo_root\/repo_name\r\n$ git fetch origin\r\n$ git checkout gh-pages\r\n```\r\n\r\nIf you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.\r\n\r\n### Designer Templates\r\nWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.\r\n\r\n### Rather Drive Stick?\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `<a>` element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out the documentation at https:\/\/help.github.com\/pages or contact support@github.com and we\u2019ll help you sort it out.\r\n",
      "google": "",
      "note": "Don't delete this file! It's used internally to help with page regeneration."
    }
    
  • 0

    在我的情况下,它是不正确的 kramdown 语法 . 我的代码是

    {% highlight %}
      lorem lipsum
     {% endhighlight %}
    

    显然你必须告诉 kramdown 这种语言

    {% highlight html %}
      lorem lipsum
     {% endhighlight %}
    
  • 0

    我的Github Pages在repo的Settings选项卡下关闭了 .

    我不记得把它关掉了,但它就在那里,然后将它重新打开就是修复 .

  • 1

    加上我的两分钱:在我的情况下有两个问题(一个“pebcak”,然后是一个更有效的问题) .

    我在GitHub中设置了两个电子邮件地址,我正在检查非主电子邮件中的构建错误消息(管理电子邮件:登录到GitHub,单击右上角的用户菜单,选择设置,然后选择“电子邮件”)左侧菜单 - 构建错误消息将到达主电子邮件集) .

    一旦我看到我发现的错误消息,我在 _config.yaml 中添加了包含":"字符的描述,因为这是用于分隔 key,value 对的字符,所以它阻止了网站的构建 .

  • 8

    在存储库设置中,确保当前正在从 gh-pages 分支构建Github页面

  • 22

    在我的情况下,我有另一个文件与页面相同 permalink 没有刷新内容 . 注意这一点 .

  • 5

    我有同样的问题,但在我的情况下,CNAME包含正确的域名 . 我认为问题与我以前做过的存储库重命名有关...在线名称与本地有所不同,虽然没有推送和在线文件更新的问题 - 现场版本没有 . 从本地计算机删除存储库并从GitHub再次克隆后问题得到解决 .

  • 0

    在我看来,github页面是从一次提交迟到的 . 这意味着如果您不想刷新,请添加对源,提交和推送的任何修改 .

    此行为仅适用于gh-pages分支和any.github.io存储库 . 在“docs”文件夹中,修改直接适用 .

相关问题