mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Add support for Relative Permalinks
This commit is contained in:
@@ -253,6 +253,19 @@ func (p *Page) Permalink() (string, error) {
|
||||
return link.String(), nil
|
||||
}
|
||||
|
||||
func (p *Page) RelPermalink() (string, error) {
|
||||
link, err := p.permalink()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
link.Scheme = ""
|
||||
link.Host = ""
|
||||
link.User = nil
|
||||
link.Opaque = ""
|
||||
return link.String(), nil
|
||||
}
|
||||
|
||||
func (page *Page) handleTomlMetaData(datum []byte) (interface{}, error) {
|
||||
m := map[string]interface{}{}
|
||||
datum = removeTomlIdentifier(datum)
|
||||
|
Reference in New Issue
Block a user