mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
parent
e5be592ee0
commit
1cc6386937
2 changed files with 8 additions and 4 deletions
|
@ -78,8 +78,8 @@ type PageMeta struct {
|
|||
}
|
||||
|
||||
type Position struct {
|
||||
Prev *Page
|
||||
Next *Page
|
||||
Prev *Page
|
||||
Next *Page
|
||||
PrevInSection *Page
|
||||
NextInSection *Page
|
||||
}
|
||||
|
@ -204,6 +204,10 @@ func (p *Page) getRenderingConfigFlags() map[string]bool {
|
|||
return flags
|
||||
}
|
||||
|
||||
func (p *Page) isRenderingFlagEnabled(flag string) bool {
|
||||
return p.getRenderingConfigFlags()[flag]
|
||||
}
|
||||
|
||||
func newPage(filename string) *Page {
|
||||
page := Page{contentType: "",
|
||||
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 != "" {
|
||||
link = link + "#" + refUrl.Fragment
|
||||
|
||||
if refUrl.Path != "" && target != nil {
|
||||
if refUrl.Path != "" && target != nil && !target.isRenderingFlagEnabled("plainIdAnchors") {
|
||||
link = link + ":" + target.UniqueId()
|
||||
} else if page != nil {
|
||||
} else if page != nil && !page.isRenderingFlagEnabled("plainIdAnchors") {
|
||||
link = link + ":" + page.UniqueId()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue