a a vibe-coded abomination experiment of a fragrance review platform built on the atmosphere. drydown.social

more meta tag fixes

+44 -18
+28 -17
functions/[[path]].ts
··· 159 159 160 160 // 3. Rewrite HTML 161 161 const pageUrl = url.toString(); 162 + const esc = (s: string) => s.replace(/"/g, '&quot;'); 163 + 162 164 const rewriter = new HTMLRewriter() 163 - .on('head', { 164 - element(element) { 165 - const esc = (s: string) => s.replace(/"/g, '&quot;'); 166 - const tags = ` 167 - <meta property="og:type" content="website" /> 168 - <meta property="og:url" content="${esc(pageUrl)}" /> 169 - <meta property="og:title" content="${esc(title)}" /> 170 - <meta property="og:description" content="${esc(description)}" /> 171 - <meta property="og:image" content="${esc(image)}" /> 172 - <meta property="twitter:card" content="summary_large_image" /> 173 - <meta property="twitter:url" content="${esc(pageUrl)}" /> 174 - <meta property="twitter:title" content="${esc(title)}" /> 175 - <meta property="twitter:description" content="${esc(description)}" /> 176 - <meta property="twitter:image" content="${esc(image)}" /> 177 - `; 178 - element.append(tags, { html: true }); 179 - } 165 + .on('meta[name="description"]', { 166 + element(element) { element.setAttribute('content', esc(description)); } 167 + }) 168 + .on('meta[property="og:url"]', { 169 + element(element) { element.setAttribute('content', esc(pageUrl)); } 170 + }) 171 + .on('meta[property="og:title"]', { 172 + element(element) { element.setAttribute('content', esc(title)); } 173 + }) 174 + .on('meta[property="og:description"]', { 175 + element(element) { element.setAttribute('content', esc(description)); } 176 + }) 177 + .on('meta[property="og:image"]', { 178 + element(element) { element.setAttribute('content', esc(image)); } 179 + }) 180 + .on('meta[property="twitter:url"]', { 181 + element(element) { element.setAttribute('content', esc(pageUrl)); } 182 + }) 183 + .on('meta[property="twitter:title"]', { 184 + element(element) { element.setAttribute('content', esc(title)); } 185 + }) 186 + .on('meta[property="twitter:description"]', { 187 + element(element) { element.setAttribute('content', esc(description)); } 188 + }) 189 + .on('meta[property="twitter:image"]', { 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 - <title>drydown</title> 7 + <title>Drydown - Fragrance Reviews</title> 8 + <meta name="description" content="Discover and track fragrances on Drydown." /> 9 + 10 + <!-- Open Graph Default Tags --> 11 + <meta property="og:type" content="website" /> 12 + <meta property="og:url" content="https://drydown.social/" /> 13 + <meta property="og:title" content="Drydown - Fragrance Reviews" /> 14 + <meta property="og:description" content="Discover and track fragrances on Drydown." /> 15 + <meta property="og:image" content="https://drydown.social/default-og.png" /> 16 + 17 + <!-- Twitter Default Tags --> 18 + <meta property="twitter:card" content="summary_large_image" /> 19 + <meta property="twitter:url" content="https://drydown.social/" /> 20 + <meta property="twitter:title" content="Drydown - Fragrance Reviews" /> 21 + <meta property="twitter:description" content="Discover and track fragrances on Drydown." /> 22 + <meta property="twitter:image" content="https://drydown.social/default-og.png" /> 8 23 </head> 9 24 <body> 10 25 <div id="app"></div>