mirror of
https://github.com/gohugoio/hugo.git
synced 2025-03-20 13:21:08 +00:00
parent
e5be592ee0
commit
1cc6386937
2 changed files with 8 additions and 4 deletions
|
@ -78,8 +78,8 @@ type PageMeta struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Position struct {
|
type Position struct {
|
||||||
Prev *Page
|
Prev *Page
|
||||||
Next *Page
|
Next *Page
|
||||||
PrevInSection *Page
|
PrevInSection *Page
|
||||||
NextInSection *Page
|
NextInSection *Page
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,10 @@ func (p *Page) getRenderingConfigFlags() map[string]bool {
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *Page) isRenderingFlagEnabled(flag string) bool {
|
||||||
|
return p.getRenderingConfigFlags()[flag]
|
||||||
|
}
|
||||||
|
|
||||||
func newPage(filename string) *Page {
|
func newPage(filename string) *Page {
|
||||||
page := Page{contentType: "",
|
page := Page{contentType: "",
|
||||||
Source: Source{File: *source.NewFile(filename)},
|
Source: Source{File: *source.NewFile(filename)},
|
||||||
|
|
|
@ -186,9 +186,9 @@ func (s *SiteInfo) refLink(ref string, page *Page, relative bool) (string, error
|
||||||
if refUrl.Fragment != "" {
|
if refUrl.Fragment != "" {
|
||||||
link = link + "#" + refUrl.Fragment
|
link = link + "#" + refUrl.Fragment
|
||||||
|
|
||||||
if refUrl.Path != "" && target != nil {
|
if refUrl.Path != "" && target != nil && !target.isRenderingFlagEnabled("plainIdAnchors") {
|
||||||
link = link + ":" + target.UniqueId()
|
link = link + ":" + target.UniqueId()
|
||||||
} else if page != nil {
|
} else if page != nil && !page.isRenderingFlagEnabled("plainIdAnchors") {
|
||||||
link = link + ":" + page.UniqueId()
|
link = link + ":" + page.UniqueId()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue