From d777587682ffa2da154f064566f27abd3f20381e Mon Sep 17 00:00:00 2001 From: kdevo Date: Sat, 30 Apr 2022 19:24:43 +0200 Subject: feat(mod): add release-notify module - notifies user whenever a new theme version exists online - add new config option `notifyOnNewThemeVersion` --- config.toml | 4 +++- data/release_notify.yaml | 3 +++ exampleSite/config.yaml | 6 +++++- exampleSite/go.mod | 6 +++++- exampleSite/go.sum | 1 + go.mod | 5 +++-- go.sum | 6 ++++++ layouts/index.html | 3 +++ layouts/partials/head.html | 2 +- 9 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 data/release_notify.yaml diff --git a/config.toml b/config.toml index 69cd563..82dc82e 100644 --- a/config.toml +++ b/config.toml @@ -5,4 +5,6 @@ [[module.imports]] path = "github.com/hugo-mods/icons" [[module.imports]] - path = "github.com/hugo-mods/lazyimg" \ No newline at end of file + path = "github.com/hugo-mods/lazyimg" + [[module.imports]] + path = "github.com/hugo-mods/release-notify" \ No newline at end of file diff --git a/data/release_notify.yaml b/data/release_notify.yaml new file mode 100644 index 0000000..ad49052 --- /dev/null +++ b/data/release_notify.yaml @@ -0,0 +1,3 @@ +modules: + "github.com/kdevo/osprey-delight": + type: minor diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 779b262..53b5864 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -91,10 +91,14 @@ Params: #structuredDataGitHubUser = "USERNAME" # useTermynal enables Termynal (https://github.com/ines/termynal), a small JS library for showing a terminal "animation" from within your gallery item. - # The cool thing is that the library has been stripped-down to a minimum to only have the necessary functionality. + # The library has been stripped-down to a minimum to only have the necessary functionality. useTermynal: true googleTagManager: "" + + # notifyOnNewThemeVersion enables a notification for every new minor/major version of this theme. + # Whenever there is a new one, a warning is printed to console. + notifyOnNewThemeVersion: true # Image resizing can be configured here (see README for more info): Image: diff --git a/exampleSite/go.mod b/exampleSite/go.mod index 98c1e25..15e4eb2 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -2,4 +2,8 @@ module github.com/kdevo/osprey-delight/exampleSite go 1.13 -require github.com/kdevo/osprey-delight v1.3.2-0.20211101194641-3a580e4f06b2 // indirect +require ( + github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c // indirect + github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b // indirect + github.com/kdevo/osprey-delight v1.3.2-0.20211101194641-3a580e4f06b2 // indirect +) diff --git a/exampleSite/go.sum b/exampleSite/go.sum index ab6a816..c745923 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -2,6 +2,7 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20210316185733-d79d85c3fad8/go.mod h1 github.com/aFarkas/lazysizes v0.0.0-20210408151554-27c7ceb7d737/go.mod h1:xl3heUINAn0oPowV1biDQ2Pyw1w3x66I7KEbWkaxox0= github.com/hugo-mods/icons v0.0.0-20210529220701-c35284b03de7 h1:QXVb2NaUpupbHlbas1WKUjFjPihTYKmFrdiXVZkSl54= github.com/hugo-mods/icons v0.0.0-20210529220701-c35284b03de7/go.mod h1:sPodUyqumOYz75PKIwmqOYZXLIcLAujn7V9+1Hk4VW8= +github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c h1:8eEG4rcYj959u1AbjdPl52i0ICQ6IFpfcrisj+VJixo= github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c/go.mod h1:sPodUyqumOYz75PKIwmqOYZXLIcLAujn7V9+1Hk4VW8= github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b h1:0MDKO30RMN6Q3D3tqSRdZpaofnS0qVRP6fIgU1XZuAA= github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b/go.mod h1:mUw/5rIlzxiJfDnKsFnZAITZ29I7n3QeDd8WwGsBmTI= diff --git a/go.mod b/go.mod index ab9a9e7..b5a486d 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/kdevo/osprey-delight go 1.13 require ( - github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c // indirect - github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b // indirect + github.com/hugo-mods/icons v0.0.0-20211204094455-ce8763589b4a // indirect + github.com/hugo-mods/lazyimg v0.0.0-20211204103006-f8df703cfde3 // indirect + github.com/hugo-mods/release-notify v0.0.0-20211204183217-31d5f4d05aba // indirect ) diff --git a/go.sum b/go.sum index b40bdb9..3b3351f 100644 --- a/go.sum +++ b/go.sum @@ -2,5 +2,11 @@ github.com/FortAwesome/Font-Awesome v0.0.0-20210316185733-d79d85c3fad8/go.mod h1 github.com/aFarkas/lazysizes v0.0.0-20210408151554-27c7ceb7d737/go.mod h1:xl3heUINAn0oPowV1biDQ2Pyw1w3x66I7KEbWkaxox0= github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c h1:8eEG4rcYj959u1AbjdPl52i0ICQ6IFpfcrisj+VJixo= github.com/hugo-mods/icons v0.0.0-20210829123108-ff66eab2332c/go.mod h1:sPodUyqumOYz75PKIwmqOYZXLIcLAujn7V9+1Hk4VW8= +github.com/hugo-mods/icons v0.0.0-20211204094455-ce8763589b4a h1:ZT9rx0pweU4vmYITDwESn8+0jG2VHTNaWK0zqD+ZknA= +github.com/hugo-mods/icons v0.0.0-20211204094455-ce8763589b4a/go.mod h1:sPodUyqumOYz75PKIwmqOYZXLIcLAujn7V9+1Hk4VW8= github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b h1:0MDKO30RMN6Q3D3tqSRdZpaofnS0qVRP6fIgU1XZuAA= github.com/hugo-mods/lazyimg v0.0.0-20211031211233-5d343cb6506b/go.mod h1:mUw/5rIlzxiJfDnKsFnZAITZ29I7n3QeDd8WwGsBmTI= +github.com/hugo-mods/lazyimg v0.0.0-20211204103006-f8df703cfde3 h1:oHkDP/qoX2nAXnqkKcJu7WtVtKf7PMlgF13Q5O+WQt4= +github.com/hugo-mods/lazyimg v0.0.0-20211204103006-f8df703cfde3/go.mod h1:mUw/5rIlzxiJfDnKsFnZAITZ29I7n3QeDd8WwGsBmTI= +github.com/hugo-mods/release-notify v0.0.0-20211204183217-31d5f4d05aba h1:MKmr7sMNdXcgR0fpNX1O+c2rrDF9zdZnO3G3LShx0cc= +github.com/hugo-mods/release-notify v0.0.0-20211204183217-31d5f4d05aba/go.mod h1:RYv2eTG8LmJsxnEajLP4wkOLK3GDmwNterXVWgW6DYA= diff --git a/layouts/index.html b/layouts/index.html index a842d47..019eb47 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -27,3 +27,6 @@ {{ partial "body-bottom" . }} +{{ if .Site.Params.Feat.notifyOnNewThemeVersion }} + {{ partial "release-notify" site.Data.release_notify }} +{{ end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 6c33b32..596ead5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -87,7 +87,7 @@ - {{/* Validate what we have rendered to prevent bad surprises */}} + {{/* Validate what we have rendered so that we don't render something that is not readable by a robot */}} {{ $_ := unmarshal $s }} {{- end }} -- cgit v1.2.3