mirror of
https://github.com/jackyzha0/hugo-obsidian.git
synced 2024-06-14 11:42:35 +03:00
add tags support
This commit is contained in:
parent
e45dd6c7c8
commit
1661db2ac3
@ -1,6 +1,5 @@
|
||||
# File generated by github.com/posener/goaction. DO NOT EDIT.
|
||||
|
||||
|
||||
FROM golang:1.16-alpine3.14
|
||||
RUN apk add git
|
||||
|
||||
|
3
walk.go
3
walk.go
@ -16,6 +16,7 @@ import (
|
||||
type Front struct {
|
||||
Title string `yaml:"title"`
|
||||
Draft bool `yaml:"draft"`
|
||||
Tags []string `yaml:"tags"`
|
||||
}
|
||||
|
||||
// recursively walk directory and return all files with given extension
|
||||
@ -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
|
||||
}
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user