Root page for a multilingual site

yes this seems to be more tricky than I thought. All directly in /content seems to be ignored.

I managed to get it quite close with a basic example

I created /content/en/central.md containing:

+++
title = 'Home (GENERAL)'
date = 2023-01-01T08:00:00-07:00
draft = false
layout = "home"
url = "/"
+++

That way this page will be

  • rendered with the same template as the Home page.
  • published to the root as index.html

I adjusted the layouts/_default/home.html from

{{ define "main" }}
    {{ .Content }}
   {{ range site.RegularPages }}
      <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
      {{ .Summary }}
   {{ end }}
{{ end }}

to

{{ define "main" }}
   {{ if .IsHome }}
      {{ .Content }}
   {{ else }}
      {{ site.Home.Content }}
   {{ end }}
   {{ range site.RegularPages }}
      <h2><a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a></h2>
      {{ .Summary }}
   {{ end }}
{{ end }}

This will take the Content of the Home page for all other pages using the home layout

That’s pretty close, next would be to adjust the baseof.html where it asks for .IsHome to do the same with this page…

not yet done… and no repo yet. but if you want I can publish this working example (maybe tomorrow)

i used the multilingual example from here Multilanguage problem - #9 by jmooring, converted it to use subfolders and then added the stuff above.

and took ideas from Use frontmatter to duplicate a page to multiple output files - #5 by jmooring

maybe @jmooring has another idea, I could thing of a deferred template for that central page…


Search just solved by @jmooring THX.

You are right, I cannot find that either. But I remembered that there was something like that with the main alias page and just went to the all configuration settings and did a page search. and I’m pretty sure it will be in the release notes for that version.