Hexo scaffolds system¶
The Hexo scaffolds system is a template mechanism used to generate new content files efficiently. Instead of creating every file from scratch, Hexo utilizes scaffolds to pre-populate posts with default layouts and front matter^[600-developer-blog-hexo-blog-hexo-command.md].
Usage¶
To create a new post using the default scaffold, users can execute the hexo new post command.^[600-developer-blog-hexo-blog-hexo-command.md]
For example, running hexo new post "Hexo command" will generate a new article file using the template found in the scaffolds directory.^[600-developer-blog-hexo-blog-hexo-command.md]
Scaffolds and Layouts¶
Scaffolds are stored in the scaffolds folder of the Hexo project directory.^[600-developer-blog-hexo-blog-hexo-command.md] When a command like hexo new is run, Hexo copies the appropriate scaffold file to the source directory, allowing users to immediately begin writing content within a pre-defined structure.
The resulting file applies specific layout rules found in the theme, such as layout.ejs, which determines the visual presentation of the post.^[600-developer-blog-hexo-blog-hexo-command.md]
Related Concepts¶
- Documentation Workflow
- [[Templates]]
Sources¶
600-developer-blog-hexo-blog-hexo-command.md