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

exampleSite: use go workspace pointing to local hinode clone #769

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

deining
Copy link
Contributor

@deining deining commented Feb 12, 2024

This PR was motivated from the experiences as described in #768: When I tried to run the example site, I found me confronted with an infinite loop while fetching dependencies. This PR resolves this issue by introducing a go workspace when running the example site. With this PR in place, you can change to the exampleSite dir and start the preview via:

hugo server

Copy link

netlify bot commented Feb 12, 2024

Deploy Preview for gethinode-demo ready!

Name Link
🔨 Latest commit b7581d5
🔍 Latest deploy log https://app.netlify.com/sites/gethinode-demo/deploys/65d673a424e3230008e5c646
😎 Deploy Preview https://deploy-preview-769--gethinode-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🟢 up 7 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (🔴 down 7 from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@markdumay markdumay added the enhancement New feature or request label Feb 13, 2024
@markdumay
Copy link
Collaborator

Thanks for your PR @deining, it looks like a more elegant solution. However, when validating the changes on my local machine, I wasn't able to render the example site properly. It works if I set purge to false, however, it fails to safelist the selected stylesheets otherwise. See the following configuration in exampleSite/config/_default/params.toml:

[style]
    purge = true

Hinode uses config/postcss.config.js to configure the CSS purge. It puts multiple files on the safe list, including several files that are vendored. What would be the correct workspace configuration to include the vendored files?

@markdumay markdumay added the invalid This doesn't seem right label Feb 13, 2024
@deining deining force-pushed the hugo-workspace branch 4 times, most recently from bf34eb8 to cac40b7 Compare February 21, 2024 21:51
@deining
Copy link
Contributor Author

deining commented Feb 21, 2024

With PR #786 merged, the infinite loop problem disappeared 😄.
This motivated me to revisit my PR and I eventually got it working.
With this PR in place, you can now start the preview via:

cd exampleSite
hugo mod vendor
hugo server

I find this approach more natural than running the exampleSite from repo root via hugo server -s exampleSite.

With this PR merged, npm run statements inside package.json will need some rework, I leave this as minor task to you.

@markdumay
Copy link
Collaborator

Thanks, it looks like a great improvement. However, when running this locally, I get the following error:

Error: command error: failed to load modules: invalid modules list: "[..]/gethinode/hinode/exampleSite/_vendor/modules.txt"

The content of [..]/gethinode/hinode/exampleSite/_vendor/modules.txt is the following:

# github.com/gethinode/hinode 
# github.com/gethinode/mod-bootstrap v1.2.2
# github.com/twbs/bootstrap v5.3.2+incompatible
# github.com/gethinode/mod-flexsearch v1.9.0
# github.com/nextapps-de/flexsearch v0.0.0-20240110101704-4c3966709f85
# github.com/gethinode/mod-fontawesome v1.8.1
# github.com/gethinode/mod-utils/v2 v2.1.1
# github.com/gethinode/mod-katex v1.0.5
# github.com/gethinode/mod-leaflet v1.0.0
# github.com/gethinode/mod-lottie v1.4.3
# github.com/airbnb/lottie-web v5.12.2+incompatible

Tested with the following environment:

hugo v0.123.2-929b91fe75cb0d041f22b4707700dfc117115ad4+extended darwin/arm64 BuildDate=2024-02-22T15:27:15Z VendorInfo=brew
GOOS="darwin"
GOARCH="arm64"
GOVERSION="go1.22.0"
github.com/sass/libsass="3.6.5"
github.com/webmproject/libwebp="v1.3.2"
github.com/sass/dart-sass/protocol="2.5.0"
github.com/sass/dart-sass/compiler="1.71.1"
github.com/sass/dart-sass/implementation="1.71.1"

@markdumay markdumay merged commit d1ef577 into gethinode:main Feb 23, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants