hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 99acbb2eb273500596a0da5b51b490fefc0829c4
parent 5838420aa1f5dfb6aa73479caa60467cc27dee82
Author: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Date:   Fri, 16 Oct 2015 20:45:49 -0700

Permalink on Node and Page should be of string

This change fixes #1384.

Diffstat:
Mhugolib/node.go | 2+-
Mhugolib/site.go | 10+++++-----
Mtarget/htmlredirect.go | 6+++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/hugolib/node.go b/hugolib/node.go
@@ -139,7 +139,7 @@ func (n *Node) RelRef(ref string) (string, error) {
 
 type URLPath struct {
 	URL       string
-	Permalink template.HTML
+	Permalink string
 	Slug      string
 	Section   string
 }
diff --git a/hugolib/site.go b/hugolib/site.go
@@ -889,7 +889,7 @@ func (s *Site) RenderAliases() error {
 			if err != nil {
 				return err
 			}
-			if err := s.WriteDestAlias(a, template.HTML(plink)); err != nil {
+			if err := s.WriteDestAlias(a, plink); err != nil {
 				return err
 			}
 		}
@@ -1386,11 +1386,11 @@ func (s *Site) Stats() {
 func (s *Site) setURLs(n *Node, in string) {
 	n.URL = helpers.URLizeAndPrep(in)
 	n.Permalink = s.permalink(n.URL)
-	n.RSSLink = s.permalink(in + ".xml")
+	n.RSSLink = template.HTML(s.permalink(in + ".xml"))
 }
 
-func (s *Site) permalink(plink string) template.HTML {
-	return template.HTML(s.permalinkStr(plink))
+func (s *Site) permalink(plink string) string {
+	return s.permalinkStr(plink)
 }
 
 func (s *Site) permalinkStr(plink string) string {
@@ -1572,7 +1572,7 @@ func (s *Site) WriteDestPage(path string, reader io.Reader) (err error) {
 	return s.PageTarget().Publish(path, reader)
 }
 
-func (s *Site) WriteDestAlias(path string, permalink template.HTML) (err error) {
+func (s *Site) WriteDestAlias(path string, permalink string) (err error) {
 	jww.DEBUG.Println("creating alias:", path)
 	return s.AliasTarget().Publish(path, permalink)
 }
diff --git a/target/htmlredirect.go b/target/htmlredirect.go
@@ -26,7 +26,7 @@ func init() {
 
 type AliasPublisher interface {
 	Translator
-	Publish(string, template.HTML) error
+	Publish(string, string) error
 }
 
 type HTMLRedirectAlias struct {
@@ -107,10 +107,10 @@ func (h *HTMLRedirectAlias) Translate(alias string) (aliasPath string, err error
 }
 
 type AliasNode struct {
-	Permalink template.HTML
+	Permalink string
 }
 
-func (h *HTMLRedirectAlias) Publish(path string, permalink template.HTML) (err error) {
+func (h *HTMLRedirectAlias) Publish(path string, permalink string) (err error) {
 	if path, err = h.Translate(path); err != nil {
 		jww.ERROR.Printf("%s, skipping.", err)
 		return nil