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

Website doesn't build with latest version of hugo #495

Open
j-wags opened this issue Dec 9, 2024 · 3 comments
Open

Website doesn't build with latest version of hugo #495

j-wags opened this issue Dec 9, 2024 · 3 comments

Comments

@j-wags
Copy link
Member

j-wags commented Dec 9, 2024

Using the latest hugo (0.139) the website won't build locally.

(hugo) jw@mba$ hugo server -D
Watching for changes in /Users/jeffreywagner/projects/OpenForceField/openforcefield.org/{archetypes,content,data,static,themes}
Watching for config changes in /Users/jeffreywagner/projects/OpenForceField/openforcefield.org/config.toml
Start building sites … 
hugo v0.139.3+extended darwin/amd64 BuildDate=unknown VendorInfo=conda-forge

Built in 49 ms
Error: error building site: assemble: failed to resolve media type for "mmark"

Unfortunately, I'm having trouble finding how to brew install old versions of hugo, so this is blocking local rendering of the website on macs.

I think the ultimate solution shouldn't be downpinning anyway. We may want to use the goldmark package as a replacement for mmark, or pre-render the mmark-dependent pages so the content that they needed to compile at build-time is instead pre-built and stored statically.

@mattwthompson
Copy link
Member

mattwthompson commented Dec 9, 2024

Apologies for seemingly not documenting this, I ran into this a while back and must have forgotten to publicize notes

It's hardcoded:

HUGO_VERSION: 0.108.0

Homebrew has some support for installing older versions of packages, but this one isn't accessible with brew install [email protected]. I don't know why. They let you install from a file, however, and with some patience it's all in their git tree

$ # might need to brew uninstall hugo / brew unlink hugo
$ wget -q https://raw.githubusercontent.com/Homebrew/homebrew-core/540f972c30e180aaa8f13ac6a9027d3530d28049/Formula/hugo.rb
$ brew install hugo.rb
==> Downloading https://formulae.brew.sh/api/formula.jws.json
###################################################################################### 100.0%
==> Downloading https://formulae.brew.sh/api/cask.jws.json
###################################################################################### 100.0%
Error: Failed to load cask: hugo.rb
Cask 'hugo' is unreadable: wrong constant name #<Class:0x0000000130d2b9b0>
Warning: Treating hugo.rb as a formula.
==> Downloading https://ghcr.io/v2/homebrew/core/hugo/manifests/0.108.0
Already downloaded: /Users/mattthompson/Library/Caches/Homebrew/downloads/74f35ad8cc797470943b3bc41d818178c6d835b07360379570023a08601237dd--hugo-0.108.0.bottle_manifest.json
==> Fetching hugo
==> Downloading https://ghcr.io/v2/homebrew/core/hugo/blobs/sha256:dc5e7b466bba95d38e23c69f97
###################################################################################### 100.0%
Warning: hugo 0.139.3 is available and more recent than version 0.108.0.
==> Pouring hugo--0.108.0.ventura.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/hugo/0.108.0: 49 files, 57.9MB
==> Running `brew cleanup hugo`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Removing: /Users/mattthompson/Library/Caches/Homebrew/hugo--0.108.0... (17.6MB)
$ hugo server -D
Start building sites …
hugo v0.108.0+extended darwin/amd64 BuildDate=unknown

                   | EN
-------------------+------
  Pages            | 606
  Paginator pages  |  46
  Non-page files   | 318
  Static files     |  38
  Processed images |   0
  Aliases          | 231
  Sitemaps         |   1
  Cleaned          |   0

Built in 22760 ms
Watching for changes in /Users/mattthompson/software/openforcefield.org/{archetypes,content,data,static,themes}
Watching for config changes in /Users/mattthompson/software/openforcefield.org/config.toml
Environment: "development"
Serving pages from memory
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

20+ second build time is pretty bad, but hey, it works

@mattwthompson
Copy link
Member

cc: @jaclark5 for your information

@jaclark5
Copy link
Contributor

jaclark5 commented Dec 9, 2024

@mattwthompson that worked, thank you! I tried something similar with version 0.109.0 and it didn't work.

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

No branches or pull requests

3 participants