1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-21 16:13:00 +00:00

Add meta theme-color support

This commit is contained in:
Starbeamrainbowlabs 2020-05-24 01:59:05 +01:00
parent 6c11ef4957
commit 093b405182
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
3 changed files with 7 additions and 1 deletions

View file

@ -15,6 +15,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Added automatic table of contents! (#155)
- Put `[__TOC__]` on a line by itself to insert an automatic table of contents
- Note that the level of heading generated can be controlled (or even removed) by the new `parser_toc_heading_level` setting
- Add `<meta name="theme-color" content="value" />` support with the new `theme_colour` setting. More information: [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color), [caniuse](https://caniuse.com/#feat=meta-theme-color). Also used by some platforms to customise embed accents when generating a rich snippet (e.g. Discord).
### Changed
- Fiddled with Parsedown & ParsedownExtra versions

View file

@ -18,6 +18,7 @@ class page_renderer
<title>{title}</title>
<meta name='viewport' content='width=device-width, initial-scale=1' />
<meta name='generator' content='Pepperminty Wiki {version}' />
<meta name='application-name' content='Pepperminty Wiki {version}' />
<link rel='shortcut-icon' href='{favicon-url}' />
<link rel='icon' href='{favicon-url}' />
{header-html}
@ -266,6 +267,9 @@ class page_renderer
$result .= self::get_css_as_html();
$result .= self::_get_js();
if(!empty($settings->theme_colour))
$result .= "\t\t<meta name='theme-color' content='$settings->theme_colour' />\n";
// We can't use module_exists here because sometimes global $modules
// hasn't populated yet when we get called O.o
if(class_exists("search"))

View file

@ -75,7 +75,8 @@
"interwiki_index_location": { "type": "text", "description": "The location to find the interwiki wiki definition file, which contains a list of wikis along with their names, prefixes, and root urls. May be a URL, or simply a file path - as it's passed to file_get_contents(). If left blank, interwiki link parsing is disabled.", "default": null },
"clean_raw_html": { "type": "checkbox", "description": "Whether page sources should be cleaned of HTML before rendering. It is STRONGLY recommended that you keep this option turned on.", "default": true },
"all_untrusted": { "type": "checkbox", "description": "Whether to treat both page sources and comment text as untrusted input. Untrusted input has additional restrictions to protect against XSS attacks etc. Turn on if your wiki allows anonymous edits.", "default": false},
"enable_math_rendering": { "type": "checkbox", "description": "Whether to enable client side rendering of mathematical expressions with MathJax (https://www.mathjax.org/). Math expressions should be enclosed inside of dollar signs ($). Turn off if you don't use it.", "default": true},
"enable_math_rendering": { "type": "checkbox", "description": "Whether to enable client side rendering of mathematical expressions with MathJax (https://www.mathjax.org/). Math expressions should be enclosed inside of dollar signs ($). Turn off if you don't use it.", "default": true },
"theme_colour": { "type": "text", "description": "The theme colour to set in the <code>&lt;meta name='theme-color' content='value' /&gt;</code> meta tag. Apparently used to customise the UI colour on mobile devices, and also by when platforms such as Discord are generating rich embeds to set the accent colour. Set to an empty string to disable.", "default": "#fc1c1c" },
"users": { "type": "usertable", "description": "An array of usernames and passwords - passwords should be hashed with password_hash() (the hash action can help here)", "default": {
"admin": {
"email": "admin@somewhere.com",