Static site deployment workflow¶
A static site deployment workflow typically involves using a Static Site Generator (SSG) to build content into static files and then deploying those files to a web server or hosting service.^[600-developer__blog__hexo-blog__create-blog-Hexo.md] This process is often automated to streamline the publication of blog posts and updates.
Tooling and Generation¶
The foundation of this workflow is the SSG itself. For example, Hexo is a popular framework that can be installed globally via npm to manage the site structure.^[600-developer__blog__hexo-blog__create-blog-Hexo.md] The core generation commands generally follow a cycle of generating the site files and optionally testing them locally.
The standard workflow usually consists of the following steps^[600-developer__blog__hexo-blog__create-blog-Hexo.md]:
- Generation: Running
hexo generate(orhexo g) to process source files (e.g., Markdown) and output static assets (HTML, CSS) into apublic/directory.^[600-developer__blog__hexo-blog__create-blog-Hexo.md] - Local Testing: Running
hexo server(orhexo s) to preview the site locally onlocalhostbefore publishing.^[600-developer__blog__hexo-blog__create-blog-Hexo.md] - Deployment: Running
hexo deploy(orhexo d) to transfer the generated files to the target hosting environment.^[600-developer__blog__hexo-blog__create-blog-Hexo.md]
To speed up development, plugins such as hexo-browsersync can be integrated to enable automatic page refreshing during local editing.^[600-developer__blog__hexo-blog__create-blog-Hexo.md]
Configuration and Automation¶
Deployment settings are typically managed within a configuration file (e.g., _config.yml) in the project root.^[600-developer__blog__hexo-blog__create-blog-Hexo.md] This file defines critical parameters such as the destination URL and the deployment method.
For hosting on [[Git]]-based platforms like GitHub Pages, a specific deployment plugin like hexo-deployer-git is required^[600-developer__blog__hexo-blog__create-blog-Hexo.md]. Once configured, the deployment process can be combined into a single command to automate the build and release pipeline^[600-developer__blog__hexo-blog__create-blog-Hexo.md].
Directory Structure¶
A typical project utilizing this workflow organizes files to separate source content from the final build artifacts^[600-developer__blog__hexo-blog__create-blog-Hexo.md]:
source/_posts/: Contains the raw content files (e.g.,.mdfiles).public/: The output directory where the generated static site is stored after running the generation command._config.yml: The main configuration file for site settings.themes/: Contains the site themes, which may have their own separate configuration files.
Related Concepts¶
- Documentation Workflow
- [[Continuous Integration]]
- [[Git]]
Sources¶
600-developer__blog__hexo-blog__create-blog-Hexo.md