func (s *SiteInfo) createNodeMenuEntryURL(in string) string { if !strings.HasPrefix(in, "/") { return in } // make it match the nodes menuEntryURL := in menuEntryURL = helpers.URLizeAndPrep(menuEntryURL) if !s.canonifyURLs { menuEntryURL = helpers.AddContextRoot(string(s.BaseURL), menuEntryURL) } return menuEntryURL }
func newPaginationURLFactory(pathElements ...string) paginationURLFactory { paginatePath := viper.GetString("paginatePath") return func(page int) string { var rel string if page == 1 { rel = fmt.Sprintf("/%s/", path.Join(pathElements...)) } else { rel = fmt.Sprintf("/%s/%s/%d/", path.Join(pathElements...), paginatePath, page) } return helpers.URLizeAndPrep(rel) } }
func (s *Site) permalinkStr(plink string) string { return helpers.MakePermalink(string(viper.GetString("BaseURL")), helpers.URLizeAndPrep(plink)).String() }
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") }