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.
|
# File generated by github.com/posener/goaction. DO NOT EDIT.
|
||||||
|
|
||||||
|
|
||||||
FROM golang:1.16-alpine3.14
|
FROM golang:1.16-alpine3.14
|
||||||
RUN apk add git
|
RUN apk add git
|
||||||
|
|
||||||
|
3
walk.go
3
walk.go
@ -16,6 +16,7 @@ import (
|
|||||||
type Front struct {
|
type Front struct {
|
||||||
Title string `yaml:"title"`
|
Title string `yaml:"title"`
|
||||||
Draft bool `yaml:"draft"`
|
Draft bool `yaml:"draft"`
|
||||||
|
Tags []string `yaml:"tags"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursively walk directory and return all files with given extension
|
// 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{
|
matter = Front{
|
||||||
Title: "Untitled Page",
|
Title: "Untitled Page",
|
||||||
Draft: false,
|
Draft: false,
|
||||||
|
Tags: []string{},
|
||||||
}
|
}
|
||||||
body = text
|
body = text
|
||||||
}
|
}
|
||||||
@ -72,6 +74,7 @@ func walk(root, ext string, index bool, ignorePaths map[string]struct{}) (res []
|
|||||||
LastModified: info.ModTime(),
|
LastModified: info.ModTime(),
|
||||||
Title: title,
|
Title: title,
|
||||||
Content: body,
|
Content: body,
|
||||||
|
Tags: matter.Tags,
|
||||||
}
|
}
|
||||||
res = append(res, parse(s, root)...)
|
res = append(res, parse(s, root)...)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user