# Web Manifest

**URL:** https://zola.discourse.group/t/web-manifest/1083
**Category:** Feature requests
**Created:** [November 5, 2021, 5:44am UTC](https://zola.discourse.group/t/web-manifest/1083 "2021-11-05T05:44:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sirinath](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sirinath/32/153_2.png) [@sirinath](https://zola.discourse.group/u/sirinath)
#### Post date: [November 5, 2021, 5:44am UTC](https://zola.discourse.group/t/web-manifest/1083/1 "2021-11-05T05:44:31Z")

</div>

Can generated Web Manifest and generation of similar site files be supported.

---

<div class="post-metadata">

### Author: ![keats](https://avatars.discourse-cdn.com/v4/letter/k/34f0e0/32.png) [@keats](https://zola.discourse.group/u/keats)
#### Post date: [November 5, 2021, 10:22am UTC](https://zola.discourse.group/t/web-manifest/1083/2 "2021-11-05T10:22:27Z")

</div>

Zola is not really meant for PWA, what do you use web manifests for in a static site?

---

<div class="post-metadata">

### Author: ![sirinath](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sirinath/32/153_2.png) [@sirinath](https://zola.discourse.group/u/sirinath)
#### Post date: [November 5, 2021, 3:19pm UTC](https://zola.discourse.group/t/web-manifest/1083/3 "2021-11-05T15:19:09Z")

</div>

Mainly explicitly set the different favicons.

Also looking to generate [humans.txt](https://humanstxt.org), `security.txt`, `hackers.txt`, etc. and other such files for completeness.

---

<div class="post-metadata">

### Author: ![sirinath](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sirinath/32/153_2.png) [@sirinath](https://zola.discourse.group/u/sirinath)
#### Post date: [November 5, 2021, 4:32pm UTC](https://zola.discourse.group/t/web-manifest/1083/4 "2021-11-05T16:32:25Z")

</div>

These are Hugo templates below.

`.\assets\browserconfig.xml`

```auto
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
  <msapplication>
    <tile>
	  {{ range $val := (index $.Site.Data.icons "msapplication").icons }}
		{{ if ne $val "TileImage" }}
      <{{- $val.type }} src="{{- $val.file -}}" />
		{{ end }}
	  {{ end }}
	  {{ with index (index $.Site.Data.manifests "msapplication-config") "tile-color" }}
      <TileColor>{{- . -}}</TileColor>
	  {{ end }}
    </tile>
  </msapplication>
</browserconfig>

```

`.\assets\site.webmanifest`

```auto
{
	"name": "{{- .Site.Title -}}",
	"short_name": "{{- .Site.Title -}}",
	"lang": "{{site.LanguageCode}}",
{{ with $.Site.Params.description }}
	"description": "{{- . -}}",
{{ end }}
	{{ with index $.Site.Data.manifests.webmanifest "theme-color" }}
	"theme_color": "{{- . -}}",
	{{ end }}
	{{ with index $.Site.Data.manifests.webmanifest "background-color" }}
	"background_color": "{{- . -}}",
	{{ end }}
	"display": "standalone".
	"start_url": "/",
	"scope": "/",
	"icons": [
{{ $i := 0 }}
{{ range $favicon := $.Site.Data.icons }}
	{{ range $icon := $favicon.icons }}
		{{ if (fileExists $icon.file) }}
			{{ $image_ext := path.Ext $icon.file }}
			{{ if eq $image_ext "ico" }}
				{{ $image_ext := "x-icon" }}
			{{ else if eq $image_ext "svg" }}
				{{ $image_ext := "svg+xml" }}
			{{ else if eq $image_ext "jpg" }}
				{{ $image_ext := "jpeg" }}
			{{ else if eq $image_ext "tif" }}
				{{ $image_ext := "tiff" }}
			{{ end }}
			
			{{- if ne $i 0 }}
		,
			{{ end }}
			{{ $i = $i + 1 }}
		{
			"src": "{{- $icon.file -}}",
		{{ with $icon.size }}
			"sizes": "{{- . -}}",
		{{ end }}
			"type": "image/{{- $image_ext -}}"
		}
		{{ end }}
	{{ end }}
{{ end }}
	],
	"categories": [
{{ $i := 0 }}
{{ range $categories := $.Site.Data.manifests.webmanifest.categories }}
	{{- if ne $i 0 }}
		,
	{{ end }}
	{{ $i = $i + 1 }}
	 "{{- $categories -}}"
{{ end }}
	],
	"shortcuts" : [
{{ $oi := 0 }}
{{ range $menue := $.Site.Menus }}
	{{- if ne $oi 0 }}
	,
	{{ end }}
	{{ $oi = $oi + 1 }}
	{
		"name": "{{- $menue.name -}}",
		"url": "{{- $menue.url -}}",
		"description": "{{- $menue.title -}}",
		{{ with .Site.GetPage $menue.url }}
		"icons": [
			{{ $ii := 0 }}
			{{ range $icon := .images }}
				{{ if (fileExists $icon.file) }}
					{{ $image_ext := path.Ext $icon.file }}
					{{ if eq $image_ext "ico" }}
						{{ $image_ext = "x-icon" }}
					{{ else if eq $image_ext "svg" }}
						{{ $image_ext = "svg+xml" }}
					{{ else if eq $image_ext "jpg" }}
						{{ $image_ext = "jpeg" }}
					{{ else if eq $image_ext "tif" }}
						{{ $image_ext = "tiff" }}
					{{ end }}
				
					{{- if ne $ii 0 }}
			,
					{{ end }}
					{{ $ii = $ii + 1 }}
			{ 
				"src": "{{- $icon.file -}}", 
				{{ with $icon.size }}
				"sizes": "{{- . -}}",
				{{ end }}
				"type": "image/{{- $image_ext -}}" 
			}
				{{ end }}
			{{ end }}
		]
		{{ end }}
	}
{{ end }}
	]
}

```

Want to be able to do the same in Zola. Essentially port the code from the theme.

---

<div class="post-metadata">

### Author: ![sirinath](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/sirinath/32/153_2.png) [@sirinath](https://zola.discourse.group/u/sirinath)
#### Post date: [November 16, 2021, 1:25pm UTC](https://zola.discourse.group/t/web-manifest/1083/5 "2021-11-16T13:25:42Z")

</div>

Essentially this is having non `.html` templates and a mechanism to evoke the template with data from another `md` or non `md` file and produce a non `html` output. Other than this nothing special need to be done. What is needed is a generalisation of what is already been done with `html` and `md` files which can be the default.
