Skip to content

Latest commit

 

History

History
 
 

pwa

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Progressive Web App

PWA Module

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

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

PWA Implementation

Call it, as a partial in your theme head.

<!-- progressive web app -->
{{ partial "manifest.html" . }}

Call it, as a partial in your theme footer.

<!-- progressive web app -->
{{ partial "pwa.html" . }}

Add some following configuration to your config/_default/config.toml file.

############################# Outputs ##############################
[outputs]
home = ["WebAppManifest"]

############################ Media types ############################
[mediaTypes]
[mediaTypes."application/manifest+json"]
suffixes = ["webmanifest"]

############################ Output Format ###########################
[outputFormats]
[outputFormats.WebAppManifest]
mediaType = "application/manifest+json"
rel = "manifest"