feat(v2): better twitter preview meta tag (#1676)

* fix(v2): remove unwanted scale zoom due to initial-scale meta tag

* use summary meta
This commit is contained in:
Endi 2019-07-19 01:06:59 +07:00 committed by GitHub
parent 52e67a1c35
commit 381dd75105
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 6 deletions

View file

@ -66,10 +66,7 @@ function Layout(props) {
<meta name="twitter:image:alt" content={`Image for ${metaTitle}`} /> <meta name="twitter:image:alt" content={`Image for ${metaTitle}`} />
)} )}
{permalink && <meta property="og:url" content={siteUrl + permalink} />} {permalink && <meta property="og:url" content={siteUrl + permalink} />}
<meta <meta name="twitter:card" content="summary" />
name="twitter:card"
content={image || favicon ? 'summary_large_image' : 'summary'}
/>
</Head> </Head>
<Navbar /> <Navbar />
{children} {children}

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width">
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>
<body> <body>

View file

@ -10,7 +10,7 @@ module.exports = `
<html <%= htmlAttributes %>> <html <%= htmlAttributes %>>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width">
<%- chunkManifestScript %> <%- chunkManifestScript %>
<% metaAttributes.forEach((metaAttribute) => { %> <% metaAttributes.forEach((metaAttribute) => { %>
<%- metaAttribute %> <%- metaAttribute %>