This commit is contained in:
parent
6e4a680237
commit
ba9634a72c
@ -27,7 +27,7 @@
|
||||
<li {% if nav.Active %}class="active"{% endif %}><a href="{{ nav.GoTo }}" title="{{ nav.This.Data.hoverText }}">{{ nav.Navname }}</a>
|
||||
{% if nav.SubSlice %}
|
||||
<ul>
|
||||
{% for nav2 in SubSlice %}
|
||||
{% for nav2 in nav.SubSlice %}
|
||||
<li {% if nav2.Active %}class="active"{% endif %}><a href="{{ nav2.GoTo }}" title="{{ nav2.This.Data.hoverText }}">{{ nav2.Navname }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
14
main.go
14
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user