add article kind
This commit is contained in:
parent
149a95b56c
commit
166658eba6
|
@ -21,6 +21,8 @@ func NewKind(kind adoc.Kind) Kind {
|
||||||
return KIND_STORY
|
return KIND_STORY
|
||||||
case adoc.KIND_ESSAY:
|
case adoc.KIND_ESSAY:
|
||||||
fallthrough
|
fallthrough
|
||||||
|
case adoc.KIND_ARTICLE:
|
||||||
|
fallthrough
|
||||||
case adoc.KIND_TUTORIAL:
|
case adoc.KIND_TUTORIAL:
|
||||||
return KIND_ARTICLE
|
return KIND_ARTICLE
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -38,6 +38,11 @@ func TestNewKind(t *testing.T) {
|
||||||
input: adoc.KIND_ESSAY,
|
input: adoc.KIND_ESSAY,
|
||||||
exp: site.KIND_ARTICLE,
|
exp: site.KIND_ARTICLE,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "article",
|
||||||
|
input: adoc.KIND_ARTICLE,
|
||||||
|
exp: site.KIND_ARTICLE,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "tutorial",
|
name: "tutorial",
|
||||||
input: adoc.KIND_TUTORIAL,
|
input: adoc.KIND_TUTORIAL,
|
||||||
|
|
|
@ -55,11 +55,6 @@ func (s *Site) AddFilePost(fPath string) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Site) AddFolderPost(kind Kind, fPath string) error {
|
|
||||||
// TODO implement
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s *Site) RenderHTML(targetPath string) error {
|
func (s *Site) RenderHTML(targetPath string) error {
|
||||||
posts := s.posts.Sort()
|
posts := s.posts.Sort()
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
= A Tiny Subset of Asciidoc for Blogging
|
= A Tiny Subset of Asciidoc for Blogging
|
||||||
Erik Winter <ik@erikwinter.nl>
|
Erik Winter <ik@erikwinter.nl>
|
||||||
2020-12-01
|
2020-12-01
|
||||||
:kind: article
|
:kind: essay
|
||||||
:tags: asciidoc
|
:tags: asciidoc
|
||||||
:project: shitty-ssg
|
:project: shitty-ssg
|
||||||
:language: EN
|
:language: EN
|
||||||
|
|
|
@ -12,6 +12,7 @@ const (
|
||||||
KIND_SNIPPET = Kind("snippet")
|
KIND_SNIPPET = Kind("snippet")
|
||||||
KIND_ESSAY = Kind("essay")
|
KIND_ESSAY = Kind("essay")
|
||||||
KIND_WORK = Kind("work")
|
KIND_WORK = Kind("work")
|
||||||
|
KIND_ARTICLE = Kind("article")
|
||||||
KIND_TUTORIAL = Kind("tutorial")
|
KIND_TUTORIAL = Kind("tutorial")
|
||||||
KIND_UNKNOWN = Kind("unknown")
|
KIND_UNKNOWN = Kind("unknown")
|
||||||
)
|
)
|
||||||
|
@ -28,7 +29,7 @@ func NewKind(text string) Kind {
|
||||||
|
|
||||||
for _, k := range []string{
|
for _, k := range []string{
|
||||||
"note", "vkv", "story", "snippet",
|
"note", "vkv", "story", "snippet",
|
||||||
"essay", "tutorial", "work",
|
"essay", "tutorial", "work", "article",
|
||||||
} {
|
} {
|
||||||
if k == text {
|
if k == text {
|
||||||
return Kind(k)
|
return Kind(k)
|
||||||
|
|
|
@ -52,6 +52,11 @@ func TestNewKind(t *testing.T) {
|
||||||
input: "tutorial",
|
input: "tutorial",
|
||||||
exp: adoc.KIND_TUTORIAL,
|
exp: adoc.KIND_TUTORIAL,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "article",
|
||||||
|
input: "article",
|
||||||
|
exp: adoc.KIND_ARTICLE,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "work note",
|
name: "work note",
|
||||||
input: "work",
|
input: "work",
|
||||||
|
|
Loading…
Reference in New Issue