diff --git a/go.mod b/go.mod index c92f6a3..eda963e 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/spf13/viper v1.21.0 github.com/yuin/goldmark v1.8.5 golang.org/x/crypto v0.53.0 - gorm.io/driver/sqlite v1.6.0 gorm.io/gorm v1.31.2 ) @@ -37,7 +36,6 @@ require ( github.com/klauspost/cpuid/v2 v2.3.0 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/ncruces/go-strftime v1.0.0 // indirect diff --git a/goblog.db b/goblog.db index 1799479..03b5433 100644 Binary files a/goblog.db and b/goblog.db differ diff --git a/handlers/view.go b/handlers/view.go index 84f1ed8..84b7c4e 100644 --- a/handlers/view.go +++ b/handlers/view.go @@ -106,7 +106,7 @@ func IndexView(c *gin.Context) { // 调试日志 slog.Info("查询结果", "postCount", len(posts)) for i, p := range posts { - slog.Info("文章", "index", i, "id", p.ID, "title", p.Title, "status", p.Status, "publishedAt", p.PublishedAt) + slog.Info("文章", "index", i, "id", p.ID, "title", p.Title, "status", p.Status, "publishedAt", p.PublishedAt, "views", p.Views, "commentsCount", len(p.Comments)) } // 获取页面 diff --git a/templates/default/index.html b/templates/default/index.html index 7b0af55..e5c90a6 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -16,6 +16,7 @@ {{if .IsTop}}置顶{{end}}
{{.Summary}}
阅读全文 →