Skip to content

Commit

Permalink
mataroa: render HTML instead of Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 21, 2024
1 parent 5851a2b commit 6f24bbe
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
3 changes: 2 additions & 1 deletion blog.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const (
blogBaseUrl = "https://github.com/thiagokokada/blog"
blogMainUrl = blogBaseUrl + "/blob/main/"
blogRawUrl = blogBaseUrl + "/raw/main/"
highlightStyle = "monokai"
readmeTemplate = `# Blog
Mirror of my blog in https://kokada.capivaras.dev/.
Expand Down Expand Up @@ -221,7 +222,7 @@ func genRss(ps posts) string {
md := goldmark.New(goldmark.WithExtensions(
NewLinkRewriter(blogMainUrl, nil),
extension.GFM,
highlighting.NewHighlighting(highlighting.WithStyle("monokai")),
highlighting.NewHighlighting(highlighting.WithStyle(highlightStyle)),
))

var items []*feeds.Item
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ require (
github.com/elliotchance/orderedmap/v2 v2.4.0
github.com/gorilla/feeds v1.2.0
github.com/gosimple/slug v1.14.0
github.com/teekennedy/goldmark-markdown v0.3.0
github.com/yuin/goldmark v1.7.4
github.com/yuin/goldmark-highlighting v0.0.0-20220208100518-594be1970594
)
Expand All @@ -15,6 +14,7 @@ require (
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/gosimple/unidecode v1.0.1 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
)

replace github.com/teekennedy/goldmark-markdown => github.com/thiagokokada/goldmark-markdown v0.0.0-20240820111219-f30775d8ed15
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rhysd/go-fakeio v1.0.0 h1:+TjiKCOs32dONY7DaoVz/VPOdvRkPfBkEyUDIpM8FQY=
github.com/rhysd/go-fakeio v1.0.0/go.mod h1:joYxF906trVwp2JLrE4jlN7A0z6wrz8O6o1UjarbFzE=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/thiagokokada/goldmark-markdown v0.0.0-20240820111219-f30775d8ed15 h1:a0JRZEKKoKhQWUi4BQm2QVugFZVZ6Y5ZtB9acRO0fQE=
github.com/thiagokokada/goldmark-markdown v0.0.0-20240820111219-f30775d8ed15/go.mod h1:kMhDz8La77A9UHvJGsxejd0QUflN9sS+QXCqnhmxmNo=
github.com/yuin/goldmark v1.4.5/go.mod h1:rmuwmfZ0+bvzB24eSC//bk1R1Zp3hM0OXYv/G2LIilg=
github.com/yuin/goldmark v1.7.4 h1:BDXOHExt+A7gwPCJgPIIq7ENvceR7we7rOS9TNoLZeg=
github.com/yuin/goldmark v1.7.4/go.mod h1:uzxRWxtg69N339t3louHJ7+O03ezfj6PlliRlaOzY1E=
Expand Down
6 changes: 2 additions & 4 deletions mataroa.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import (
"time"

"github.com/elliotchance/orderedmap/v2"
markdown "github.com/teekennedy/goldmark-markdown"
"github.com/yuin/goldmark"
highlighting "github.com/yuin/goldmark-highlighting"
"github.com/yuin/goldmark/extension"
)

Expand Down Expand Up @@ -122,12 +122,10 @@ func postMataroaPost(p post) (mataroaResponse, *http.Response, error) {

func prepareToMataroa(ps posts) posts {
md := goldmark.New(
goldmark.WithRenderer(
markdown.NewRenderer(markdown.WithSubListLength(2)),
),
goldmark.WithExtensions(
NewLinkRewriter(mataroaBlogUrl, ps),
extension.GFM,
highlighting.NewHighlighting(highlighting.WithStyle(highlightStyle)),
),
)

Expand Down

0 comments on commit 6f24bbe

Please sign in to comment.