-
-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: Swap the OG image to one including the Preact name #1130
base: master
Are you sure you want to change the base?
Changes from all commits
3d2ca1d
51cbfc8
55d7013
624c93b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,12 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimal-ui"> | ||
<meta name="color-scheme" content="dark light"> | ||
<meta name="theme-color" content="#673AB8"> | ||
<link rel="alternate" type="application/rss+xml" href="https://preactjs.com/feed.xml"> | ||
<link rel="alternate" type="application/atom+xml" href="https://preactjs.com/feed.atom"> | ||
<meta property="og:image" content="https://preactjs.com/app-icon.png"> | ||
<meta name="twitter:card" content="summary"> | ||
<link rel="alternate" type="application/rss+xml" href="%NETLIFY_DEPLOY_URL%/feed.xml"> | ||
<link rel="alternate" type="application/atom+xml" href="%NETLIFY_DEPLOY_URL%/feed.atom"> | ||
<meta property="og:type" content="website"> | ||
<meta property="og:image" content="%NETLIFY_DEPLOY_URL%/og-image.png"> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta name="twitter:site" content="@preactjs"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Supposedly this gives some sort of attribution and lets users jump right to the account (Docs)? Not quite sure how that's meant to work, or if it's currently broken, but the user data does come through (going by network pane in devtools), so figure it can't hurt. We can also add |
||
<link href="https://cdn.jsdelivr.net" rel="preconnect" crossorigin="anonymous"> | ||
</head> | ||
<body class="banner"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,10 @@ import { spaFallbackMiddlewarePlugin } from './plugins/spa-fallback-middleware.j | |
import { htmlRoutingMiddlewarePlugin } from './plugins/html-routing-middleware.js'; | ||
import { rssFeedPlugin } from './plugins/rss-feed.js'; | ||
|
||
const NETLIFY_DEPLOY_URL = process.env.CONTEXT === 'deploy-preview' | ||
? process.env.DEPLOY_PRIME_URL | ||
: 'https://preactjs.com'; | ||
|
||
Comment on lines
+13
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes it slightly easier to test some of this stuff out in deploy previews as you'd otherwise need to edit & then revert before merging. This is the Netlify recommendation for doing this sort of thing -- |
||
export default defineConfig({ | ||
publicDir: 'src/assets', | ||
optimizeDeps: { | ||
|
@@ -19,7 +23,11 @@ export default defineConfig({ | |
target: ['chrome88', 'edge88', 'es2020', 'firefox78', 'safari14'], | ||
outDir: 'build' | ||
}, | ||
define: { | ||
'import.meta.env.NETLIFY_DEPLOY_URL': JSON.stringify(NETLIFY_DEPLOY_URL) | ||
}, | ||
plugins: [ | ||
// @ts-ignore | ||
replace({ | ||
'process.env.BRANCH': JSON.stringify(process.env.BRANCH), | ||
preventAssignment: true | ||
|
@@ -53,6 +61,6 @@ export default defineConfig({ | |
netlifyPlugin(), | ||
spaFallbackMiddlewarePlugin(), | ||
htmlRoutingMiddlewarePlugin(), | ||
rssFeedPlugin() | ||
rssFeedPlugin(NETLIFY_DEPLOY_URL) | ||
] | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the spec, we're meant to always have a
og:type
meta tag.website
seems the most fitting, but there seems to be a healthy mix of bothwebsite
andarticle
on similar frameworks' docs sites. Not 100% sure which is best, thougharticle
seems like it carries additional meaning on some sites, so I went withwebsite