Skip to content

Hexo directory structure

The Hexo framework relies on a specific directory structure to manage site configuration, content, themes, and generated output^[600-developer-blog-hexo-blog-create-blog-hexo.md].

Root Directory

The root directory contains essential configuration and data folders.

  • _config.yml: This serves as the main configuration file for the entire Hexo site^[600-developer-blog-hexo-blog-create-blog-hexo.md].
  • public/: This directory stores the static website resources generated after running the build process^[600-developer-blog-hexo-blog-create-blog-hexo.md].
  • themes/: Website themes are installed in this directory^[600-developer-blog-hexo-blog-create-blog-hexo.md].
    • Each theme typically has its own subdirectory (e.g., landscape/ or next/).
    • Theme-specific configuration is handled in [theme-name]/_config.yml^[600-developer-blog-hexo-blog-create-blog-hexo.md].
  • package.json: This file defines project metadata and manages dependencies, including Hexo plugins and scripts for tasks like cleaning, deploying, or running a development server^[600-developer-blog-hexo-blog-create-blog-hexo.md].

Source Directory

The source/ directory houses the raw content and assets for the site^[600-developer-blog-hexo-blog-create-blog-hexo.md].

  • _posts/: This is the default location where all blog posts and articles are written^[600-developer-blog-hexo-blog-create-blog-hexo.md].
  • uploads/: Static assets such as avatars or images are often stored here^[600-developer-blog-hexo-blog-create-blog-hexo.md].

Configuration Details

Within the root _config.yml, users can define specific behaviors, such as deployment URLs and site language^[600-developer-blog-hexo-blog-create-blog-hexo.md]. Additionally, the skip_render configuration allows users to specify files that should not be processed by Hexo's rendering engine^[600-developer-blog-hexo-blog-create-blog-hexo.md].

[[Hexo]] [[Static Site Generator]] [[Node.js]]

Sources

  • 600-developer-blog-hexo-blog-create-blog-hexo.md