添加Jekyll SEO标签后文章页面出现404错误,寻求技术帮助
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_postsdirectory (note the leading underscore!) with filenames following the strict format:YYYY-MM-DD-your-post-title.md. If you placed posts in a plainpostsfolder 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/postspage by default—you need to build it yourself. Make sure you have either aposts.mdfile in your site root, or aposts/index.mdfile inside apostsfolder. 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
/postswill throw a 404, even if you have valid posts in_posts.Verify your permalink configuration
Open your_config.yamland check thepermalinksetting. If you’ve set a custom permalink structure, make sure it doesn’t conflict with the/postspath. For example, if you havepermalink: /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 anexcludesection in your config that’s accidentally excluding the_postsdirectory or yourposts.mdfile. 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
Runjekyll serveon your local machine and visithttp://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.mdfile and config updates) and waited for the deployment to finish. - If using a custom server, ensure all files from the
_sitedirectory were uploaded correctly, and your server’s rewrite rules support static Jekyll paths (most do, but it’s worth verifying).
- If using GitHub Pages, confirm you’ve pushed all changes (including the
Fix the URL typo
You mentioned visitinghttp://www.nezmustafa.com//posts(with two slashes). While most browsers normalize this to a single slash, try accessinghttp://www.nezmustafa.com/postsdirectly to rule out any weird URL parsing issues.
内容的提问来源于stack exchange,提问作者jibjab3344

