Language Sites
OnPointSM opened this issue · 4 comments
I am wondering if it is me being dense, or whether co-opting the theme for a foreign language site is not really practicable.
I have made a monolingual site, in French, so the other languages are now inactive.
My main index.html in docs is of this type:
<html lang="en-us">
<head>
<meta name="generator" content="Hugo 0.74.2" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
.....etc
(docs/de) German and (docs/fr) Spanish are similar, just the language is adapted.
(docs/en) is like this
< !DOCTYPE html><html><head><title>http://example.com/</title><link rel="canonical" href="http://example.com/"/><meta name="robots" content="noindex"><meta charset="utf-8" /><meta http-equiv="refresh" content="0; url=http://example.com/" /></head></html>
{{ $paginator := .Paginate (where .Site.RegularPages ".Params.post" "!=" false) }}
{{ if .IsHome }}
{{ if eq $paginator.PageNumber 1 }}
<title>{{ .Title }}</title>
<meta name="description" content="{{ .Site.Params.description }}" />
{{ else }}
<title>{{ .Title }} | Page {{ $paginator.PageNumber }}</title>
<meta name="description" content="This is page {{ $paginator.PageNumber }} of our content." />
{{ end }}
{{ else }}
{{ if .Params.seoTitle }}
<title>{{ .Params.seoTitle }}</title>
{{ else }}
<title>{{ .Title }}</title>
{{ end }}
<meta name="description" content="{{ .Description }}" / >
{{ end}}
And the docs/fr is thus:
<!DOCTYPE html><html><head><title>https://www.onpointsm.fr/</title><link rel="canonical" href="https://www.onpointsm.fr/"/><meta name="robots" content="noindex"><meta charset="utf-8" /><meta http-equiv="refresh" content="0; url=https://www.onpointsm.fr/" /></head></html>
So I am wondering why my docs/fr/index.html is so sparse....
Do i need to modify or add something?
I use the theme for a website that has German as the first language. It works well. My config looks like this:
DefaultContentLanguage = "de" # Default language for multilingual sites
3rd line of my config,toml
[languages]
[languages.de]
languageName = "Deutsch"
languageCode = "de"
contentDir = "content/de"
weight = 0
title = "Volker Beck, M.A."
[languages.de.params]
dateFormat = "2. January 2006"
description = "Online Profil und Lebenslauf von Volker Beck, M.A."
footerText = "© Volker Beck 2022 | Erstellt mit hugo und dem Theme [Introduction]
(https://github.com/victoriadrake/hugo-theme-introduction/)"
[languages.en]
languageName = "English"
languageCode = "en-us"
contentDir = "content/en"
weight = 1
title = "Volker Beck, MA"
[languages.en.params]
description = "Website Description" # Max 160 characters show in search results
# footerText = "© Volker Beck 2022 | Erstellt mit hugo und dem Theme Introduction." # Text to override default footer text (markdown allowed)
The latter at the end of config.toml
Also, furthermore, you need to create the respective language folder structure:
CONTENT
de
en
and within those folders:
de
blog
projects
home
en
blog
projects
home
(use english names for the folders, if you change the folder names, it does not work - I tried with projects)
The repective files in the home folders are included in the menue.
Did that help?
Nice.....but your portfolio does not open
And obviously, like me, you are a work in progress
Strange, I was able to open them in English (not yet finished) and German:
https://volkerbeck.info/en/#projects
https://volkerbeck.info/projects/ - works well