Skip to content

Commit 527e830

Browse files
authored
Merge pull request element-hq#6317 from vector-im/dbkr/og_image_sort_of_configurable
Remove og:image with status.im URL
2 parents 0db7b03 + 96f374e commit 527e830

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ For a good example, see https://riot.im/develop/config.json
149149
with referral tracking; please ignore it.
150150
1. `welcomeUserId`: the user ID of a bot to invite whenever users register that can give them a tour
151151

152+
153+
Note that `index.html` also has an og:image meta tag that is set to an image
154+
hosted on riot.im. This is the image used if links to your copy of Riot
155+
appear in some websites like Facebook, and indeed Riot itself. This has to be
156+
static in the HTML and an absolute URL (and HTTP rather than HTTPS), so it's
157+
not possible for this to be an option in config.json. If you'd like to change
158+
it, you can build Riot as above, but run
159+
`RIOT_OG_IMAGE_URL="http://example.com/logo.png" npm run build`.
160+
Alternatively, you can edit the `og:image` meta tag in `index.html` directly
161+
each time you download a new version of Riot.
162+
152163
Running as a Desktop app
153164
========================
154165

src/vector/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<meta name="msapplication-TileImage" content="vector-icons/mstile-144x144.png">
2121
<meta name="msapplication-config" content="vector-icons/browserconfig.xml">
2222
<meta name="theme-color" content="#ffffff">
23-
<meta property="og:image" content="https://chat.status.im/img/logos/riot-im-logo-1.png" />
23+
<meta property="og:image" content="<%= htmlWebpackPlugin.options.vars.og_image_url %>" />
2424
<% for (var i=0; i < htmlWebpackPlugin.files.css.length; i++) {
2525
var file = htmlWebpackPlugin.files.css[i];
2626
var match = file.match(/^bundles\/.*?\/theme-(.*)\.css$/);

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ const webpack = require('webpack');
33
const ExtractTextPlugin = require('extract-text-webpack-plugin');
44
const HtmlWebpackPlugin = require('html-webpack-plugin');
55

6+
let og_image_url = process.env.RIOT_OG_IMAGE_URL;
7+
if (!og_image_url) og_image_url = 'https://riot.im/app/img/logos/riot-im-logo-1.png';
8+
69
module.exports = {
710
entry: {
811
"bundle": "./src/vector/index.js",
@@ -123,6 +126,9 @@ module.exports = {
123126
// bottom of <head> or the bottom of <body>, and I'm a bit scared
124127
// about moving them.
125128
inject: false,
129+
vars: {
130+
og_image_url: og_image_url,
131+
},
126132
}),
127133
],
128134
devtool: 'source-map',

0 commit comments

Comments
 (0)