LouisBarranqueiro / hexo-algoliasearch

:mag_right: A plugin to index posts of your Hexo blog on Algolia
MIT License
135 stars 12 forks source link

Can I run this plugin without hexo algolia command on server side? Just list hexo-generator-category, hexo-generator-sitemape,etc. #144

Closed azhu021 closed 1 year ago

azhu021 commented 1 year ago

Thanks for your awesome plugin. Now I'm facing an issue with the deployment process, and I was hoping to get some help.

I've built a Hexo site on Aliyun Serverless, and I've noticed that the plugin isn't working automatically to generate index files and connect to the Algolia server. I have to manually add some extra command lines to my CI/CD YAML file. Here are some relevant code snippets:

  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server",
    "algolia": "hexo algolia"
  },
services:
  framework: 
    component: fc
    actions:
      pre-deploy:
        - run: npm install
          path: ./code
        - run: npm run build
          path: ./code
        - plugin: website-fc
        - run: npm run algolia
          path: ./code

I expected the Algolia Plugin to work automatically without requiring additional command lines, similar to other plugins such as hexo-generator-category and hexo-generator-sitemap.

Is there anything wrong with my procedure?

LouisBarranqueiro commented 1 year ago

πŸ‘‹ @azhu021, sorry for the late reply. I was on vacation. It's normal. hexo-generator-category and hexo-generator-sitemap packages are Hexo Genrators. hexo-algoliasearch is a Hexo Console command. They do not do the same thing and do not integrate in the same way.

As the README file states, this plugin is used to index posts of your Hexo blog on Algolia.

Is there anything wrong with my procedure?

No, in your CI, it's good. πŸ™‚ After the site has been deployed, you want to add a step to run the Hexo Algolia command to index posts.