fork of anirudh.fi/vite that uses chroma for hl
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Syntax style is configurable

+7 -6
+3 -3
build.go
··· 2 2 3 3 import ( 4 4 "fmt" 5 - "html/template" 6 5 "io/ioutil" 7 6 "os" 8 7 "os/exec" 9 8 "path/filepath" 10 9 "sort" 11 10 "strings" 11 + "text/template" 12 12 13 13 "github.com/cross-cpm/go-shutil" 14 14 ) ··· 58 58 } 59 59 60 60 restContent, fm := parseFrontmatter(content) 61 - bodyHtml := mdRender(restContent) 61 + bodyHtml := mdRender(restContent, cfg) 62 62 relPath, _ := filepath.Rel("pages/", mdPath) 63 63 64 64 var buildPath string ··· 126 126 } 127 127 128 128 restContent, fm := parseFrontmatter(content) 129 - bodyHtml := mdRender(restContent) 129 + bodyHtml := mdRender(restContent, cfg) 130 130 fm.Body = string(bodyHtml) 131 131 132 132 var newFm = NewFm{
+2 -1
config.go
··· 8 8 type Config struct { 9 9 Title string `yaml:"title"` 10 10 Header string `yaml:"header"` 11 - DateFmt string `yaml:datefmt` 11 + DateFmt string `yaml:"datefmt"` 12 12 SiteURL string `yaml:"siteurl"` 13 13 Description string `yaml:"description"` 14 14 Author map[string]string `yaml:"author"` ··· 16 16 Prebuild []string `yaml:"prebuild"` 17 17 Postbuild []string `yaml:"postbuild"` 18 18 RSSPrefixURL string `yaml:"rssprefixurl"` 19 + Syntax string `yaml:"syntax"` 19 20 } 20 21 21 22 func parseConfig() Config {
+2 -2
markdown.go
··· 11 11 bf.Strikethrough | bf.SpaceHeadings | bf.BackslashLineBreak | 12 12 bf.HeadingIDs | bf.Footnotes | bf.NoEmptyLineBeforeBlock 13 13 14 - func mdRender(input []byte) []byte { 14 + func mdRender(input []byte, cfg Config) []byte { 15 15 return bf.Run( 16 16 input, 17 17 bf.WithRenderer( 18 18 bfc.NewRenderer( 19 - bfc.Style("bw"), 19 + bfc.Style(cfg.Syntax), 20 20 bfc.Extend( 21 21 bf.NewHTMLRenderer(bf.HTMLRendererParameters{ 22 22 Flags: bfFlags,