diff --git a/CHANGELOG.md b/CHANGELOG.md index 441d970..ecc7e43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # For next release * **Raphael Pour** * metadata: render posts with date instead of full timestamp + * post: add discussion board via github using giscus *Not released yet* diff --git a/cmd/post.tmpl b/cmd/post.tmpl index ef739d3..a90bacf 100644 --- a/cmd/post.tmpl +++ b/cmd/post.tmpl @@ -87,5 +87,22 @@ {{.CreatedAt}} {{ .Rendered }} + {{if .Discussion}} + + {{end}} diff --git a/cmd/render.go b/cmd/render.go index 417522d..51346c5 100644 --- a/cmd/render.go +++ b/cmd/render.go @@ -60,6 +60,7 @@ type Post struct { CreatedAt string Content string FeaturedImage string + Discussion bool Rendered template.HTML Metadata *metadata.Metadata } @@ -169,6 +170,7 @@ var renderCmd = &cobra.Command{ Timestamp: meta.CreatedAt, CreatedAt: meta.Date(), Content: renderedStr, + Discussion: cfg.Discussion && !meta.Static, Rendered: template.HTML(renderedStr), FeaturedImage: featuredImage, Metadata: meta, diff --git a/internal/config/config.go b/internal/config/config.go index 3132d12..4af38bc 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -19,6 +19,7 @@ type Config struct { Description string `json:"description"` ChillFiles []string `json:"chill-files"` Footer string `json:"footer"` + Discussion bool `json:"discussion"` } func ConfigPath(postPath string) string {