AmazingRise / hugo-theme-diary

Moments piled up. A Hugo theme ported from SumiMakito/hexo-theme-Journal.
MIT License
573 stars 196 forks source link

Error with running theme #18

Closed jenlky closed 4 years ago

jenlky commented 4 years ago

Describe the bug I set my config at the root directory as theme = "diary". When I run hugo server, it throws the error below.

To Reproduce

$ hugo server
Building sites … ERROR 2020/04/14 22:32:30 TOCSS: failed to transform "scss/dark-mode.scss" (text/x-scss): resource "scss/scss/dark-mode.scss_48b060fe05b0a273d182ef83c0605941" not found in file cache
Built in 32 ms
Error: Error building site: TOCSS: failed to transform "scss/journal.scss" (text/x-scss): resource "scss/scss/journal.scss_48b060fe05b0a273d182ef83c0605941" not found 
in file cache

Expected behavior The website should run properly.

Screenshots If applicable, add screenshots to help explain your problem. image

Environment Your Hugo version, generated from hugo version.

I downgraded my hugo version from v0.69.0 to v0.68.3:

Hugo Static Site Generator v0.68.3-157669A0 windows/amd64 BuildDate: 2020-03-24T12:04:36Z Chrome Version 80.0.3987.163 (Official Build) (64-bit)

Additional context Add any other context about the problem here.

AmazingRise commented 4 years ago

I've forgetten these compiled scss files, so only Hugo Extended can build it. Please clone the latest version, to see if there are any further problems.

Thanks for your support.

jenlky commented 4 years ago

For the benefit of other people, run git rm -rf themes/diary at root directory to remove the folder. Then run rm -rf .git/modules/themes/diary to remove it from git. Re-clone the version.

Install Hugo Extended. Re-run and it should works.

Thanks, it works now! 谢谢你那么快回答我!

AmazingRise commented 4 years ago

For the benefit of other people, run git rm -rf themes/diary at root directory to remove the folder. Then run rm -rf .git/modules/themes/diary to remove it from git. Re-clone the version.

Install Hugo Extended. Re-run and it should works.

Thanks, it works now! 谢谢你那么快回答我!

In fact, after the several files uploaded in the latest commit, it should work for normal Hugo as well, no need to install Hugo Extended. That's my mistake.

没关系,我也是刚好有空,感谢支持! :)

jordan-dlh commented 4 years ago

Hello, I have installed the latest commit from your beautiful theme and it still doesn't work with vanilla Hugo.

Building sites … ERROR 2020/04/25 12:49:49 TOCSS: failed to transform "scss/dark-mode.scss" (text/x-scss): resource "scss/scss/dark-mode.scss_48b060fe05b0a273d182ef83c0605941" not found in file cache
Built in 31 ms
Error: Error building site: TOCSS: failed to transform "scss/journal.scss" (text/x-scss): resource "scss/scss/journal.scss_48b060fe05b0a273d182ef83c0605941" not found in file cache

Apparently you forgot to push the assets at the root of the theme. When I copy /exampleSite/resources/ to /resources/ in your theme it works.

AmazingRise commented 4 years ago

Hello, I have installed the latest commit from your beautiful theme and it still doesn't work with vanilla Hugo.

Building sites … ERROR 2020/04/25 12:49:49 TOCSS: failed to transform "scss/dark-mode.scss" (text/x-scss): resource "scss/scss/dark-mode.scss_48b060fe05b0a273d182ef83c0605941" not found in file cache
Built in 31 ms
Error: Error building site: TOCSS: failed to transform "scss/journal.scss" (text/x-scss): resource "scss/scss/journal.scss_48b060fe05b0a273d182ef83c0605941" not found in file cache

Apparently you forgot to push the assets at the root of the theme. When I copy /exampleSite/resources/ to /resources/ in your theme it works.

Should it be ./themes/diary/resources/_gen/assets/scss/, rather than ./themes/diary/exampleSite/resources/_gen/assets/scss/? I will fix it later, thanks for your feedback.

jordan-dlh commented 4 years ago

Yes this is what I did to make it work. If I understand correctly (but I'm new to hugo), ./themes/<theme>/resources/ is where hugo looks for pregenerated assets. See https://discourse.gohugo.io/t/should-i-use-hugo-extended-for-a-new-hugo-project/13954/5 and https://discourse.gohugo.io/t/why-does-hugo-create-the-resources-directory/13021/2

Thank you for your work :-)

AmazingRise commented 4 years ago

Yes this is what I did to make it work. If I understand correctly (but I'm new to hugo), ./themes/<theme>/resources/ is where hugo looks for pregenerated assets. See https://discourse.gohugo.io/t/should-i-use-hugo-extended-for-a-new-hugo-project/13954/5 and https://discourse.gohugo.io/t/why-does-hugo-create-the-resources-directory/13021/2

Thank you for your work :-)

OK, I've uploaded them to master branch. Thank you very much.