Skip to content

Commit 0e8a93e

Browse files
committed
fix:del updateDate properties add Image and fix save path del index.md folder!
1 parent 56a489d commit 0e8a93e

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

generator/generator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func generate(client *notion.Client, page notion.Page, blocks []notion.Block, co
7373
var err error
7474
f, err = preCheck(page, config, tm)
7575
if f == nil {
76-
path := filepath.Join(config.PostSavePath, generateArticleFolderName(pageName, page.CreatedTime, config), "index.md")
76+
path := filepath.Join(config.PostSavePath, generateArticleFolderName(pageName, page.CreatedTime, config))
7777
if err := os.MkdirAll(path, 0755); err != nil {
7878
fmt.Errorf("couldn't create content folder: %s", err)
7979
}

pkg/tomarkdown/markdown.go

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,25 @@ type ToMarkdown struct {
7979
}
8080

8181
type FrontMatter struct {
82-
//Image interface{} `yaml:",flow"`
83-
Title interface{} `yaml:",flow"`
84-
Status interface{} `yaml:",flow"`
85-
Position interface{} `yaml:",flow"`
86-
Categories []interface{} `yaml:",flow"`
87-
Tags []interface{} `yaml:",flow"`
88-
Keywords []interface{} `yaml:",flow"`
89-
CreateAt interface{} `yaml:",flow"`
90-
Author interface{} `yaml:",flow"`
91-
IsTranslated interface{} `yaml:",flow"`
92-
Lastmod interface{} `yaml:",flow"`
93-
Description interface{} `yaml:",flow"`
94-
Draft interface{} `yaml:",flow"`
95-
ExpiryDate interface{} `yaml:",flow"`
96-
PublishDate interface{} `yaml:",flow"`
97-
Show_comments interface{} `yaml:",flow"`
82+
Title interface{} `yaml:",flow"`
83+
Status interface{} `yaml:",flow"`
84+
Position interface{} `yaml:",flow"`
85+
Categories []interface{} `yaml:",flow"`
86+
Tags []interface{} `yaml:",flow"`
87+
Keywords []interface{} `yaml:",flow"`
88+
CreateAt interface{} `yaml:",flow"`
89+
Author interface{} `yaml:",flow"`
90+
IsTranslated interface{} `yaml:",flow"`
91+
Lastmod interface{} `yaml:",flow"`
92+
Description interface{} `yaml:",flow"`
93+
Draft interface{} `yaml:",flow"`
94+
ExpiryDate interface{} `yaml:",flow"`
95+
//PublishDate interface{} `yaml:",flow"`
96+
Show_comments interface{} `yaml:",flow"`
9897
//Calculate Chinese word count accurately. Default is true
9998
IsCJKLanguage interface{} `yaml:",flow"`
10099
Slug interface{} `yaml:",flow"`
100+
Image interface{} `yaml:",flow"`
101101
}
102102

103103
func New() *ToMarkdown {
@@ -771,7 +771,6 @@ func emphFormat(a *notion.Annotations) (s string) {
771771

772772
func textColor(a *notion.Annotations, text string) (s string) {
773773
s = text
774-
var color = ""
775774
if a.Color == "default" {
776775
return
777776
}
@@ -780,7 +779,7 @@ func textColor(a *notion.Annotations, text string) (s string) {
780779
if strings.Contains(string(a.Color), "_background") {
781780
cssKey = "background-color"
782781
}
783-
s = fmt.Sprintf(`<span style="%s: %s;">%s</span>`, cssKey, ColorMap[color], text)
782+
s = fmt.Sprintf(`<span style="%s: %s;">%s</span>`, cssKey, ColorMap[string(a.Color)], text)
784783
return
785784
}
786785

pkg/tomarkdown/templates/video.ntpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
{{- if eq .Extra.Plat "youtube"}}
3-
{{"{{< youtube id=\""}}{{.Extra.Id}}{{"\" >}}"}}
3+
{{"{{< youtube id=\""}}{{.Extra.Id}}{{"\" >}}"}}
44
{{end}}

0 commit comments

Comments
 (0)