feat: manifest.json improvements from #8126 (#8264)

* feat: manifest.json improvements from #8126

* Fix short title placeholder

* use lowercase letters for hex colors
This commit is contained in:
Opliko
2020-04-19 19:32:49 +02:00
committed by GitHub
parent 51eccef58b
commit 6e5ebb6184
4 changed files with 35 additions and 4 deletions

View File

@@ -146,7 +146,7 @@ uploadsController.uploadFavicon = async function (req, res, next) {
uploadsController.uploadTouchIcon = async function (req, res, next) {
const uploadedFile = req.files.files[0];
const allowedTypes = ['image/png'];
const sizes = [36, 48, 72, 96, 144, 192];
const sizes = [36, 48, 72, 96, 144, 192, 512];
if (validateUpload(res, uploadedFile, allowedTypes)) {
try {

View File

@@ -247,9 +247,12 @@ Controllers.robots = function (req, res) {
Controllers.manifest = function (req, res, next) {
var manifest = {
name: meta.config.title || 'NodeBB',
short_name: meta.config['title:short'] || meta.config.title || 'NodeBB',
start_url: nconf.get('relative_path') + '/',
display: 'standalone',
orientation: 'portrait',
theme_color: meta.config.themeColor || '#ffffff',
background_color: meta.config.backgroundColor || '#ffffff',
icons: [],
};
@@ -284,6 +287,11 @@ Controllers.manifest = function (req, res, next) {
sizes: '192x192',
type: 'image/png',
density: 4.0,
}, {
src: nconf.get('relative_path') + '/assets/uploads/system/touchicon-512.png',
sizes: '512x512',
type: 'image/png',
density: 10.0,
});
}
plugins.fireHook('filter:manifest.build', { req: req, res: res, manifest: manifest }, function (err, data) {