-
Notifications
You must be signed in to change notification settings - Fork 16
Description
Description
I hope to avoid repeating 'hexo generate' when db.json already exists`
Explanation / motivation
I will publish the blog to multiple sites. To automate the process, I will use scripts combined with makefiles to perform the relevant operations, such as using rsync to upload to the specified directory on the A site and then publishing to Github Pages. The above two steps only need to execute hexo generate once, because when publishing to Github Pages, Hexo simply copies all the files in the generated public directory to .deploy_git. To generate the index, hexo algolia will execute hexo generate again, which is a time-consuming and repetitive task if there are many blogs. Additionally, if I use --config to load custom configurations to generate deployment files, hexo algolia will not support this operation. Below is a part of my workflow:
deploy-github: hexo deploy --config _config.yml,_config.xxx.yml,_config.publish.yml && hexo algolia
deploy-all: deploy-m920x deploy-githubAdditional information
- I can implement this feature / improvement
Algolia generates index dependencies on the db.json file, so a check can be added here to execute generate only when it does not exist:
// Check if the database exists, and if not, generate it.
if (!hexo.database) {
await hexo.call('generate');
}- Enable
hexo algoliato support hexo's parameters; this has not yet been thought of.
Or may not even need this, hexo deploy --config _config.yml, _config.xxx.yml, _config.publish.yml && hexo algolia already meets the requirement, the main task of hexo algolia is just to upload the index.