joeroe / risotto

A minimalist, responsive hugo theme inspired by terminal ricing aesthetics.
https://risotto.joeroe.io
MIT License
393 stars 109 forks source link

Trying to apply multi languages getting strange behaviour #44

Closed Alexsandr0x closed 1 year ago

Alexsandr0x commented 1 year ago

So, I was trying to setup a simple blog using Hugo + Risotto with multi language english + portuguese, but then I notice that was already a template on risotto for that and it was a weird text on the available languages iteration.

The strange code is this one is on line 13~26 in partials/lang.html:

    {{ range .Page.AllTranslations }}
      {{ $translation := .}}
      {{ range $siteLanguages }}
          {{ if eq $translation.Lang .Lang }}
            {{ $selected := false }}
            {{ if eq $pageLang .Lang }}
                <br/><span class="active">$ echo $LANG<br/><b>{{ .LanguageName }}</b></span><br/>

            {{ else }}
                <br/><a href="{{ $translation.Permalink }}">export LANG={{ .LanguageName }}; ./{{ $pageName }}</a><br/>
            {{ end }}
          {{ end }}
      {{ end }}
    {{ end }}

I'm super newbie on this kind of stuff and IDK if '$ echo $LANG' is here to do something special but in my case just show as is:

image

joeroe commented 1 year ago

This was contributed by @bedefaced in #25. It's just for decoration – bash pseudocode that basically says "the current language is English; click here to see the About page in Portuguese".

I'd be open to a pull request with an alternative way of displaying the current and available languages of a page. I do agree that this one goes a bit too far with the terminal analogy. But I don't use multilingual mode so it hasn't been a priority for me so far.

Alexsandr0x commented 1 year ago

oh! okay! now I get it was a stylish thing.

So if it was suppose to emulate a terminal I wrongly thought that was a typo or a forgotten code for some reason.

IDK if others use the multilingual mode, I changed myself in my personal project cause I prefer something simplier.

Since is not a bug I will close this issue.

alankritjoshi commented 6 months ago

@Alexsandr0x how do i disable this partial html? Any config I can use?