-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement #181 - web app manifest support
This feature will allow sites built with Perun to be installed as an app on systems that support it. When paired with #180, this will be a slick offline experience.
- Loading branch information
Showing
3 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
(ns io.perun.manifest | ||
(:require [cheshire.core :refer [generate-string]])) | ||
|
||
(defn manifest | ||
[{:keys [icons site-title theme-color display scope input-paths] :as data}] | ||
(let [manifest {:name site-title | ||
:icons (for [{:keys [permalink width height mime-type]} icons] | ||
{:src permalink | ||
:sizes (str width "x" height) | ||
:type mime-type}) | ||
:theme_color theme-color | ||
:display display | ||
:scope scope}] | ||
{:rendered (generate-string manifest) | ||
:input-paths input-paths})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters