Why Folder Structure Matters for SEO
Even though Jekyll generates static HTML files, the way you organize your source folders impacts your URL structure, site navigation, and crawlability by search engines. A well-thought folder hierarchy ensures clean URLs, easier content management, and better user experience—factors that indirectly influence SEO.
Key Components of a Jekyll Site Structure
Here are the main folders and files you will manage in Jekyll:
_posts/
: Contains blog posts in markdown with date-prefixed filenames_pages/
or root-level markdown files: Static pages like About, Contact, etc._layouts/
: HTML templates that control the look of pages_includes/
: Reusable HTML partials included in layouts or postsassets/
orimages/
: Static files like images, CSS, and JavaScript_data/
: YAML or JSON files for site data used in templates
Best Practices for SEO-Friendly Folder Structure
1. Use Meaningful Folder Names
Keep folder names descriptive and simple. Avoid underscores or spaces in URLs generated from folder names to maintain readability.
2. Leverage Permalinks in Front Matter
Control URL structure precisely using the permalink
attribute in page/post front matter or _config.yml
. This allows you to flatten or nest URLs independently from folder location.
3. Organize Content by Topic or Category
For blogs with multiple categories, consider grouping posts in subfolders matching categories. For example:
_posts/technology/2025-05-25-post-title.md _posts/marketing/2025-05-20-another-post.md
Then use permalinks to keep URLs neat, e.g., /technology/post-title
.
4. Separate Static Pages Clearly
Keep pages like About, Privacy Policy, and Contact in a dedicated folder like _pages
or root folder, avoiding clutter among posts.
5. Store Media in assets
Folder
Store images, CSS, JS, and fonts under assets/
. Reference these files with absolute or relative URLs for better caching and performance.
6. Avoid Deep Nesting
Limit folder depth to prevent overly complex URLs. Deeply nested URLs can be harder to remember, share, and sometimes negatively impact crawling efficiency.
Example Folder Structure for a Jekyll Blog
/ ├── _posts/ │ ├── technology/ │ │ ├── 2025-05-25-ai-trends.md │ │ └── 2025-04-18-cloud-computing.md │ ├── marketing/ │ │ ├── 2025-05-20-content-strategy.md │ │ └── 2025-03-10-seo-tips.md ├── _pages/ │ ├── about.md │ ├── contact.md │ └── privacy.md ├── _layouts/ │ ├── default.html │ └── post.html ├── _includes/ │ ├── header.html │ └── footer.html ├── assets/ │ ├── css/ │ │ └── main.css │ ├── js/ │ │ └── scripts.js │ └── images/ │ ├── logo.png │ └── banner.jpg ├── _data/ │ └── navigation.yml ├── _config.yml └── index.md
Controlling URL Structure via Permalinks
Modify your _config.yml
to set global permalink patterns, for example:
permalink: /:categories/:title/
This tells Jekyll to generate URLs like /technology/ai-trends/
. You can override permalinks per post or page for specific cases.
Using Categories and Tags for SEO
Organize posts with categories and tags to enable category pages and tag archives. These pages create additional entry points for search engines and users.
Generate Category Pages
Use plugins or manual pages to list posts by category. Structure these URLs cleanly, e.g., /category/technology/
.
Tag Pages
Similarly, create tag pages with URLs like /tag/seo/
. Both category and tag pages should have good meta titles and descriptions.
Improving Crawlability and Indexing
Ensure your folder and URL structure avoids duplicate content and respects canonical URLs. Use:
rel="canonical"
tags in layouts- Consistent URL formats (trailing slash or no trailing slash)
- Sitemaps reflecting actual URL structure
Conclusion
A clean, logical folder structure in your Jekyll project is foundational for SEO success. By aligning folder organization with your content strategy, controlling URLs via permalinks, and ensuring easy navigation, you improve both user experience and search engine visibility. Take time to plan your site structure before populating it with content to save headaches later.