Skip to content

Commit b17d22d

Browse files
authored
fix: og:title/image and fontFamily (#1082)
1 parent 6cadc65 commit b17d22d

File tree

5 files changed

+36
-4
lines changed

5 files changed

+36
-4
lines changed

.infra/rdev/values.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ stack:
22
services:
33
explorer:
44
image:
5-
tag: sha-06531c84
5+
tag: sha-78bf2226
66
replicaCount: 1
77
env:
88
# env vars common to all deployment stages

client/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@
6666
>
6767

6868
<div id="root"></div>
69+
<!-- Inject open graph image -->
70+
<script>
71+
document
72+
.querySelector('meta[property="og:image"]')
73+
.setAttribute(
74+
"content",
75+
`${window.location.pathname}static/images/cxg-explorer-og.jpg`
76+
);
77+
</script>
6978
<!-- for local testing add / to your file path /static/... -->
7079
<script
7180
async

client/index_template.html

+18
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<title>CELL&times;GENE | Explorer</title>
7+
<meta property="og:title" content="CELLxGENE | Explorer" />
8+
<meta property="og:image" content="static/images/cxg-explorer-og.jpg" />
79
<style>
810
html,
911
body,
@@ -35,6 +37,13 @@
3537
box-sizing: border-box;
3638
}
3739
</style>
40+
<link rel="preconnect" href="https://fonts.googleapis.com" />
41+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
42+
<link
43+
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,400&display=swap"
44+
rel="stylesheet"
45+
crossorigin="anonymous"
46+
/>
3847
<script>
3948
var script = document.createElement('script')
4049
script.defer=true
@@ -58,6 +67,15 @@
5867
</noscript>
5968

6069
<div id="root"></div>
70+
<!-- Inject open graph image -->
71+
<script>
72+
document
73+
.querySelector('meta[property="og:image"]')
74+
.setAttribute(
75+
"content",
76+
`${window.location.pathname}static/images/cxg-explorer-og.jpg`
77+
);
78+
</script>
6179
<!-- for local testing add / to your file path /static/... -->
6280
<script
6381
async

client/src/components/theme.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ export const cornersNone = (props: CommonThemeProps) => getCorners(props)?.none;
6060
const tabularNums = "tabular-nums";
6161

6262
const typography = {
63-
fontFamily: "Roboto Condensed",
63+
fontFamily: {
64+
body: "Roboto Condensed",
65+
caps: "Roboto Condensed",
66+
header: "Roboto Condensed",
67+
tabular: "Roboto Condensed",
68+
},
6469

6570
styles: {
6671
body: {
@@ -428,7 +433,6 @@ export const shadowL = (props: CommonThemeProps) => getShadows(props)?.l;
428433
export const shadowM = (props: CommonThemeProps) => getShadows(props)?.m;
429434
export const shadowS = (props: CommonThemeProps) => getShadows(props)?.s;
430435

431-
// @ts-expect-error due to Typography mismatch in ThemeOptions
432436
const appTheme = makeThemeOptions(themeOptions);
433437

434438
export const theme = createTheme(appTheme);

server/ecs/app.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def _before_adding_routes(app, app_config):
5050
"form-action": ["'self'", HUBSPOT_FORMS_URL],
5151
"connect-src": ["'self'", PLAUSIBLE_URL, HUBSPOT_FORMS_URL, EXPLORER_DEV_URL] + extra_connect_src,
5252
"script-src": ["'self'", "'unsafe-eval'", PLAUSIBLE_URL, HUBSPOT_FORMS_URL, HUBSPOT_JS_URL] + script_hashes,
53-
"style-src": ["'self'", "'unsafe-inline'"],
53+
"style-src": ["'self'", "'unsafe-inline'", "https://fonts.googleapis.com"],
54+
"font-src": ["'self'", "https://fonts.gstatic.com"],
5455
"img-src": ["'self'", "https://cellxgene.cziscience.com", EXPLORER_DEV_URL]
5556
+ extra_connect_src
5657
+ ["data:", HUBSPOT_FORMS_URL],

0 commit comments

Comments
 (0)