From 4b3d20f43ff08147136436fc1c51c8b44ae8117c Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Mon, 21 Jun 2021 19:30:17 +0100 Subject: [PATCH] :label: Adds new data types for iconography, and documents --- docs/configuring.md | 3 ++- src/utils/ConfigSchema.json | 14 +++++++++++++- src/utils/defaults.js | 10 ++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/docs/configuring.md b/docs/configuring.md index 7eab0206..fe49336c 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -58,6 +58,7 @@ All fields are optional, unless otherwise stated. **`backgroundImg`** | `string` | _Optional_ | Path to an optional full-screen app background image. This can be either remote (http) or local (/). Note that this will slow down initial load **`enableFontAwesome`** | `boolean` | _Optional_ | Where `true` is enabled, if left blank font-awesome will be enabled only if required by 1 or more icons **`fontAwesomeKey`** | `string` | _Optional_ | If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`) +**`faviconApi`** | `string` | _Optional_ | Which service to use to resolve favicons. Set to `local` to do this locally, without using an API. Available options are: `local`, `faviconkit`, `google`, `clearbit`, `webmasterapi` and `allesedv`. Defaults to `faviconkit`. See [Icons](/docs/icons.md#favicons) for more info **`layout`** | `string` | _Optional_ | App layout, either `horizontal`, `vertical`, `auto` or `sidebar`. Defaults to `auto`. This specifies the layout and direction of how sections are positioned on the home screen. This can also be modified from the UI. **`iconSize`** | `string` | _Optional_ | The size of link items / icons. Can be either `small`, `medium,` or `large`. Defaults to `medium`. This can also be set directly from the UI. **`theme`** | `string` | _Optional_ | The default theme for first load (you can change this later from the UI) @@ -125,7 +126,7 @@ All fields are optional, unless otherwise stated. **Field** | **Type** | **Required**| **Description** --- | --- | --- | --- -**`icon`** | `string` | _Optional_ | The icon for a given item or section. Can be a font-awesome icon, favicon, remote URL or local URL. If set to `favicon`, the icon will be automatically fetched from the items website URL. To use font-awesome, specify the category, followed by the icon name, e.g. `fas fa-rocket`, `fab fa-monero` or `fal fa-duck` - note that to use pro icons, you mut specify `appConfig.fontAwesomeKey`. You can also use hosted any by specifying it's URL, e.g. `https://i.ibb.co/710B3Yc/space-invader-x256.png`. To use a local image, first store it in `./public/item-icons/` (or `-v /app/public/item-icons/` in Docker) , and reference it by name and extension - e.g. set `image.png` to use `./public/item-icon/image.png`, you can also use sub-folders if you have a lot of icons, to keep them organised. +**`icon`** | `string` | _Optional_ | The icon for a given item or section. Can be a font-awesome icon, favicon, remote URL or local URL. If set to `favicon`, the icon will be automatically fetched from the items website URL. To use font-awesome, specify the category, followed by the icon name, e.g. `fas fa-rocket`, `fab fa-monero` or `fal fa-duck` - note that to use pro icons, you mut specify `appConfig.fontAwesomeKey`. If set to `generative`, then a unique icon is generated from the apps URL or IP. You can also use hosted any by specifying it's URL, e.g. `https://i.ibb.co/710B3Yc/space-invader-x256.png`. To use a local image, first store it in `./public/item-icons/` (or `-v /app/public/item-icons/` in Docker) , and reference it by name and extension - e.g. set `image.png` to use `./public/item-icon/image.png`, you can also use sub-folders if you have a lot of icons, to keep them organised. **[⬆️ Back to Top](#configuring)** diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index 1b89dc8b..edf2db4d 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -69,6 +69,18 @@ "pattern": "^[a-z0-9]{10}$", "description": "API key for font-awesome" }, + "faviconApi": { + "enum": [ + "local", + "faviconkit", + "google", + "clearbit", + "webmasterapi", + "allesedv" + ], + "default": "faviconkit", + "description": "Which service to use to resolve favicons. Set to local to do this locally instead" + }, "layout": { "enum": [ "horizontal", @@ -263,7 +275,7 @@ "icon": { "type": "string", "nullable": true, - "description": "An icon, either as a font-awesome identifier, local or remote URL, or auto-fetched favicon" + "description": "An icon, either as a font-awesome identifier, local or remote URL, or the word favicon or generative" }, "url": { "type": "string", diff --git a/src/utils/defaults.js b/src/utils/defaults.js index edffb222..b2fcb00c 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -13,6 +13,7 @@ module.exports = { layout: 'auto', theme: 'default', fontAwesomeKey: '0821c65656', + faviconApi: 'faviconkit', builtInThemes: [ 'callisto', 'thebe', @@ -81,4 +82,13 @@ module.exports = { metaTagData: [ { name: 'description', content: 'A simple static homepage for you\'re server' }, ], + faviconApiEndpoints: { + mcapi: 'https://eu.mc-api.net/v3/server/favicon/$URL', + clearbit: 'https://logo.clearbit.com/$URL', + faviconkit: 'https://api.faviconkit.com/$URL/64', + // favicongrabber: 'https://favicongrabber.com//api/grab/$URL', + google: 'https://www.google.com/s2/favicons?sz=128&domain_url=$URL', + allesedv: 'https://f1.allesedv.com/128/$URL', + webmasterapi: 'https://api.webmasterapi.com/v1/favicon/yEwx0ZFs0CSPshHq/$URL', + }, };