Skip to content

Commit

Permalink
Define name and description in single location
Browse files Browse the repository at this point in the history
  • Loading branch information
nenadalm committed Apr 13, 2024
1 parent fda58fc commit 6a2ac26
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
5 changes: 5 additions & 0 deletions src/build/config.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns build.config
(:refer-clojure :exclude [name]))

(def name "Backgammon")
(def description "Backgammon game with local multiplayer (no single player).")
7 changes: 4 additions & 3 deletions src/build/create_index.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns build.create-index
(:require
[build.util :as u]))
[build.util :as u]
[build.config :as c]))

(defn render [module-id->output-name]
(str
Expand All @@ -11,8 +12,8 @@
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">
<meta name=\"theme-color\" content=\"#121212\">
<meta name=\"app-version\" content=\"" (u/app-version) "\">
<meta name=\"description\" content=\"Backgammon app that works offline.\">
<title>Backgammon</title>
<meta name=\"description\" content=\"" c/description "\">
<title>" c/name "</title>
<link rel=\"stylesheet\" href=\"" (u/asset "css/styles.css" module-id->output-name) "\">
<link rel=\"icon\" href=\"" (u/asset "img/icon.svg" module-id->output-name) "\" type=\"image/svg+xml\">
<link rel=\"apple-touch-icon\" href=\"" (u/asset "img/icon_192.png" module-id->output-name) "\">
Expand Down
7 changes: 4 additions & 3 deletions src/build/create_manifest.clj
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
(ns build.create-manifest
(:require
[jsonista.core :as j]
[build.util :as u]))
[build.util :as u]
[build.config :as c]))

(defn render [module-id->output-name]
(j/write-value-as-string
{:name "Backgammon"
:description "Backgammon game with local multiplayer (no single player)."
{:name c/name
:description c/description
:categories ["games"]
:icons [{:src (u/asset "img/icon.svg" module-id->output-name)
:sizes "any"
Expand Down

0 comments on commit 6a2ac26

Please sign in to comment.