Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/beta_site_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
lint:
runs-on: ubuntu-latest

name: Lint on node 12.x and ubuntu-latest
name: Lint on node 14.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1.7.10
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
lint:
runs-on: ubuntu-latest

name: Lint on node 12.x and ubuntu-latest
name: Lint on node 14.x and ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1.7.10
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.22.0
14.1.0
7,900 changes: 7,900 additions & 0 deletions beta/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions beta/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@
"@headlessui/react": "^1.3.0",
"@mdx-js/react": "^1.6.16",
"body-scroll-lock": "^3.1.3",
"chrome-aws-lambda": "^10.1.0",
"classnames": "^2.2.6",
"date-fns": "^2.16.1",
"debounce": "^1.2.1",
"ga-lite": "^2.1.4",
"github-slugger": "^1.3.0",
"next": "12.1.7-canary.11",
"parse-numeric-range": "^1.2.0",
"puppeteer": "^15.5.0",
"react": "0.0.0-experimental-82c64e1a4-20220520",
"react-collapsed": "3.1.0",
"react-dom": "0.0.0-experimental-82c64e1a4-20220520",
Expand Down
3 changes: 0 additions & 3 deletions beta/public/robots.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
User-agent: *
Disallow: /

User-agent: Algolia Crawler
Disallow:
160 changes: 84 additions & 76 deletions beta/src/components/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ import React from 'react';
import Head from 'next/head';
import {withRouter, Router} from 'next/router';

interface Process {
env: {VERCEL_URL: string};
}
declare var process: Process;

console.log(process.env);
const apiURL = process.env.VERCEL_URL
? 'https://' + process.env?.VERCEL_URL
: 'http://localhost:3000';

export interface SeoProps {
title: string;
description?: string;
Expand All @@ -23,87 +33,85 @@ export const Seo = withRouter(
children,
}: SeoProps & {router: Router}) => (
<Head>
{/* DEFAULT */}

<meta name="viewport" content="width=device-width, initial-scale=1" />

{title != null && <title key="title">{title}</title>}
{description != null && (
<meta name="description" key="description" content={description} />
)}
{/* <link rel="icon" type="image/x-icon" href={favicon} />
<>
{' '}
{/* DEFAULT */}
<meta name="viewport" content="width=device-width, initial-scale=1" />
{title != null && <title key="title">{title}</title>}
{description != null && (
<meta name="description" key="description" content={description} />
)}
{console.log}
{/* <link rel="icon" type="image/x-icon" href={favicon} />
<link rel="apple-touch-icon" href={favicon} /> @todo favicon */}
<meta property="fb:app_id" content="623268441017527" />
{/* OPEN GRAPH */}
<meta property="og:type" key="og:type" content="website" />
<meta
property="og:url"
key="og:url"
content={`https://beta.reactjs.org${router.pathname}`}
/>
{title != null && (
<meta property="og:title" content={title} key="og:title" />
)}
{description != null && (
<meta property="fb:app_id" content="623268441017527" />
{/* OPEN GRAPH */}
<meta
property="og:description"
key="og:description"
content={description}
property="og:image"
content={`${apiURL}/api?description=${description}&title=${title}`}
/>
)}

<meta
property="og:image"
key="og:image"
content={`https://beta.reactjs.org${image}`}
/>

{/* TWITTER */}
<meta
name="twitter:card"
key="twitter:card"
content="summary_large_image"
/>
<meta name="twitter:site" key="twitter:site" content="@reactjs" />
<meta name="twitter:creator" key="twitter:creator" content="@reactjs" />
{title != null && (
<meta name="twitter:title" key="twitter:title" content={title} />
)}
{description != null && (
<meta property="og:type" key="og:type" content="website" />
<meta
name="twitter:description"
key="twitter:description"
content={description}
property="og:url"
key="og:url"
content={`https://beta.reactjs.org${router.pathname}`}
/>
)}

<meta
name="twitter:image"
key="twitter:image"
content={`https://beta.reactjs.org${image}`}
/>
<link
rel="preload"
href="/fonts/Source-Code-Pro-Regular.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Md.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
{children}
{title != null && (
<meta property="og:title" content={title} key="og:title" />
)}
{description != null && (
<meta
property="og:description"
key="og:description"
content={description}
/>
)}
{/* TWITTER */}
<meta
name="twitter:card"
key="twitter:card"
content="summary_large_image"
/>
<meta name="twitter:site" key="twitter:site" content="@reactjs" />
<meta name="twitter:creator" key="twitter:creator" content="@reactjs" />
{title != null && (
<meta name="twitter:title" key="twitter:title" content={title} />
)}
{description != null && (
<meta
name="twitter:description"
key="twitter:description"
content={description}
/>
)}
<meta
name="twitter:image"
key="twitter:image"
content={`https://beta.reactjs.org${image}`}
/>
<link
rel="preload"
href="/fonts/Source-Code-Pro-Regular.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Md.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
<link
rel="preload"
href="https://beta.reactjs.org/fonts/Optimistic_Display_W_Bd.woff2"
as="font"
type="font/woff2"
crossOrigin="anonymous"
/>
{children}
</>
</Head>
)
);
Loading