diff --git a/cmd/ssg/site/meta.go b/cmd/ssg/site/meta.go index 5348daa..5b6b7f9 100644 --- a/cmd/ssg/site/meta.go +++ b/cmd/ssg/site/meta.go @@ -21,6 +21,8 @@ func NewKind(kind adoc.Kind) Kind { return KIND_STORY case adoc.KIND_ESSAY: fallthrough + case adoc.KIND_ARTICLE: + fallthrough case adoc.KIND_TUTORIAL: return KIND_ARTICLE default: diff --git a/cmd/ssg/site/meta_test.go b/cmd/ssg/site/meta_test.go index ea62552..e22cb5e 100644 --- a/cmd/ssg/site/meta_test.go +++ b/cmd/ssg/site/meta_test.go @@ -38,6 +38,11 @@ func TestNewKind(t *testing.T) { input: adoc.KIND_ESSAY, exp: site.KIND_ARTICLE, }, + { + name: "article", + input: adoc.KIND_ARTICLE, + exp: site.KIND_ARTICLE, + }, { name: "tutorial", input: adoc.KIND_TUTORIAL, diff --git a/cmd/ssg/site/site.go b/cmd/ssg/site/site.go index cd81bf4..387d096 100644 --- a/cmd/ssg/site/site.go +++ b/cmd/ssg/site/site.go @@ -55,11 +55,6 @@ func (s *Site) AddFilePost(fPath string) error { return nil } -func (s *Site) AddFolderPost(kind Kind, fPath string) error { - // TODO implement - return nil -} - func (s *Site) RenderHTML(targetPath string) error { posts := s.posts.Sort() diff --git a/doc/a-tiny-subset-of-asciidoc-for-blogging.adoc b/doc/a-tiny-subset-of-asciidoc-for-blogging.adoc index 5bc022f..c518b5d 100644 --- a/doc/a-tiny-subset-of-asciidoc-for-blogging.adoc +++ b/doc/a-tiny-subset-of-asciidoc-for-blogging.adoc @@ -1,7 +1,7 @@ = A Tiny Subset of Asciidoc for Blogging Erik Winter 2020-12-01 -:kind: article +:kind: essay :tags: asciidoc :project: shitty-ssg :language: EN diff --git a/pkg/adoc/adoc.go b/pkg/adoc/adoc.go index dca87b1..e562123 100644 --- a/pkg/adoc/adoc.go +++ b/pkg/adoc/adoc.go @@ -12,6 +12,7 @@ const ( KIND_SNIPPET = Kind("snippet") KIND_ESSAY = Kind("essay") KIND_WORK = Kind("work") + KIND_ARTICLE = Kind("article") KIND_TUTORIAL = Kind("tutorial") KIND_UNKNOWN = Kind("unknown") ) @@ -28,7 +29,7 @@ func NewKind(text string) Kind { for _, k := range []string{ "note", "vkv", "story", "snippet", - "essay", "tutorial", "work", + "essay", "tutorial", "work", "article", } { if k == text { return Kind(k) diff --git a/pkg/adoc/adoc_test.go b/pkg/adoc/adoc_test.go index 5eece4f..6611fa6 100644 --- a/pkg/adoc/adoc_test.go +++ b/pkg/adoc/adoc_test.go @@ -52,6 +52,11 @@ func TestNewKind(t *testing.T) { input: "tutorial", exp: adoc.KIND_TUTORIAL, }, + { + name: "article", + input: "article", + exp: adoc.KIND_ARTICLE, + }, { name: "work note", input: "work",