New site misses theme css/img files

I am totally new to Hugo and use a Win7 machine with cygwin. I have go 1.5.3 installed and working with other Go apps.
I was able to install hugo from source and hugo version returns v0.16-DEV

I went through the following basic steps

  • hugo new site ./site
  • installed base16 in themes
  • created a new post with hugo new post/welcome.md
  • ran hugo server from the site folder

I notice that the theme should contribute img and css files but they’re missing from the public folder…
The result is a broken site without theme but working links…
My config.toml is below (fairly basic, baseURL is ignored by hugo server anyway)

languageCode = "en-us" title = "My base16 Hugo Site" theme = "base16"

I am running out of ideas… and might have omitted some fundamental step…
TIA

Could you please share a tree view of your site’s directory? It will help us debug the issue.

I just tried base16 with my blog using the 0.15 pre-compiled Windows binary and it worked.

Also try running the server using the --renderToDisk command, there are some issues with rendering from memory on some platforms.

Sorry one more edit: As far as I know hugo server does not create anything in the public directory by default. Just run hugo to generate the site and populate the public directory.

It could we a path issue re. Cygwin. Try to build your site from the regular cmd prompt in Windows.

Thank you for the responses! I had tried from a cmd box as well. Same result.

The tree under site is below
. |-archetypes |-content |---post |-data |-layouts |-public |---css |---img |---post |-----welcome |-static |-themes |---base16 |-----archetypes |-----images |-----layouts |-------_default |-------partials |-----static |-------css |-------img

output of hugo server -v is below
ERROR: 2016/04/13 19:58:39 hugo.go:401: No 'baseurl' set in configuration or as a flag. Features like page menus will not work without one. INFO: 2016/04/13 19:58:39 hugo.go:460: Using config file: C:\cygwin\home\P3300009\playground\hugo\site\config.toml INFO: 2016/04/13 19:58:39 hugo.go:572: using a UnionFS for static directory comprised of: INFO: 2016/04/13 19:58:39 hugo.go:573: Base: C:\cygwin\home\P3300009\playground\hugo\site\themes\base16\static INFO: 2016/04/13 19:58:39 hugo.go:574: Overlay: C:\cygwin\home\P3300009\playground\hugo\site\static\ INFO: 2016/04/13 19:58:39 hugo.go:606: syncing static files to C:\cygwin\home\P3300009\playground\hugo\site\ Started building site INFO: 2016/04/13 19:58:39 site.go:1248: found taxonomies: map[string]string{"tag":"tags", "category":"categories"} 0 draft content 0 future content 1 pages created 0 non-page files copied 0 paginator pages created 0 tags created 0 categories created in 36 ms Watching for changes in C:\cygwin\home\P3300009\playground\hugo\site\{data,content,layouts,static,themes} Serving pages from memory Web Server is available at http://localhost:1313 (bind address 127.0.0.1)

baseUrl error shouldn’t be the problem (https://github.com/spf13/hugo/issues/1421)

Problem seems that img and css remain empty

Just for fun, set baseURL in your config.

Can you also try this option when running the server?

Also, if you can try to start the server while standing on the head and sing the national anthem of Norway … :slight_smile: Sorry, couldn’t resist.

2 Likes

(windows 10 will soon support running Ubuntu shell inside it natively, not in a VM, which might be a nice alternative over cygwin)

baseUrl doesn’t seem to be the issue here (can be set to “bla” doesn’t matter as the issue above indicates)

–renderToDisk was interesting as I feel suspicious of the afero UnionFS thing on cygwin/windows but it didn’t help.

I have made progress by creating MANUALLY empty css and img directories under site/static to mirror the same directories in the theme from themes/base16/static

Now I can see the beautiful base16 on localhost:1313 but this seems to be an odd workaround. Not sure what happens here…

any more thoughts on this? cygwin/windows not supported or was a theme issue?
Just trying to understand.

It would be good if you could post a link to the source (GitHub?).

@bep I described the workaround which involves created the folders css and img from the theme - not sure how code helps here. See above my folder structure before manual creation of these directories… static is empty.

Can afero be the issue? Why do I have to create folders manually if there’s a union mount by afero? The union mount should have brought the two directories from the theme no?

You asked for advice, a site is easier to “spot the error” in compared to miles of copy-paste.

@anthonyfok could this issue be related to https://github.com/spf13/hugo/issues/1802

Quick recap: I create a simple config.toml and use the base16 theme. The theme comes with img and css. My site has an empty static directory.
I am using hugo v0.16-DEV and the afero version used is on commit 2f194a

Just wanted to say that this issue no longer occurs with version 0.17-DEV. Thanks all!