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

[Preview] 2.x hugo module #144

Closed
wants to merge 15 commits into from
Closed

[Preview] 2.x hugo module #144

wants to merge 15 commits into from

Conversation

zetxek
Copy link
Owner

@zetxek zetxek commented Jan 20, 2025

Loading the theme as a hugo module instead of git submodule.
Locally, I get a working version:

image
➜  adritian-demo git:(demo-2.x-hugo-module) ✗ hugo serve
Watching for changes in /Users/adrianmorenopena/Projects/adritian-demo/{archetypes,assets,content,layouts,package.json,postcss.config.js,static}
Watching for config changes in /Users/adrianmorenopena/Projects/adritian-demo/hugo.toml, /Users/adrianmorenopena/Projects/adritian-demo/go.mod
Start building sites …
hugo v0.140.0+extended+withdeploy darwin/arm64 BuildDate=2024-12-17T14:20:55Z VendorInfo=brew

WARN  found no layout file for "html" for kind "page": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "section": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "home": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN  found no layout file for "html" for kind "term": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.

                   | EN | ES | FR
-------------------+----+----+-----
  Pages            | 12 |  6 |  5
  Paginator pages  |  0 |  0 |  0
  Non-page files   |  0 |  0 |  0
  Static files     |  3 |  3 |  3
  Processed images |  0 |  0 |  0
  Aliases          |  1 |  0 |  0
  Cleaned          |  0 |  0 |  0

Built in 29 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

The vercel preview URL doesn't seem to work yet, though. Checking...

Copy link

vercel bot commented Jan 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
adritian-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 22, 2025 1:18pm

@zetxek
Copy link
Owner Author

zetxek commented Jan 20, 2025

The error in Vercel is:

Error: failed to load modules: failed to download modules: binary with name "go" not found in PATH
Error: Command "echo VERCEL_URL=$VERCEL_URL ; hugo --minify --baseURL="https://$VERCEL_URL/"" exited with 1

It seems to be related with the build image 🤔

@zetxek
Copy link
Owner Author

zetxek commented Jan 20, 2025

golang is not available out of the box in vercel - it needs to be installed, via the installCommand https://vercel.com/docs/deployments/build-image/build-image

@zetxek
Copy link
Owner Author

zetxek commented Jan 20, 2025

After ed4bd2e, the error is the same as locally:

