Coder Social home page Coder Social logo

Comments (11)

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

Hi, did you figure out a way to do this? It seems useful. Based on https://gohugo.io/content-management/multilingual/#configure-multilingual-multihost, it seems the baseURL can be set per language. Without having personally tested it, it seems like a plausible solution.

from etch.

FHEK789 avatar FHEK789 commented on June 21, 2024

Hey, yeah I also found that documentation, but if I understood it correctly I need two domains for that to work, is that right? I wanted a simple way to make it point to baseURL/pt-br like it's with menus...

from etch.

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

I just tried this out, it seems to work ok to set baseURL to have the same domain but different paths.

[languages]
  [languages.en]
    baseURL = "https://example.com"
    title = "Website Name"
    weight = 1
  [languages.fr]
    baseURL = "https://example.com/fr/"
    title = "Website Name in French"
    weight = 2

Although there was a problem with the CSS not loading on the French version when running in development mode (hugo server). Development mode is broken for the French language site because it runs each language on a separate port, but uses the absolute /css/styles.min.css path for all sites. There shouldn't be any problems with a site generated through hugo, but I'll have to look into fixing this development path issue.

from etch.

FHEK789 avatar FHEK789 commented on June 21, 2024

yeah I had the same problem with the css, I tried using it on production and did not work as well, is there anyway to fix that?

from etch.

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

One way to fix this is to change $css.RelPermalink to $css.Permalink at

{{ printf `<link rel="stylesheet" href="%s">` $css.RelPermalink | safeHTML }}
. I don't think this is the "correct" fix for this problem, but it should work fine as a quick way to get things working.

from etch.

FHEK789 avatar FHEK789 commented on June 21, 2024

How can I ship this change to the theme in my website?

from etch.

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

From the directory containing your site files, edit the file at themes/etch/layouts/partials/head.html to make the change above, then rebuild your site with hugo.

from etch.

FHEK789 avatar FHEK789 commented on June 21, 2024

Sure but then I'm editing your repo because it's added as a git submodule

from etch.

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

You are only editing your copy of this repo.

from etch.

FHEK789 avatar FHEK789 commented on June 21, 2024

Yes, I was asking if there's some way to make that work, like is there a way to make a copy of your theme and use it instead of the gitsubmodule?

from etch.

LukasJoswiak avatar LukasJoswiak commented on June 21, 2024

You can fork this repo and then use the fork as your submodule https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.

from etch.

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.