I am continuing my investigation of Hexo, a static blog generator that has these useful characteristics:
- Hexo installs and runs under Node.js and runs in JavaScript.
- The generated public/ directory consists of static material that can be uploaded and served from any conventional web server, with GitHub a popular choice
- There is an ecosystem of plug-ins and customizable themes
There are some worrisome concerns around how to customize the blog.
It is important to stop fretting about perfecting the blog though. Instead, I need to confirm an end-to-end approach that takes a proof-of-concept simple blog through the workflow necessary for publishing on my hosted web sites. Only then should blog design be addressed.
Here’s how I am explaining all that to myself.
Authoring Configuration
- A local authoring folder is created on my PC. The authoring folder is set up by Hexo for generating web pages of a single personalized, customized blog. I will have an authoring folder for each of my published blogs, along with some number for experimental purposes.
- A fresh Hexo-initialized authoring folder includes a pre-installed default setup for generation of a simple blog that can be viewed locally and authored immediately.
- Verify installation and first-run by viewing the pre-installed “hello-world” initial post via the default setup.
- An initial theme, “landscape”, is pre-installed and enabled. This establishes the appearance of the generated web pages and other aspects of the published blog site.
- The initial configuration will need some customization for the title and published location of the generated blog.
- Practically everything in the authoring folder can be customized.
- Some customizations must be enabled by NPM installation of plug-ins for Hexo to employ as directed by edits to configuration files.
- Installation of theme definitions in the authoring folder is typically by cloning them from GitHub projects.
- Themes also require configuration and may be customized further.
- It is unclear how to manage and backup an authoring folder.
- Providing preservation and source-code management of local customizations and of the authored sources of blog content.
- Providing for possible updates to downloaded themes that have been customized locally.
- Providing for possible updates to the Hexo-provided basic configuration and its initial content that may have been customized locally.
Not So Fast, Sparky
I have several requirements for authoring new posts of existing blogs of mine.
- Atom feeds of each Hexo-generated blog, with the feed locations already used
- Root-entry of the blog provide at least the latest full post on the default page, with links to the chain of previous posts and the archive of posts by year and month
- Previous – Top – Next post links for navigation are valuable
- Having Tags and Categories
- Having DISQUS for comments
- Having a light appearance with legible colorization of code blocks and pleasant quotation blocks
- Providing social-network information, an author page, and similar information
All of these are achievable with existing Hexo plug-ins and themes. Having them all in combination with an authored appearance, a private theme, that works for me is the challenge.
I have been dithering around learning how to customize an authoring configuration that satisfies all of my requirements. What I am learning is how little I have of the tacit knowledge that the authors of templates must have. I also don’t know where there is documentation that I need.
I am also fretting over the wrong problem.
What I need most of all is a nearly-one-click mechanism where I can author a blog post, have it generated, and have it appear near-instantly on my hosted site. That’s what I have right now as I use Open Live Writer to compose and then publish this post, even though it goes to wordpress.com and not any property of mine.
With the point of generation being on my local PC, the question is, “How do I get deployment from there to the hosted site with 1-2 clicks? How do I integrate that into my site mirroring and backup arrangements?
I need to stop fussing about having the generated blog be perfect and start with something that is minimally adequate. There is no point in further refinement until an effortless deployment arrangement has been confirmed. That’s the critical proof-of-concept.
Deployment Concerns and Approach
- I want to publish in the same location as my existing blogs, in a manner that preserves the previous content
- So far, there is no conflict with the material that Hexo generates, in the authoring folder public/ subdirectory, so the Hexo-generated blog content can sit side-by-side with the older pages and archives of the previous version.
- Hexo uses index.html as the default root page of the generated blog. For technical reasons, I may have to use default.htm. I can work around that on my servers without changing anything in Hexo.
- I do need a publishing mechanism that will leave the old-blog material intact when uploading new/updated Hexo-generated blog content.
- I need a backup and source-code management system that covers a complete authoring folder.
- Direct Publishing
- I will directly FTP new generated public/ files to the hosted site. There are a number of ways to do this. I will want to find one that can be turned into one-click operation via a batch script or by use of the hexo deploy command.
- Having an effective direct-publishing approach needs to be confirmed first.
- Backup and Source-Code Management
- If the Visual Source Safe repository co-located on my web development server can be reached from Windows 10 on my PC, I can put entire authoring folders under source-code management in appropriate Mirror VSS projects of the nfoCentrale Web Deployment Pillars.
- This protects against customization loss when Hexo themes installed by cloning from GitHub are updated from GitHub.
- This, with appropriate included documentation, also supports any need to completely re-initialize an authoring folder.
- The use of VSS in the Hosted-Site Mirror Projects also supports restoration of the blog (and more) from a mirror of the hosted site.
- This or an equivalent is needed before I risk too much authoring-folder customization without any good backup, recovery, and source-code management.
- Having an effective source-code management and recovery approach needs to be confirmed next.
Simple early steps. Fail early if fail I must. Recover quickly.