Merge pull request #11699 from hashicorp/je.website-maintenance-6-12-20
Website: consent manager bugfix, 404 page improvement
This commit is contained in:
commit
bcf56a51ec
@ -7,7 +7,7 @@
|
||||
command = "npm run static"
|
||||
|
||||
[context.production]
|
||||
environment = { HASHI_ENV = "production", NODE_ENV = "production"}
|
||||
environment = { HASHI_ENV = "production" }
|
||||
|
||||
[context.deploy-preview]
|
||||
environment = { HASHI_ENV = "staging" }
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
const withHashicorp = require('@hashicorp/nextjs-scripts')
|
||||
|
||||
console.log(`Environment: ${process.env.HASHI_ENV}`)
|
||||
|
||||
module.exports = withHashicorp({
|
||||
defaultLayout: true,
|
||||
transpileModules: ['is-absolute-url', '@hashicorp/react-mega-nav'],
|
||||
|
||||
20
website/package-lock.json
generated
20
website/package-lock.json
generated
@ -1344,13 +1344,13 @@
|
||||
"integrity": "sha512-/Mgw6ufzjsysw5U0v7c0tCXMQeE4BSbGeasDaTuh1r6jQ+2Cokl1XhPqKqXn4+xkcx3CIVdyoUYOSLmgzutn3Q=="
|
||||
},
|
||||
"@hashicorp/nextjs-scripts": {
|
||||
"version": "10.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@hashicorp/nextjs-scripts/-/nextjs-scripts-10.0.1.tgz",
|
||||
"integrity": "sha512-IwKr0HQvt6NZoJ9SlTBXqgDHYi4ticfcLM3mH3WH8b0Mr2B+Y5I/VzOOHiLxVcWmJmOECuV9EY+TaxlE5h2YQQ==",
|
||||
"version": "10.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@hashicorp/nextjs-scripts/-/nextjs-scripts-10.0.2.tgz",
|
||||
"integrity": "sha512-s18LHSyrWcgNbsFEnyMLUa7jaLBz2/UXu984UrxVoapHTq5eL4HEk1dJZ3yHcRCJjG7TEYvaXzgkL4IHc1UR5w==",
|
||||
"requires": {
|
||||
"@bugsnag/js": "7.1.1",
|
||||
"@bugsnag/plugin-react": "7.1.1",
|
||||
"@hashicorp/react-consent-manager": "2.1.1",
|
||||
"@hashicorp/react-consent-manager": "2.1.2",
|
||||
"@hashicorp/react-enterprise-alert": "^2.1.0",
|
||||
"@hashicorp/react-tabs": "^0.4.0",
|
||||
"@hashicorp/remark-plugins": "3.0.0",
|
||||
@ -1436,9 +1436,9 @@
|
||||
}
|
||||
},
|
||||
"@hashicorp/react-consent-manager": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@hashicorp/react-consent-manager/-/react-consent-manager-2.1.1.tgz",
|
||||
"integrity": "sha512-tIVR3LhDnwcHAxa+lrfrjJmthynCzpVrn9MYHcqKBVrCozV3SCC9zeRjPSlvxU9/GfAYAefull2hH/kg/duyOw==",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@hashicorp/react-consent-manager/-/react-consent-manager-2.1.2.tgz",
|
||||
"integrity": "sha512-AjCFIEZPa6K9UFr3Nvjy8cLHuGDa2qpQat/QVFHKp0t/acflC8z7xIDh8Yo9RBCp+YF+gF+g50ll/hhzX0pEeQ==",
|
||||
"requires": {
|
||||
"@hashicorp/react-button": "^2.2.0",
|
||||
"@hashicorp/react-toggle": "^1.0.1",
|
||||
@ -8814,9 +8814,9 @@
|
||||
"integrity": "sha512-8hfl5RD6P7rEeIbzStBz3h4f+BQHfq/ABtoU6gXKQv5OcZhnmrIpG7e1pYaZ8hS9e0mp+bxUj08fnDUbKctYyA=="
|
||||
},
|
||||
"jsx-ast-utils": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.3.0.tgz",
|
||||
"integrity": "sha512-3HNoc7nZ1hpZIKB3hJ7BlFRkzCx2BynRtfSwbkqZdpRdvAPsGMnzclPwrvDBS7/lalHTj21NwIeaEpysHBOudg==",
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz",
|
||||
"integrity": "sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==",
|
||||
"requires": {
|
||||
"array-includes": "^3.1.1",
|
||||
"object.assign": "^4.1.0"
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"version": "1.0.0",
|
||||
"author": "HashiCorp",
|
||||
"dependencies": {
|
||||
"@hashicorp/nextjs-scripts": "^10.0.1",
|
||||
"@hashicorp/nextjs-scripts": "^10.0.2",
|
||||
"@hashicorp/react-button": "^2.2.0",
|
||||
"@hashicorp/react-code-block": "^1.2.7",
|
||||
"@hashicorp/react-content": "3.0.0-0",
|
||||
|
||||
@ -1,32 +1,2 @@
|
||||
import Link from 'next/link'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export default function NotFound() {
|
||||
useEffect(() => {
|
||||
if (
|
||||
typeof window !== 'undefined' &&
|
||||
typeof window?.analytics?.track === 'function' &&
|
||||
typeof window?.document?.referrer === 'string' &&
|
||||
typeof window?.location?.href === 'string'
|
||||
)
|
||||
window.analytics.track(window.location.href, {
|
||||
category: '404 Response',
|
||||
label: window.document.referrer || 'No Referrer',
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div id="p-404" className="g-grid-container">
|
||||
<h1>Page Not Found</h1>
|
||||
<p>
|
||||
We‘re sorry but we can‘t find the page you‘re looking
|
||||
for.
|
||||
</p>
|
||||
<p>
|
||||
<Link href="/">
|
||||
<a>Back to Home</a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
import NotFound from './not-found'
|
||||
export default NotFound
|
||||
|
||||
@ -30,12 +30,6 @@ function App({ Component, pageProps }) {
|
||||
description="Vagrant enables users to create and configure lightweight, reproducible, and
|
||||
portable development environments."
|
||||
image="https://www.vagrantup.com/img/og-image.png"
|
||||
stylesheet={[
|
||||
{
|
||||
href:
|
||||
'https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700&display=swap',
|
||||
},
|
||||
]}
|
||||
icon={[{ href: '/favicon.ico' }]}
|
||||
preload={[
|
||||
{ href: '/fonts/klavika/medium.woff2', as: 'font' },
|
||||
|
||||
33
website/pages/not-found/index.jsx
Normal file
33
website/pages/not-found/index.jsx
Normal file
@ -0,0 +1,33 @@
|
||||
import s from './style.module.css'
|
||||
import Link from 'next/link'
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export default function NotFound() {
|
||||
useEffect(() => {
|
||||
if (
|
||||
typeof window !== 'undefined' &&
|
||||
typeof window?.analytics?.track === 'function' &&
|
||||
typeof window?.document?.referrer === 'string' &&
|
||||
typeof window?.location?.href === 'string'
|
||||
)
|
||||
window.analytics.track(window.location.href, {
|
||||
category: '404 Response',
|
||||
label: window.document.referrer || 'No Referrer',
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className={s.root}>
|
||||
<h1>Page Not Found</h1>
|
||||
<p>
|
||||
We‘re sorry but we can‘t find the page you‘re looking
|
||||
for.
|
||||
</p>
|
||||
<p>
|
||||
<Link href="/">
|
||||
<a>Back to Home</a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
36
website/pages/not-found/style.module.css
Normal file
36
website/pages/not-found/style.module.css
Normal file
@ -0,0 +1,36 @@
|
||||
.root {
|
||||
composes: .g-grid-container from global;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
margin: 64px auto; /* this is being overridden at the request of the learn team */
|
||||
max-width: 784px;
|
||||
min-height: 50vh;
|
||||
padding-inline: 32px;
|
||||
text-align: center;
|
||||
|
||||
@media (--large) {
|
||||
padding-inline: 24px;
|
||||
}
|
||||
|
||||
& h1 {
|
||||
font-size: 1.5rem;
|
||||
letter-spacing: -0.004em;
|
||||
line-height: 1.375em;
|
||||
|
||||
@media (--medium-up) {
|
||||
font-size: 1.75rem;
|
||||
line-height: 1.321em;
|
||||
}
|
||||
|
||||
@media (--large) {
|
||||
font-size: 2rem;
|
||||
letter-spacing: -0.006em;
|
||||
line-height: 1.313em;
|
||||
}
|
||||
}
|
||||
|
||||
& a {
|
||||
color: var(--highlight-color);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user