Skip to content

Latest commit

 

History

History

announcement

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Announcement components

Install Module

Add the following code to your module list in the config/_default/module.toml file.

[[imports]]
path = "github.com/gethugothemes/hugo-modules/components/announcement"

Add the following code to your js plugins list in the hugo.toml or config.toml file.

[[params.plugins.js]]
link = "plugins/cookie.js"

Announcement Implementation

Call it, as a partial in your baseof.html file over the header partial.

<!-- cookie consent -->
{{ partialCached "announcement.html" . }}

Call it, as a partial into bottom of script.html file.

<!-- cookie consent -->
{{ partialCached "announcement-script.html" . }}

Configure it in the config/_default/params.toml file.

# announcement
[announcement]
enable = true
expire_days = 7
content = "This is a test announcement"