Do I need npm for css and javascript to work with hugo server?
I have my custom css and js located in my assets folder.
In my partial header, I linked the css like this and same for js
{{ if eq .Page.Section “blog”}}
{{ $style := resources.Get “blog.css” | minify | fingerprint }}
{{ end }}
When I load hugo server, I noticed the css isn’t coming through. The root link is pointed to localhost
I don’t know if this matters but in my config, I have baseURL set to “/”
@ju52 Thanks for your response. The only way I was able to get it to work was by generating the css code within the header itself rather than linking it to a file within assets folder. I can try your code to see if it will link up. Thanks fo the help
{{ if eq .Page.Section "blog"}} {{ with resources.Get "custom.css" | resources.Minify | resources.Fingerprint}} <style>{{ .Content | safeCSS }}</style> {{ end }} {{ end }}