~gsthnz/gssg

a842c013b9fa044b720b32ee015fedcde3f24ab1 — Gustavo Heinz 2 years ago 747b6b4
Expose page filename to templates
1 files changed, 2 insertions(+), 0 deletions(-)

M page.go
M page.go => page.go +2 -0
@@ 18,6 18,7 @@ type Page struct {
	rawFilename  string
	rawDirectory string
	URLPath      string
    Filename     string
	Permalink    string
	Content      string
	Date         time.Time


@@ 47,6 48,7 @@ func parsePage(filename string) *Page {
	}
	p.Content = string(b)
	p.rawDirectory, p.rawFilename = filepath.Split(filename)
    p.Filename = p.rawFilename
	p.URLPath, _ = filepath.Rel(config.SourceDir, filename)
	p.Permalink = fetchPermalink(p.URLPath)
	p.Title = fetchTitle(b)