netlify-templates / victor-hugo

Victor Hugo is a Hugo boilerplate for creating truly epic websites!
MIT License
1.53k stars 379 forks source link

npm start doesn't work correctly with themes #166

Open alexpov opened 5 years ago

alexpov commented 5 years ago

When trying to use victor-hugo with themes, and running the npm start script as stated in the guide. Getting a site with broken CSS.

Tried to use the starta theme based on this tutorial: A Step-by-Step Guide: Victor-Hugo on Netlify and the tranquilpeak theme.

The npm run build command works well. When the site is deployed to netlify, all is good. The issue is only in the local dev environment.

When setting the baseURL from / to https://mydomain.com the issue seems to be resolved, however, all links are relative to https://mydomain.com thus each click opens the deployed version and not the localhost version

As a workaround, using hugo server -D command from the site folder

Hugo version: 0.5.4

tomanistor commented 5 years ago

Same issue here. I've had luck with using npm run preview instead of npm start during local development.

erquhart commented 5 years ago

If someone can dig in and get a fix together I'm happy to review and merge.

aguywithcode commented 5 years ago

I receive a bunch of "function hugo not defined when running npm start or npm run preview when using a theme

ERROR 2019/05/30 00:26:18 Failed to add template "404.html" in path "404.html": template: 404.html:49: function "hugo" not defined ERROR 2019/05/30 00:26:18 Failed to add template "_default/list.html" in path "_default/list.html": template: _default/list.html:49: function "hugo" not defined ERROR 2019/05/30 00:26:18 Failed to add template "_default/single.html" in path "_default/single.html": template: _default/single.html:49: function "hugo" not defined ERROR 2019/05/30 00:26:18 Failed to add template "index.html" in path "index.html": template: index.html:49: function "hugo" not defined

sugaroverflow commented 5 years ago

I'm also seeing a bunch of Failed to add template... function "hugo" not defined" as well while trying to use a theme. Same with npm run preview

using hugo server -D command from the site folder works

aaronkwhite-sh commented 4 years ago

Any update on this? Having the same problem using themes, it looks like webpack is somehow running the non-extended version of hugo (thus not building the themes sass), but I have extended installed via Homebrew and running hugo server/build works fine.