tangled
alpha
login
or
join now
taurean.bryant.land
/
drydown
1
fork
atom
a a vibe-coded abomination experiment of a fragrance review platform built on the atmosphere.
drydown.social
1
fork
atom
overview
issues
pulls
pipelines
more meta tag fixes
taurean.bryant.land
2 weeks ago
e4fa26c8
58937268
+44
-18
2 changed files
expand all
collapse all
unified
split
functions
[[path]].ts
index.html
+28
-17
functions/[[path]].ts
···
159
159
160
160
// 3. Rewrite HTML
161
161
const pageUrl = url.toString();
162
162
+
const esc = (s: string) => s.replace(/"/g, '"');
163
163
+
162
164
const rewriter = new HTMLRewriter()
163
163
-
.on('head', {
164
164
-
element(element) {
165
165
-
const esc = (s: string) => s.replace(/"/g, '"');
166
166
-
const tags = `
167
167
-
<meta property="og:type" content="website" />
168
168
-
<meta property="og:url" content="${esc(pageUrl)}" />
169
169
-
<meta property="og:title" content="${esc(title)}" />
170
170
-
<meta property="og:description" content="${esc(description)}" />
171
171
-
<meta property="og:image" content="${esc(image)}" />
172
172
-
<meta property="twitter:card" content="summary_large_image" />
173
173
-
<meta property="twitter:url" content="${esc(pageUrl)}" />
174
174
-
<meta property="twitter:title" content="${esc(title)}" />
175
175
-
<meta property="twitter:description" content="${esc(description)}" />
176
176
-
<meta property="twitter:image" content="${esc(image)}" />
177
177
-
`;
178
178
-
element.append(tags, { html: true });
179
179
-
}
165
165
+
.on('meta[name="description"]', {
166
166
+
element(element) { element.setAttribute('content', esc(description)); }
167
167
+
})
168
168
+
.on('meta[property="og:url"]', {
169
169
+
element(element) { element.setAttribute('content', esc(pageUrl)); }
170
170
+
})
171
171
+
.on('meta[property="og:title"]', {
172
172
+
element(element) { element.setAttribute('content', esc(title)); }
173
173
+
})
174
174
+
.on('meta[property="og:description"]', {
175
175
+
element(element) { element.setAttribute('content', esc(description)); }
176
176
+
})
177
177
+
.on('meta[property="og:image"]', {
178
178
+
element(element) { element.setAttribute('content', esc(image)); }
179
179
+
})
180
180
+
.on('meta[property="twitter:url"]', {
181
181
+
element(element) { element.setAttribute('content', esc(pageUrl)); }
182
182
+
})
183
183
+
.on('meta[property="twitter:title"]', {
184
184
+
element(element) { element.setAttribute('content', esc(title)); }
185
185
+
})
186
186
+
.on('meta[property="twitter:description"]', {
187
187
+
element(element) { element.setAttribute('content', esc(description)); }
188
188
+
})
189
189
+
.on('meta[property="twitter:image"]', {
190
190
+
element(element) { element.setAttribute('content', esc(image)); }
180
191
})
181
192
.on('title', {
182
193
element(element) {
+16
-1
index.html
···
4
4
<meta charset="UTF-8" />
5
5
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
6
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
-
<title>drydown</title>
7
7
+
<title>Drydown - Fragrance Reviews</title>
8
8
+
<meta name="description" content="Discover and track fragrances on Drydown." />
9
9
+
10
10
+
<!-- Open Graph Default Tags -->
11
11
+
<meta property="og:type" content="website" />
12
12
+
<meta property="og:url" content="https://drydown.social/" />
13
13
+
<meta property="og:title" content="Drydown - Fragrance Reviews" />
14
14
+
<meta property="og:description" content="Discover and track fragrances on Drydown." />
15
15
+
<meta property="og:image" content="https://drydown.social/default-og.png" />
16
16
+
17
17
+
<!-- Twitter Default Tags -->
18
18
+
<meta property="twitter:card" content="summary_large_image" />
19
19
+
<meta property="twitter:url" content="https://drydown.social/" />
20
20
+
<meta property="twitter:title" content="Drydown - Fragrance Reviews" />
21
21
+
<meta property="twitter:description" content="Discover and track fragrances on Drydown." />
22
22
+
<meta property="twitter:image" content="https://drydown.social/default-og.png" />
8
23
</head>
9
24
<body>
10
25
<div id="app"></div>