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
|
||||
case adoc.KIND_ESSAY:
|
||||
fallthrough
|
||||
case adoc.KIND_ARTICLE:
|
||||
fallthrough
|
||||
case adoc.KIND_TUTORIAL:
|
||||
return KIND_ARTICLE
|
||||
default:
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
= A Tiny Subset of Asciidoc for Blogging
|
||||
Erik Winter <ik@erikwinter.nl>
|
||||
2020-12-01
|
||||
:kind: article
|
||||
:kind: essay
|
||||
:tags: asciidoc
|
||||
:project: shitty-ssg
|
||||
:language: EN
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue