Hexo theme configuration¶
In the Hexo static site generator, theme settings are managed separately from the core site configuration to allow for modular design and easier updates^[600-developer-blog-hexo-blog-create-blog-hexo.md]. The configuration process involves two distinct YAML files: the main site configuration file and the theme-specific configuration file^[600-developer-blog-hexo-blog-create-blog-hexo.md].
Configuration Files¶
The primary settings for the blog are located in the root _config.yml file^[600-developer-blog-hexo-blog-create-blog-hexo.md]. This file handles global parameters such as the site URL, language, and deployment settings^[600-developer-blog-hexo-blog-create-blog-hexo.md].
Theme-specific options are managed in a separate _config.yml file located within the theme's own directory^[600-developer-blog-hexo-blog-create-blog-hexo.md]. For example, if using the "NexT" theme, the path would typically be themes/next/_config.yml^[600-developer-blog-hexo-blog-create-blog-hexo.md]. This separation ensures that core site logic remains distinct from presentation layer settings^[600-developer-blog-hexo-blog-create-blog-hexo.md].
Common Settings¶
Language and Localization¶
The language for the entire site is defined in the root _config.yml file^[600-developer-blog-hexo-blog-create-blog-hexo.md]. To set the language to Traditional Chinese, for instance, the configuration must be updated to language: zh-tw^[600-developer-blog-hexo-blog-create-blog-hexo.md].
User Interface Assets¶
Visual assets, such as user avatars, are typically configured within the theme's configuration file^[600-developer-blog-hexo-blog-create-blog-hexo.md]. While the theme file specifies the settings (e.g., enabling the avatar), the actual image files are usually stored in a dedicated directory within the source folder, such as source/uploads/avatar.jpg^[600-developer-blog-hexo-blog-create-blog-hexo.md].
Related Concepts¶
- [[Hexo]]
- [[Static site generators]]
- [[YAML]]
Sources¶
^[600-developer-blog-hexo-blog-create-blog-hexo.md]