hugo-toha / toha

A Hugo theme for personal portfolio
https://hugo-toha.github.io
MIT License
1.05k stars 607 forks source link

Fails set-up local development environment #878

Closed yanboyang713 closed 10 months ago

yanboyang713 commented 10 months ago

Question

I followed the README and set up my local development.

But I got an error when I ran go mod tidy:

yanboyang713@Meta-Scientific-Linux ~/personalblog (git)-[main] % go mod tidy
go: errors parsing go.mod:
go.mod:8:5: replace github.com/yanboyang713/toha: version "v0.0.0-20240201123906-c152a8f852b9" invalid: go.mod has post-v0 module path "github.com/hugo-toha/toha/v4" at revision c152a8f852b9

Everyone knows the reason why.

yanboyang713@Meta-Scientific-Linux ~/personalblog (git)-[main] % cat go.mod
module github.com/hugo-toha/hugo-toha.github.io

go 1.19

require github.com/hugo-toha/toha/v4 v4.1.1

replace(
    github.com/hugo-toha/toha/v4 => github.com/yanboyang713/toha main
)
# Use Hugo modules to add theme
module:
  imports:
  - path: github.com/hugo-toha/toha/v4
  mounts:
  - source: static/files
    target: static/files
  - source: ./node_modules/flag-icon-css/flags
    target: static/flags
  - source: ./node_modules/@fontsource/mulish/files
    target: static/files
  - source: ./node_modules/katex/dist/fonts
    target: static/fonts

Thanks for your help.

hossainemruz commented 10 months ago

Look like you are missing /v4 in the replace directive. Can you please try changing this in your go.mod file:

replace(
    github.com/hugo-toha/toha/v4 => github.com/yanboyang713/toha main
)

with

replace(
    github.com/hugo-toha/toha/v4 => github.com/yanboyang713/toha/v4 main
)
yanboyang713 commented 10 months ago

Hello @hossainemruz,

Thanks so much. Resolved.