diff --git a/example/templates/base.html b/example/templates/base.html
index 885c597..38a55b6 100644
--- a/example/templates/base.html
+++ b/example/templates/base.html
@@ -27,7 +27,7 @@
{{ nav.Navname }}
{% if nav.SubSlice %}
- {% for nav2 in SubSlice %}
+ {% for nav2 in nav.SubSlice %}
- {{ nav2.Navname }}
{% endfor %}
diff --git a/main.go b/main.go
index ca20690..53b2a95 100644
--- a/main.go
+++ b/main.go
@@ -330,8 +330,20 @@ func processContent(conf *PathConfigTree) {
if strings.HasPrefix(goToFixed, "/") {
goToFixed = backToRoot(curNavPath) + goToFixed
}
+ goToFixed = path.Clean(goToFixed)
- log.Error(goToFixed)
+ switch globalConfig.Webserver.Type {
+ case "apache":
+ htaccessFile := conf.OutputPath + "/.htaccess"
+ log.Noticef("writing '%s' with redirect to: %s", htaccessFile, goToFixed)
+ err := ioutil.WriteFile(htaccessFile, []byte(`RewriteEngine on
+RewriteRule ^$ %{REQUEST_URI}`+goToFixed+`/ [R,L]
+`), 0644)
+ if err != nil {
+ log.Panicf("could not write '%s': %s", htaccessFile, err)
+ }
+ break
+ }
}
for _, file := range conf.InputFiles {