"Make your site browsable from a local file system"

First, what you are trying to accomplish can be quite difficult. See warning here:
https://discourse.gohugo.io/t/open-built-website-from-local-folder-without-running-a-server/34193/2

Second, ask yourself if it is really worth the effort.

Third, to fix the links to the home page:

mkdir -p layouts/partials
cp themes/ananke/layouts/partials/i18nlist.html layouts/partials/
cp themes/ananke/layouts/partials/site-navigation.html layouts/partials/
layouts/partials/i18nlist.html
{{ if .IsTranslated }}
<h4>{{ i18n "translations" }}</h4>
<ul class="pl0 mr3">
    {{ range .Translations }}
    <li class="list f5 f4-ns fw4 dib pr3">
      {{ $href := .RelPermalink }}
      {{ if .IsHome }}
        {{ $href = path.Join .RelPermalink "index.html" }}
      {{ end }}
      <a class="hover-white no-underline white-90" href="{{ $href }}">{{ .Lang }}</a>
    </li>
    {{ end}}
</ul>
{{ end }}

layouts/partials/site-navigation.html
<nav class="pv3 ph3 ph4-ns" role="navigation">
  <div class="flex-l justify-between items-center center">
    <a href="{{ path.Join .Site.Home.RelPermalink "index.html" }}" class="f3 fw2 hover-white no-underline white-90 dib">
      {{ with .Site.Params.site_logo }}
        <img src="{{ . }}" class="w100 mw5-ns" alt="{{ $.Site.Title }}" />
      {{ else }}
        {{ .Site.Title }}
      {{ end }}
    </a>
    <div class="flex-l items-center">
      {{ partial "i18nlist.html" . }}
      {{ if .Site.Menus.main }}
        <ul class="pl0 mr3">
          {{ range .Site.Menus.main }}
          <li class="list f5 f4-ns fw4 dib pr3">
            <a class="hover-white no-underline white-90" href="{{ .URL }}" title="{{ i18n "pageTitle" . }}">
              {{ .Name }}
            </a>
          </li>
          {{ end }}
        </ul>
      {{ end }}
      {{ partialCached "social-follow.html" . }}
    </div>
  </div>
</nav>

Finally, you still need to sort out a few image URLs (see 404s in your browser’s dev tools).

1 Like