Scaffold-based content creation¶
Scaffold-based content creation is a workflow mechanism used in static site generators and documentation systems to rapidly generate new files based on pre-defined templates.^[600-developer__blog__hexo-blog__Hexo-command.md] Instead of creating a blank file, the system populates the new content with a specific structure, including front matter such as aliases, creation dates, and metadata, based on the selected scaffold type.^[600-developer__blog__hexo-blog__Hexo-command.md]
Mechanics¶
The core function involves a command-line interface that accepts a layout type and a title.^[600-developer__blog__hexo-blog__Hexo-command.md] For example, the command hexo new post "Title" or hexo new page "Title" triggers the generation process.^[600-developer__blog__hexo-blog__Hexo-command.md] The system locates the corresponding template file within the scaffolds directory and uses it to construct the new file.^[600-developer__blog__hexo-blog__Hexo-command.md]
Common Layouts¶
Scaffolds are typically categorized by the intended use of the content:
- Posts: Standard articles or blog entries.^[600-developer__blog__hexo-blog__Hexo-command.md]
- Drafts: Works-in-progress that are not yet published.^[600-developer__blog__hexo-blog__Hexo-command.md]
- Pages: Standalone pages that generate a new directory folder in the file structure.^[600-developer__blog__hexo-blog__Hexo-command.md]
Draft workflow¶
Scaffolds specifically support a distinct workflow for managing unfinished content. Users can create a draft using a specific scaffold, which keeps the file separate from published posts.^[600-developer__blog__hexo-blog__Hexo-command.md] Once the work is complete, a publish command is used to move the content from the draft folder to the post folder, effectively changing its status from draft to published.^[600-developer__blog__hexo-blog__Hexo-command.md]
Related Concepts¶
- Documentation Workflow
- [[Templates]]
Sources¶
600-developer__blog__hexo-blog__Hexo-command.md