From b33346962366998cf95151218f0445c89f1381e4 Mon Sep 17 00:00:00 2001 From: razonyang Date: Sun, 28 May 2023 16:57:21 +0800 Subject: [PATCH] feat: add the staticman module --- modules/staticman/go.mod | 18 +++++++++++++ modules/staticman/go.sum | 26 +++++++++++++++++++ modules/staticman/hugo.toml | 17 ++++++++++++ .../hooks/hb-blog-post-comments.html | 2 ++ 4 files changed, 63 insertions(+) create mode 100644 modules/staticman/go.mod create mode 100644 modules/staticman/go.sum create mode 100644 modules/staticman/hugo.toml create mode 100644 modules/staticman/layouts/partials/hugopress/modules/hb-blog-comments-staticman/hooks/hb-blog-post-comments.html diff --git a/modules/staticman/go.mod b/modules/staticman/go.mod new file mode 100644 index 00000000..83daf081 --- /dev/null +++ b/modules/staticman/go.mod @@ -0,0 +1,18 @@ +module github.com/hbstack/blog/modules/staticman + +go 1.19 + +require ( + github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20002 // indirect + github.com/hbstack/blog v0.11.0 // indirect + github.com/hbstack/footer v0.2.1 // indirect + github.com/hbstack/header v0.1.17 // indirect + github.com/hbstack/staticman-comments v0.1.0 // indirect + github.com/hugomods/base v0.1.0 // indirect + github.com/hugomods/hugopress v0.1.0 // indirect + github.com/hugomods/icons v0.6.0 // indirect + github.com/hugomods/icons/vendors/simple-icons v0.14.0 // indirect + github.com/hugomods/seo/modules/base v0.1.0 // indirect + github.com/hugomods/snackbar v0.1.2 // indirect + github.com/twbs/icons v1.10.5 // indirect +) diff --git a/modules/staticman/go.sum b/modules/staticman/go.sum new file mode 100644 index 00000000..ede09ccd --- /dev/null +++ b/modules/staticman/go.sum @@ -0,0 +1,26 @@ +github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20002 h1:6F6sjCSkFIIgqLp4SEIL1Ao9ZfKyM6OmgqEdTlc58Yk= +github.com/gohugoio/hugo-mod-bootstrap-scss/v5 v5.20300.20002/go.mod h1:Q6TrjM78wB13zkOMBSV4IZIZ54tbshmE2fem9CYx2pU= +github.com/gohugoio/hugo-mod-jslibs-dist/popperjs/v2 v2.21100.20000/go.mod h1:mFberT6ZtcchrsDtfvJM7aAH2bDKLdOnruUHl0hlapI= +github.com/hbstack/blog v0.11.0 h1:kiXzBilexVL0KG0IyoaL6Rae/NP0cPtBgCrA+T7p+rI= +github.com/hbstack/blog v0.11.0/go.mod h1:8untxY8tIK3Sn012FMZ8//vNJq/qsQGssjtxvw10h+c= +github.com/hbstack/footer v0.2.1 h1:GZbSRcGNMeKAiDLeai0cPaEnztkDBraTNQqe2uap944= +github.com/hbstack/footer v0.2.1/go.mod h1:ldb4b95D/7NVWQWFTIngasypCA+QQQRj1I+1BEyOi/c= +github.com/hbstack/header v0.1.17 h1:lIZuV4+WGsLWxWxEitec3ItAryQoGELpvNHkoYw25tY= +github.com/hbstack/header v0.1.17/go.mod h1:YEYnlqmhotkQdFbSzN/ZQT55kLLfMdvVVIzEDMFgTz4= +github.com/hbstack/staticman-comments v0.1.0 h1:cPUo4LzOjqKt04nQVvKgIHsr61JZhu99/NWYiWFR1IQ= +github.com/hbstack/staticman-comments v0.1.0/go.mod h1:UViLMKnW/qiZtySn9wI8XvlOsgGZCb1RG2q7tjD5yRk= +github.com/hugomods/base v0.1.0 h1:3o9Y85BvXHjkYzZfswM/EtthQ8GOYKN8aXHkIWqu3/8= +github.com/hugomods/base v0.1.0/go.mod h1:hnWCPbVxuhXBwdFax3mmbMlWKmIo/7OP36MCLOyHtT4= +github.com/hugomods/hugopress v0.1.0 h1:qktwbSWtbrEz/nX2wBmxDLzzS4o6/rjp7p0GWcOZ+PU= +github.com/hugomods/hugopress v0.1.0/go.mod h1:CRYvr60xOkZOf4Atkuj+uEj2EH5pjJ39Ws3aJAkoMkA= +github.com/hugomods/icons v0.6.0 h1:G6RU93okhPPRDh/jqcew9gwkcYpSpg0rCBv4S6yUAFw= +github.com/hugomods/icons v0.6.0/go.mod h1:cIkSvK6W0q6N4U6n9KGz+QfRWQXAW0INd+1P31gPNGg= +github.com/hugomods/icons/vendors/simple-icons v0.14.0 h1:PGMxDt1Akiuiigc5TSXNHwXNmkDu6/gTC1CGK+wRa4I= +github.com/hugomods/icons/vendors/simple-icons v0.14.0/go.mod h1:KOf0KCVA3Jor+RJuEv85KdLWYYmTtNhHhgDPJ0SZCRo= +github.com/hugomods/seo/modules/base v0.1.0 h1:ZEkWuYeRJeQakBkBThO3N3lmGzOZoPixs4pDugJXfJk= +github.com/hugomods/seo/modules/base v0.1.0/go.mod h1:qfm1Vga0eGxL+Szgz8Jopm+NtJ5PGov2a2dikTg1qSg= +github.com/hugomods/snackbar v0.1.2 h1:SLpfH9jlYwf81epH7DvM2XTZHo+3fXXpk6XKtxmo964= +github.com/hugomods/snackbar v0.1.2/go.mod h1:ykFm0IFibeQPuPAm8Gaa27xJS/bNZcSez4omVSl2gQ0= +github.com/twbs/bootstrap v5.3.0-alpha3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= +github.com/twbs/icons v1.10.5 h1:F9uvW7cGfDBAautw5aeCmnB3hw4vv3aEQGbHnzcQKaE= +github.com/twbs/icons v1.10.5/go.mod h1:GnRlymgVWp5iVJCMa0Me5b6tFyGpVc2bSxPMRGIJmyA= diff --git a/modules/staticman/hugo.toml b/modules/staticman/hugo.toml new file mode 100644 index 00000000..079a9640 --- /dev/null +++ b/modules/staticman/hugo.toml @@ -0,0 +1,17 @@ +[[module.imports]] +path = "github.com/hbstack/staticman-comments" + +[[module.imports]] +path = "github.com/hbstack/blog" + +[params.hugopress.modules.hb-blog-comments-staticman.hooks.hb-blog-post-comments] +weight = 1000 + +[params.hb.blog.staticman] +endpoint = "https://staticman.hugomods.com/" # required, replace with your own Staticman instance. +service = "github" # Git service provider: github, gitlab or onedev. +repo = "" # required, i.e. 'user/repo'. +branch = "main" # branch name. +property = "comments" # the name of Staticman property. +moderation = true +# required_fields = ["email", "url"] diff --git a/modules/staticman/layouts/partials/hugopress/modules/hb-blog-comments-staticman/hooks/hb-blog-post-comments.html b/modules/staticman/layouts/partials/hugopress/modules/hb-blog-comments-staticman/hooks/hb-blog-post-comments.html new file mode 100644 index 00000000..9d7610ed --- /dev/null +++ b/modules/staticman/layouts/partials/hugopress/modules/hb-blog-comments-staticman/hooks/hb-blog-post-comments.html @@ -0,0 +1,2 @@ +{{- $opts := site.Params.hb.blog.staticman }} +{{ partial "hb/modules/staticman-comments/index" $opts }}