[21:58:15.548] Running build in Washington, D.C., USA (East) – iad1
[21:58:15.639] Cloning github.com/zetxek/adritian-demo (Branch: demo-2.x-hugo-module, Commit: ed4bd2e)
[21:58:16.030] Cloning completed: 391.086ms
[21:58:16.892] Restored build cache from previous deployment (JGXgwwkJmecVn7nusoGjrgsJn8sN)
[21:58:16.969] Running "vercel build"
[21:58:17.415] Vercel CLI 39.3.0
[21:58:18.015] Installing Hugo version 0.141.0
[21:58:18.660] Running "install" command: `dnf -y install golang ; npm i -D postcss postcss-cli autoprefixer  `...
[21:58:18.820] Failed to set locale, defaulting to C.UTF-8
[21:58:19.534] Amazon Linux 2023 repository                     40 MB/s |  20 MB     00:00    
[21:58:23.120] Last metadata expiration check: 0:00:04 ago on Mon Jan 20 14:58:19 2025.
[21:58:23.534] Dependencies resolved.
[21:58:23.546] ================================================================================
[21:58:23.546]  Package         Arch        Version                     Repository        Size
[21:58:23.546] ================================================================================
[21:58:23.546] Installing:
[21:58:23.546]  golang          x86_64      1.20.8-1.amzn2023.0.1       amazonlinux      599 k
[21:58:23.546] Installing dependencies:
[21:58:23.546]  golang-bin      x86_64      1.20.8-1.amzn2023.0.1       amazonlinux       58 M
[21:58:23.546]  golang-src      noarch      1.20.8-1.amzn2023.0.1       amazonlinux       11 M
[21:58:23.546] 
[21:58:23.546] Transaction Summary
[21:58:23.546] ================================================================================
[21:58:23.546] Install  3 Packages
[21:58:23.547] 
[21:58:23.547] Total download size: 69 M
[21:58:23.547] Installed size: 204 M
[21:58:23.548] Downloading Packages:
[21:58:23.694] (1/3): golang-1.20.8-1.amzn2023.0.1.x86_64.rpm   15 MB/s | 599 kB     00:00    
[21:58:23.761] (2/3): golang-src-1.20.8-1.amzn2023.0.1.noarch.  99 MB/s |  11 MB     00:00    
[21:58:24.127] (3/3): golang-bin-1.20.8-1.amzn2023.0.1.x86_64. 122 MB/s |  58 MB     00:00    
[21:58:24.129] --------------------------------------------------------------------------------
[21:58:24.129] Total                                           119 MB/s |  69 MB     00:00     
[21:58:24.697] Running transaction check
[21:58:24.707] Transaction check succeeded.
[21:58:24.709] Running transaction test
[21:58:25.564] Transaction test succeeded.
[21:58:25.564] Running transaction
[21:58:26.148]   Running scriptlet: golang-1.20.8-1.amzn2023.0.1.x86_64                    1/1 
[21:58:26.900]   Preparing        :                                                        1/1 
[21:58:26.960]   Installing       : golang-src-1.20.8-1.amzn2023.0.1.noarch                1/3 
[21:58:27.643]   Installing       : golang-1.20.8-1.amzn2023.0.1.x86_64                    2/3 
[21:58:27.645]   Installing       : golang-bin-1.20.8-1.amzn2023.0.1.x86_64                3/3 
[21:58:29.347]   Running scriptlet: golang-bin-1.20.8-1.amzn2023.0.1.x86_64                3/3 
[21:58:29.347]   Verifying        : golang-bin-1.20.8-1.amzn2023.0.1.x86_64                1/3 
[21:58:29.347]   Verifying        : golang-1.20.8-1.amzn2023.0.1.x86_64                    2/3 
[21:58:29.371]   Verifying        : golang-src-1.20.8-1.amzn2023.0.1.noarch                3/3 
[21:58:29.371] 
[21:58:29.371] Installed:
[21:58:29.372]   golang-1.20.8-1.amzn2023.0.1.x86_64                                           
[21:58:29.372]   golang-bin-1.20.8-1.amzn2023.0.1.x86_64                                       
[21:58:29.372]   golang-src-1.20.8-1.amzn2023.0.1.noarch                                       
[21:58:29.372] 
[21:58:29.372] Complete!
[21:58:30.326] npm warn idealTree Removing dependencies.postcss in favor of devDependencies.postcss
[21:58:30.327] npm warn idealTree Removing dependencies.postcss-cli in favor of devDependencies.postcss-cli
[21:58:31.333] 
[21:58:31.334] changed 13 packages, and audited 123 packages in 2s
[21:58:31.334] 
[21:58:31.334] 34 packages are looking for funding
[21:58:31.334]   run `npm fund` for details
[21:58:31.335] 
[21:58:31.335] found 0 vulnerabilities
[21:58:31.498] VERCEL_URL=adritian-demo-7ypa6b78l-adrianmoreno.vercel.app
[21:58:33.533] hugo: downloading modules …
[21:58:34.930] WARN  Failed to read module config for "github.com/zetxek/adritian-free-hugo-theme" in "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/zetxek/adritian-free-hugo-theme@v1.4.27-0.20250120122236-25d7837ed4e8/theme.toml": "_stream.toml:1:1": unmarshal failed: toml: key min_version is already defined
[21:58:34.932] hugo: collected modules in 3398 ms
[21:58:34.932] Start building sites … 
[21:58:34.932] hugo v0.141.0-e7bd51698e5c3778a86003018702b1a7dcb9559a+extended linux/amd64 BuildDate=2025-01-16T13:11:18Z VendorInfo=gohugoio
[21:58:34.932] 
[21:58:37.186] ERROR TOCSS: failed to transform "/scss/adritian.scss" (text/x-scss): "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/zetxek/adritian-free-hugo-theme@v1.4.27-0.20250120122236-25d7837ed4e8/assets/scss/bootstrap/_mixins.scss:6:1": File to import not found or unreadable: vendor/rfs.
[21:58:37.186] Total in 5656 ms
[21:58:37.186] Error: error building site: TOCSS: failed to transform "/scss/adritian.scss" (text/x-scss): "/tmp/hugo_cache/modules/filecache/modules/pkg/mod/github.com/zetxek/adritian-free-hugo-theme@v1.4.27-0.20250120122236-25d7837ed4e8/assets/scss/bootstrap/_mixins.scss:6:1": File to import not found or unreadable: vendor/rfs.
[21:58:37.194] Error: Command "echo VERCEL_URL=$VERCEL_URL ; hugo --minify --baseURL="https://$VERCEL_URL/"" exited with 1
[21:58:37.364] 

Mentioned also in zetxek/adritian-free-hugo-theme#165 (comment) - as it seems to be theme/module related.

With  hugo mod get -u github.com/zetxek/adritian-free-hugo-theme@6c3d6284df0394e4274fee674c4ad0d9aed73f0b
@zetxek
Copy link
Owner Author

zetxek commented Jan 22, 2025

This is deploying now as it renders locally: empty.

in https://adritian-demo-iad6g4bst-adrianmoreno.vercel.app/
image

and locally, same:
image

@zetxek
Copy link
Owner Author

zetxek commented Jan 22, 2025

Solved in 5344b5c 🎉

There was a configuration file missing! (homepage.yml)

image

@zetxek
Copy link
Owner Author

zetxek commented Jan 25, 2025

Closing as in the end bootstrap will be included.

@zetxek zetxek closed this Jan 25, 2025
@zetxek zetxek deleted the demo-2.x-hugo-module branch February 6, 2025 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant