McShelby / hugo-theme-relearn

A theme for Hugo designed for documentation
https://mcshelby.github.io/hugo-theme-relearn/
MIT License
377 stars 177 forks source link

Theme: Unable to Build - Permission Errors #792

Closed vincentmaule closed 6 months ago

vincentmaule commented 6 months ago

Hello, I am attempting to build a site. I have followed the steps & receive the error below:

[User@Machine:~/Folder]$ cat hugo.toml 
baseURL = 'https://site'
languageCode = 'en-us'
title = ''
theme = "hugo-theme-relearn"

[outputs]
  home = ['html', 'rss', 'search', 'searchpage']

[module]
[[module.imports]]
    path = 'github.com/McShelby/hugo-theme-relearn'

[params]
  description = ''
  disableNextPrev = true

[[params.themeVariant]]
    auto = ['zen-light', 'zen-dark']
    identifier = 'zen-auto'
    name = 'Zen Light/Dark'

[User@Machine:~/Folder]$ hugo --noChmod
Start building sites … 
hugo v0.120.3+extended linux/amd64 BuildDate=unknown VendorInfo=nixpkgs

ERROR Failed to publish Resource: open /public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /public/css/theme-relearn-dark.css: permission denied
Total in 228 ms
Error: error building site: logged 2 error(s)

I did try a few ideas from this issue but no luck.


Edit 1

Added new line between both commands ran.

McShelby commented 6 months ago

i did try a few ideas from this https://github.com/McShelby/hugo-theme-relearn/issues/734 but no luck.

As --noChmod doesn't seem to work, did you also try to configure themeVariantModifier in your hugo.toml?

What's your host environment?

vincentmaule commented 6 months ago

i did try a few ideas from this https://github.com/McShelby/hugo-theme-relearn/issues/734 but no luck.

As --noChmod doesn't seem to work, did you also try to configure themeVariantModifier in your hugo.toml?

What's your host environment?

  1. Did I configure the themeVariantModifier incorrectly in my hugo.toml file?
  2. Currently running NixOS, attempting to build for Prod.
McShelby commented 6 months ago
  1. Did I configure the themeVariantModifier incorrectly in my hugo.toml file?

Without seeing your source code, it's impossible to say. At least your example above doesn't have it.

  1. Currently running NixOS, attempting to build for Prod.

Is this your own server?

vincentmaule commented 6 months ago
  1. Did I configure the themeVariantModifier incorrectly in my hugo.toml file?

Without seeing your source code, it's impossible to say. At least your example above doesn't have it.

I'm new when it comes to the Hugo Config file, is the themeVariantModifier [params] placed in the wrong place at the end of my hugo.toml file?

Excerpt from first message:

...
[module]
[[module.imports]]
    path = 'github.com/McShelby/hugo-theme-relearn'

[params]
  description = ''
  disableNextPrev = true

[[params.themeVariant]]
    auto = ['zen-light', 'zen-dark']
    identifier = 'zen-auto'
    name = 'Zen Light/Dark'

[User@Machine:~/Folder]$ hugo --noChmod
Start building sites … 
....

I followed Relearn Configuration & didn't see if was supposed to go after or before [module]/[outputs]; please share an example if there is a specific structure?

  1. Currently running NixOS, attempting to build for Prod.

Is this your own server?

Yes, I will attempt to build on a different device after business hours.

McShelby commented 6 months ago

Please search for themeVariantModifier in the docs. Two occurences on the same page - the second including explaination.

vincentmaule commented 6 months ago

Please search for themeVariantModifier in the docs. Two occurences on the same page - the second including explaination.

Thank you for you patience! Same issue unfortunately with suffix added.

[User@Machine:~/Folder]$ cat hugo.toml 
baseURL = 'https://site'
languageCode = 'en-us'
title = ''
theme = "hugo-theme-relearn"
themeVariantModifier = ".css"

[outputs]
  home = ['html', 'rss', 'search', 'searchpage']

[module]
[[module.imports]]
    path = 'github.com/McShelby/hugo-theme-relearn'

[params]
  description = ''
  disableNextPrev = true

[[params.themeVariant]]
    auto = ['zen-light', 'zen-dark']
    identifier = 'zen-auto'
    name = 'Zen Light/Dark'

[User@Machine:~/Folder]$ hugo --noChmod
Start building sites … 
hugo v0.120.3+extended linux/amd64 BuildDate=unknown VendorInfo=nixpkgs

ERROR Failed to publish Resource: open /home/architect/hugo_sites/docs_fish-maule_com/public/css/theme-relearn-light.css: permission denied
ERROR Failed to publish Resource: open /home/architect/hugo_sites/docs_fish-maule_com/public/css/theme-relearn-dark.css: permission denied
Total in 248 ms
Error: error building site: logged 2 error(s)

Is there a cache that Hugo uses when building?

McShelby commented 6 months ago

The themeVariantModifier must go into the [params] section.

vincentmaule commented 6 months ago

Working now... Thank you again very much for the patience here.

vincentmaule commented 6 months ago

Created a discussion for this topic here: https://github.com/McShelby/hugo-theme-relearn/discussions/794.

dahlsailrunner commented 5 months ago

This is a closed issue (which is fine) but I posted a note on the discussion above since I haven't been able to find a solution other than staying on Hugo v 0.122.0.