Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make use of Hugo's 0.56+ module feature. #29161

Merged
merged 5 commits into from
Aug 17, 2019
Merged

Make use of Hugo's 0.56+ module feature. #29161

merged 5 commits into from
Aug 17, 2019

Conversation

XhmikosR
Copy link
Member

@XhmikosR XhmikosR commented Jul 29, 2019

Need to make sure we don't have the dist folder copied locally before testing this.

Fixes #29142

@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch 2 times, most recently from af0cbc3 to a79e961 Compare July 29, 2019 11:36
@XhmikosR
Copy link
Member Author

@bep: I read the docs, but I'm probably missing something. Is this how modules are supposed to work or do we need Go installed for this too?

config.yml Outdated Show resolved Hide resolved
@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch from 0bc7b9d to 90dbf9c Compare July 30, 2019 07:00
config.yml Outdated Show resolved Hide resolved
@bep
Copy link
Contributor

bep commented Jul 30, 2019

This commit works with the unreleased (and unmerged) Hugo version: https://github.com/bep/bootstrap/commit/154417df22aa442b67e593aab0cf301a7f4cfc41

@XhmikosR
Copy link
Member Author

Nice! Can't wait to try it when the next version is out :)

BTW, just thinking out loud for the sake of flexibility. Wouldn't it be more flexible if one didn't have to add all mount points, but only the ones they want to use? I know our use case might not be the most common one, but still. Maybe I'm missing something, I'll play with it when the new version is out :)

@bep
Copy link
Contributor

bep commented Jul 31, 2019

didn't have to add all mount points, but only the ones they want to use? I

You only have to add the mounts you use. There are some superfluous mounts there now. (archetypes? i18n?), but I didn't know the project good enough to remove them.

@XhmikosR
Copy link
Member Author

Perfect, thanks! I'll play around with the branch when 0.56.3 is out and let you know if we hit any more issues.

@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch from 1ea0504 to 5d93b6d Compare July 31, 2019 13:36
@XhmikosR
Copy link
Member Author

@bep: I just gave this a go and works pretty good. Thanks for the fast fixes!

The only thing I noticed when playing around with SRI generation (I dropped the patch from this branch now though), and I had set another mount to assets/dist in order for me to use resources.Get, then we had another dist folder in publishDir/dist.

I'll make a branch for this later and see if we have any issues there.

@XhmikosR XhmikosR marked this pull request as ready for review July 31, 2019 13:42
config.yml Outdated Show resolved Hide resolved
@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch from 89b71d7 to 350408c Compare July 31, 2019 14:17
@XhmikosR
Copy link
Member Author

@bep: can you checkout this branch and do npm run docs-serve in one cmd and npm run watch-css-main in another? Hugo complains it can't find the file. I'm on Windows but @MartijnCuppens is on macOS and happens there too. Maybe the changes are too many or happen too fast and Hugo doesn't catch them?

If I change an HTML or markdown file and hugo rebuilds the site, then the error goes away.

@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch 3 times, most recently from 0edc0a3 to e877b53 Compare August 1, 2019 14:39
@mdo
Copy link
Member

mdo commented Aug 1, 2019

Confirming the npm scripts run for me, but at localhost:9001 I see file does not exist errors.

@MartijnCuppens
Copy link
Member

No file does not exist errors here. The docs css and js just don't appear in the dom, this a screenshot from the homepage where you should see the Bootstrap css:
image

Styles on the Netlify preview:
image

@XhmikosR
Copy link
Member Author

XhmikosR commented Aug 2, 2019

I definitely don't have the issue @MartijnCuppens mentions. I do have the same issue @mdo says above with watch. This doesn't happen for me on Windows without the mount changes.

@XhmikosR
Copy link
Member Author

XhmikosR commented Aug 2, 2019

In fact, I'm able to trigger the file not found error if I modify dist/css/bootstrap.css manually:

C:\Users\xmr\Desktop\bootstrap>npm run docs-serve

> [email protected] docs-serve C:\Users\xmr\Desktop\bootstrap
> hugo server --port 9001 --disableFastRender

Building sites …
                   | EN
+------------------+-----+
  Pages            | 105
  Paginator pages  |   0
  Non-page files   |  20
  Static files     | 125
  Processed images |   0
  Aliases          |  16
  Sitemaps         |   1
  Cleaned          |   0

Total in 792 ms
Watching for changes in C:\Users\xmr\Desktop\bootstrap\{dist,site}
Watching for config changes in C:\Users\xmr\Desktop\bootstrap\config.yml
Environment: "development"
Serving pages from memory
Web Server is available at http://localhost:9001/ (bind address 127.0.0.1)
Press Ctrl+C to stop

Change of Static files detected, rebuilding site.
2019-08-02 12:55:25.701 +0300
Syncing \css\bootstrap.css to C:\Users\xmr\Desktop\bootstrap\
ERROR 2019/08/02 12:55:25 file does not exist
ERROR 2019/08/02 12:55:25 file does not exist

@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch 2 times, most recently from 519888d to 40e5c79 Compare August 4, 2019 18:35
@XhmikosR XhmikosR force-pushed the master-xmr-hugo-2 branch 4 times, most recently from 1feafb1 to 893b77e Compare August 14, 2019 08:45
@XhmikosR
Copy link
Member Author

I think now we are ready to merge this. I tested it on Windows, no errors when watching.

Huge thanks to @bep for working towards fixing the bugs we found with mounts!

@XhmikosR
Copy link
Member Author

XhmikosR commented Aug 16, 2019

I need an approval @mdo @Johann-S @MartijnCuppens after you guys try this (make sure you do npm i and remove the old site/static/docs/4.3/dist folder locally)

Copy link
Member

@MartijnCuppens MartijnCuppens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works here!

@XhmikosR XhmikosR merged commit dd383ff into master Aug 17, 2019
@XhmikosR XhmikosR deleted the master-xmr-hugo-2 branch August 17, 2019 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

See if we can use Hugo v0.56's enhancements
4 participants