This commit is contained in:
Henrique Dias committed 2016-06-14 18:19:10 +01:00
1 parent 8393244e9d
commit e137f46169
7 files changed
+157 -64

No files matched your search

+11
View File
@@ -49,6 +49,17 @@ func (p PageInfo) BreadcrumbMap() map[string]string {
return result
}
// PreviousLink returns the path of the previous folder
func (p PageInfo) PreviousLink() string {
parts := strings.Split(p.Path, "/")
if len(parts) <= 1 {
return ""
}
return parts[len(parts)-2]
}
// PrintAsHTML formats the page in HTML and executes the template
func (p Page) PrintAsHTML(w http.ResponseWriter, templates ...string) (int, error) {
templates = append(templates, "base")