hexojs / hexo

A fast, simple & powerful blog framework, powered by Node.js.
https://hexo.io
MIT License
39.63k stars 4.87k forks source link

Is there no way to automatically rebuild on theme changes? #4605

Open Atulin opened 3 years ago

Atulin commented 3 years ago

Check List

Please check followings before submitting a new issue.

Question

I'm developing a theme for my blog, and I cannot find any way for the changes to be automatically reflected. I thought that hexo server would take care of it, but it seems to only rebuild on changes to markdown posts, not changes to themes.

What is the recommended way to work on a theme? Setting up some sort of a Gulp pipeline that would watch for changes and call hexo serve when it detects them?

Environment & Settings

Node.js & npm version

Hexo and Plugin version(npm ls --depth 0)

hexo-site@0.0.0 G:\WebstormProjects\genfic-blog
+-- hexo@5.3.0
+-- hexo-asset-pipeline@1.8.0
+-- hexo-generator-archive@1.0.0
+-- hexo-generator-category@1.0.0
+-- hexo-generator-index@2.0.0
+-- hexo-generator-sitemap@2.1.0
+-- hexo-generator-tag@1.0.0
+-- hexo-renderer-ejs@1.0.0
+-- hexo-renderer-marked@3.3.0
+-- hexo-renderer-sass@0.4.0
+-- hexo-renderer-stylus@2.0.1
+-- hexo-renderer-swig@1.1.0
+-- hexo-server@2.0.0

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "deploy": "gulp all && hexo generate --deploy",
    "serve": "hexo server"
  },
  "hexo": {
    "version": "5.3.0"
  },
  "devDependencies": {
    "hexo": "^5.2.0",
    "hexo-asset-pipeline": "^1.8.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-sitemap": "^2.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^3.3.0",
    "hexo-renderer-sass": "^0.4.0",
    "hexo-renderer-stylus": "^2.0.1",
    "hexo-renderer-swig": "^1.1.0",
    "hexo-server": "^2.0.0",
  }
}
Atulin commented 3 years ago

Activity

Atulin commented 3 years ago

Activity

Atulin commented 3 years ago

Activity

Yidi0213 commented 2 years ago

also curious about this :)

DeepSpaceHarbor commented 2 years ago

The BrowserSync plugin can watch the folder and reload the website if any of the files, including theme files, have changed.

stevenjoezhang commented 2 years ago

This may be related to the template engine used by the theme. Some engines have a "compile" process and the compiled cache may not be refreshed after a file change