templ generate, add markdown syntax highlighting, fix stuff
This commit is contained in:
9
posts.go
9
posts.go
@@ -10,7 +10,9 @@ import (
|
||||
"time"
|
||||
|
||||
"git.valxntine.dev/valxntine/blog/models"
|
||||
chromahtml "github.com/alecthomas/chroma/v2/formatters/html"
|
||||
"github.com/yuin/goldmark"
|
||||
highlighting "github.com/yuin/goldmark-highlighting/v2"
|
||||
"github.com/yuin/goldmark/extension"
|
||||
"github.com/yuin/goldmark/parser"
|
||||
"github.com/yuin/goldmark/renderer/html"
|
||||
@@ -41,6 +43,13 @@ var md = goldmark.New(
|
||||
extension.Strikethrough,
|
||||
extension.Linkify,
|
||||
extension.TaskList,
|
||||
highlighting.NewHighlighting(
|
||||
highlighting.WithStyle("monokai"),
|
||||
highlighting.WithFormatOptions(
|
||||
chromahtml.WithLineNumbers(true),
|
||||
// chromahtml.WithClasses(true),
|
||||
),
|
||||
),
|
||||
),
|
||||
goldmark.WithParserOptions(
|
||||
parser.WithAutoHeadingID(),
|
||||
|
Reference in New Issue
Block a user