You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

添加Jekyll SEO标签后文章页面出现404错误,寻求技术帮助

Troubleshooting the /posts 404 Error After Adding Jekyll SEO Tag

Let’s break down the most likely causes and fixes for your 404 issue—since the SEO tag plugin only handles meta data and shouldn’t break page routing, the problem is almost certainly unrelated to the plugin itself, but rather a Jekyll configuration or content structure misstep.

  • Check your post files and directory structure first
    Jekyll expects blog posts to live in the _posts directory (note the leading underscore!) with filenames following the strict format: YYYY-MM-DD-your-post-title.md. If you placed posts in a plain posts folder instead, or used an invalid filename format, Jekyll won’t recognize them as blog posts—and the /posts list page won’t have content to display (or might not exist at all).

  • Did you manually create the /posts list page?
    Jekyll doesn’t auto-generate a /posts page by default—you need to build it yourself. Make sure you have either a posts.md file in your site root, or a posts/index.md file inside a posts folder. The file needs front matter to tell Jekyll how to render it, plus Liquid code to list your posts. Here’s a basic working example:

    ---
    layout: page
    title: All Posts
    permalink: /posts/
    ---
    
    {% for post in site.posts %}
      <article>
        <h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
        <time>{{ post.date | date: "%B %d, %Y" }}</time>
        <p>{{ post.excerpt | strip_html | truncatewords: 30 }}</p>
      </article>
    {% endfor %}
    

    Without this file, visiting /posts will throw a 404, even if you have valid posts in _posts.

  • Verify your permalink configuration
    Open your _config.yaml and check the permalink setting. If you’ve set a custom permalink structure, make sure it doesn’t conflict with the /posts path. For example, if you have permalink: /posts/:title/, this makes individual posts live under /posts/your-post-title/, but you still need the separate list page we mentioned above. A misconfigured permalink could accidentally override or block the list page path.

  • Check for accidental exclusions in _config.yaml
    Double-check if you have an exclude section in your config that’s accidentally excluding the _posts directory or your posts.md file. If Jekyll is told to exclude these files, it won’t generate them in your final site build.

  • Test locally first to isolate the issue
    Run jekyll serve on your local machine and visit http://localhost:4000/posts (with a single slash, not two). If this works locally but not on your live site, the problem is deployment-related:

    • If using GitHub Pages, confirm you’ve pushed all changes (including the posts.md file and config updates) and waited for the deployment to finish.
    • If using a custom server, ensure all files from the _site directory were uploaded correctly, and your server’s rewrite rules support static Jekyll paths (most do, but it’s worth verifying).
  • Fix the URL typo
    You mentioned visiting http://www.nezmustafa.com//posts (with two slashes). While most browsers normalize this to a single slash, try accessing http://www.nezmustafa.com/posts directly to rule out any weird URL parsing issues.

内容的提问来源于stack exchange,提问作者jibjab3344

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 04:16:03