Giter VIP home page Giter VIP logo

Comments (11)

TikkunCreation avatar TikkunCreation commented on June 16, 2024

Here's the successfully working version using git submodules, rather than hugo submodules.

# Create a new Hugo site
hugo new site gitsubmodule3

# Navigate to the newly created site's directory
cd gitsubmodule3

# Initialize git in the directory
git init

# Add the git submodule for the theme
git submodule add -b stable https://github.com/jpanther/congo.git themes/congo

# Remove the hugo.toml file
rm hugo.toml

# Copy the theme's config files to the site's config directory
mkdir -p config/_default
cp themes/congo/config/_default/*.toml config/_default

# Add the theme name to the config file
echo 'theme = "congo"' > temp
cat config/_default/config.toml >> temp
mv temp config/_default/config.toml

# Create a new post
hugo new posts/_index.md

# Set the post to not be a draft and add a title
sed -i '' 's/draft: true/draft: false/g' content/posts/_index.md
echo -e "\n\n# Home" >> content/posts/_index.md

# Start the Hugo server
hugo server

And the corresponding zsh one liner

hugo new site gitsubmodule5 && cd gitsubmodule5 && git init && git submodule add -b stable https://github.com/jpanther/congo.git themes/congo && rm hugo.toml && mkdir -p config/_default && cp themes/congo/config/_default/*.toml config/_default && echo 'theme = "congo"' > temp && cat config/_default/config.toml >> temp && mv temp config/_default/config.toml && hugo new posts/_index.md && sed -i '' 's/draft: true/draft: false/g' content/posts/_index.md && echo -e "\n\n# Home" >> content/posts/_index.md && hugo server

from congo.

TikkunCreation avatar TikkunCreation commented on June 16, 2024

Hm. As an update, I tried this on my other machine and was unable to replicate the issue.

I used this command on my other machine:

arch -arm64 hugo new site retesthugomod && cd retesthugomod && arch -arm64 hugo mod init retesthugomod && arch -arm64 go mod tidy && mkdir -p config/_default && echo "[[imports]]\npath = \"github.com/jpanther/congo/v2\"" > config/_default/module.toml && curl -L --output config/_default/config.toml https://raw.githubusercontent.com/jpanther/congo/stable/config/_default/config.toml && curl -L --output config/_default/languages.en.toml https://raw.githubusercontent.com/jpanther/congo/stable/config/_default/languages.en.toml && curl -L --output config/_default/markup.toml https://raw.githubusercontent.com/jpanther/congo/stable/config/_default/markup.toml && curl -L --output config/_default/menus.en.toml https://raw.githubusercontent.com/jpanther/congo/stable/config/_default/menus.en.toml && curl -L --output config/_default/params.toml https://raw.githubusercontent.com/jpanther/congo/stable/config/_default/params.toml && rm hugo.toml && arch -arm64 hugo new posts/_index.md && sed -i '' 's/draft: true/draft: false/g' content/posts/_index.md && echo -e "\n\n# Home" >> content/posts/_index.md && arch -arm64 hugo server

Any suggestions as to how to debug the issue?

from congo.

jpanther avatar jpanther commented on June 16, 2024

Thanks for the issue report, @TikkunCreation. I wonder if this is because Hugo is caching the module and so it's not updating it correctly when you re-run your script. Have you tried using the command hugo mod clean instead of tidy to see if this helps?

from congo.

TikkunCreation avatar TikkunCreation commented on June 16, 2024

Thanks for the issue report, @TikkunCreation. I wonder if this is because Hugo is caching the module and so it's not updating it correctly when you re-run your script. Have you tried using the command hugo mod clean instead of tidy to see if this helps?

You are 100% correct. Doing the following fixed the issue (and as expected it fixed it across all my congo sites, not just the one in the current directory):

hugo mod clean
hugo serve

I'm going to leave this issue open in case you want to add anything to the docs, or any kind of fix to detect when this is happening. Feel free to close it at your preference.

from congo.

github-actions avatar github-actions commented on June 16, 2024

This issue has been automatically marked as stale because it has not had any recent activity.
If you are still experiencing this issue, please review the issue history and add a reply with any requested and/or additional information in order to keep the issue open.
This issue will automactically close in 14 days if no further activity occurs.

from congo.

TikkunCreation avatar TikkunCreation commented on June 16, 2024

This issue recurs frequently. It is always solvable with hugo mod clean

It may be good to add that to the docs somewhere.

from congo.

github-actions avatar github-actions commented on June 16, 2024

This issue has been automatically marked as stale because it has not had any recent activity.
If you are still experiencing this issue, please review the issue history and add a reply with any requested and/or additional information in order to keep the issue open.
This issue will automatically close in 14 days if no further activity occurs.

from congo.

jpanther avatar jpanther commented on June 16, 2024

Where would you look for this information in the docs if you had this issue? Would it make sense to add a comment in the installation section? Or does it make more sense in deployment? It is briefly referenced in the upgrade guide but it's not the most obvious place to find it if you're coming to Congo as a new user.

from congo.

TikkunCreation avatar TikkunCreation commented on June 16, 2024

I'm not sure, I'd likely:

google 'hugo 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.'

google 'hugo congo 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.'

(without quotes)

And hope that it comes up from that. With issues I generally don't browse in the docs, I'll trust that a keyword search will surface it

from congo.

jpanther avatar jpanther commented on June 16, 2024

That's what I would do too. I think the issue here is largely to do with how the hugo mod command works as really it should be cleaning up as it goes if it ends up causing issues like this.

from congo.

jpanther avatar jpanther commented on June 16, 2024

I've now made an update to the docs to reference the hugo mod clean command (29f7bb8) so I'm going to close off this issue.

from congo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.