Skip to content

Commit

Permalink
Why won’t twitter show our previews?
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Nov 4, 2023
1 parent 5303fcd commit e7c27b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/gen-index.html.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env -S pkgx deno run --allow-read --allow-write=./out

console.log('hio')

interface Pkg {
name?: string
project: string
Expand All @@ -27,6 +25,8 @@ for (const pkg of pkgs) {

txt = txt.replace(/<title>.*<\/title>/, `<title>${title}</title>`);

txt = txt.replace('<meta name="twitter:card" content="summary_large_image" />', '<meta name="twitter:card" content="summary" />')

Deno.writeTextFileSync(`./out/${pkg.project}/index.html`, txt);

console.log(`./out/${pkg.project}/index.html`)
Expand Down
4 changes: 0 additions & 4 deletions .github/scripts/gen-index.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ interface Package {
labels?: string[]
}

console.error('HI')

export async function getKettleRemoteMetadata() {
const headers = { Authorization: 'public' }
const rsp = await fetch(`https://app.pkgx.dev/v1/packages/`, {headers})
Expand Down Expand Up @@ -69,8 +67,6 @@ async function getPackageYmlCreationDates(): Promise<Package[]> {

const pkgs = await getPackageYmlCreationDates();

console.error({pkgs})

// sort by birthtime
pkgs.sort((a, b) => b.birthtime.getTime() - a.birthtime.getTime());

Expand Down
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1, width=device-width" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Run Anything">
<meta property="og:description" content="pkgx is a blazingly fast, standalone, cross‐platform binary that runs anything from the creator of Homebrew">
<meta property="og:image" content="/og.jpg">
<meta property="og:url" content="https://pkgx.%VITE_PKGX_TLD%">
<meta property="og:title" content="Run Anything" />
<meta property="og:description" content="Blazingly fast, standalone, cross‐platform binary that runs anything" />
<meta property="og:image" content="/og.jpg" />
<meta property="og:url" content="https://pkgx.%VITE_PKGX_TLD%" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" purpose="any maskable" />
<link rel="icon" type="image/png" sizes="1024x1024" href="/favicon-1024.png" />
<link rel="icon" type="image/png" sizes="180x180" href="/favicon-180.png" />
Expand Down

0 comments on commit e7c27b6

Please sign in to comment.