Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
add tags support
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Mar 16, 2023
1 parent e45dd6c commit 1661db2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# File generated by github.com/posener/goaction. DO NOT EDIT.


FROM golang:1.16-alpine3.14
RUN apk add git

Expand Down
7 changes: 5 additions & 2 deletions walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ import (
)

type Front struct {
Title string `yaml:"title"`
Draft bool `yaml:"draft"`
Title string `yaml:"title"`
Draft bool `yaml:"draft"`
Tags []string `yaml:"tags"`
}

// recursively walk directory and return all files with given extension
Expand Down Expand Up @@ -52,6 +53,7 @@ func walk(root, ext string, index bool, ignorePaths map[string]struct{}) (res []
matter = Front{
Title: "Untitled Page",
Draft: false,
Tags: []string{},
}
body = text
}
Expand All @@ -72,6 +74,7 @@ func walk(root, ext string, index bool, ignorePaths map[string]struct{}) (res []
LastModified: info.ModTime(),
Title: title,
Content: body,
Tags: matter.Tags,
}
res = append(res, parse(s, root)...)
} else {
Expand Down

0 comments on commit 1661db2

Please sign in to comment.