DEV: Add theme-color meta to bootstrap (#13615)

It's rendered in Rails in:

ebcc70a5ba/app/views/layouts/_head.html.erb (L9-L9)
This commit is contained in:
Jarek Radosz 2021-07-02 16:43:10 +02:00 committed by GitHub
parent 926889e2d4
commit fdb85b8025
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -34,12 +34,17 @@ function head(buffer, bootstrap) {
buffer.push(`<meta name="csrf-param" content="authenticity_token">`);
buffer.push(`<meta name="csrf-token" content="${bootstrap.csrf_token}">`);
}
if (bootstrap.theme_id) {
buffer.push(
`<meta name="discourse_theme_id" content="${bootstrap.theme_id}">`
);
}
if (bootstrap.theme_color) {
buffer.push(`<meta name="theme-color" content="${bootstrap.theme_color}">`);
}
let setupData = "";
Object.keys(bootstrap.setup_data).forEach((sd) => {
let val = bootstrap.setup_data[sd];

View File

@ -54,6 +54,7 @@ class BootstrapController < ApplicationController
bootstrap = {
theme_id: theme_id,
theme_color: "##{ColorScheme.hex_for_name('header_background', scheme_id)}",
title: SiteSetting.title,
current_homepage: current_homepage,
locale_script: locale,