Add missing metadata tags to roadmap page

This commit is contained in:
Lucas Phang 2021-05-03 15:23:52 +10:00
parent 47a977a98d
commit 97820308e0
5 changed files with 35 additions and 13 deletions

View File

@ -1,6 +1,11 @@
const METADATA = {
OXEN_HOST_URL: 'https://oxen.io',
TITLE_SUFFIX: 'Oxen | Privacy made simple.',
SITE_META_DESCRIPTION:
'Oxen is built by the OPTF, a passionate team of advocates, creatives, and engineers building a world where the internet is open, software is free and accessible, and your privacy is protected. The OPTF also builds other platforms using Oxen technology, and supports other developers in building on Oxen.',
ROADMAP: {
DESCRIPTION: "View Oxen's plan for the futere here.",
},
};
export default METADATA;

View File

@ -122,8 +122,6 @@ const NAVIGATION = {
SIDE_MENU_ITEMS,
BLOG_REGEX: /^\/(blog)([?tag=[\w-]*)?([?&]page=[0-9]{1,3})?/,
POST_REGEX: /^\/(blog\/)(([\w-]{1,100})|(\[slug\]))$/,
SITE_META_DESCRIPTION:
'Oxen is built by the OPTF, a passionate team of advocates, creatives, and engineers building a world where the internet is open, software is free and accessible, and your privacy is protected. The OPTF also builds other platforms using Oxen technology, and supports other developers in building on Oxen.',
};
export default NAVIGATION;

View File

@ -2,7 +2,7 @@ import Head from 'next/head';
import React from 'react';
import { HomeHero } from '../components/HomeHero';
import { HomeHeroBubble } from '../components/HomeHeroBubble';
import { METADATA, NAVIGATION } from '../constants';
import { METADATA } from '../constants';
const Index = () => {
return (
@ -11,7 +11,7 @@ const Index = () => {
<title>{METADATA.TITLE_SUFFIX}</title>
<meta
name="description"
content={NAVIGATION.SITE_META_DESCRIPTION}
content={METADATA.SITE_META_DESCRIPTION}
></meta>
<meta
property="og:title"
@ -20,14 +20,14 @@ const Index = () => {
/>
<meta
property="og:description"
content={NAVIGATION.SITE_META_DESCRIPTION}
content={METADATA.SITE_META_DESCRIPTION}
key="ogdesc"
/>
<meta property="og:type" content="website" />
<meta property="og:image" content={'site-banner.png'} key="ogimage" />
<meta property="og:url" content={METADATA.OXEN_HOST_URL} />
<link rel="canonical" href="https://oxen.io/"></link>
<link rel="canonical" href={METADATA.OXEN_HOST_URL}></link>
</Head>
{/* Only visible when no pages are open */}

View File

@ -1,9 +1,9 @@
import Head from 'next/head';
import React from 'react';
import { useMeasure } from 'react-use';
import { NAVIGATION } from '../constants';
import { NAVIGATION, METADATA } from '../constants';
import { SideMenuItem } from '../state/navigation';
import { generateTitle } from '../utils/metadata';
import { generateTitle, generateURL } from '../utils/metadata';
function Roadmap() {
const [ref, { width, height }] = useMeasure();
@ -18,14 +18,29 @@ function Roadmap() {
console.log('roadmap ➡️ width:', width);
console.log('roadmap ➡️ ratio:', aspectRatio);
const pageTitle = generateTitle(
NAVIGATION.SIDE_MENU_ITEMS[SideMenuItem.ROADMAP].label,
);
const pageURL = generateURL(
NAVIGATION.SIDE_MENU_ITEMS[SideMenuItem.ROADMAP].href,
);
return (
<>
<Head>
<title>
{generateTitle(
NAVIGATION.SIDE_MENU_ITEMS[SideMenuItem.ROADMAP].label,
)}
</title>
<title>{pageTitle}</title>
<meta name="description" content={METADATA.ROADMAP.DESCRIPTION}></meta>
<meta property="og:title" content={pageTitle} key="ogtitle" />
<meta
property="og:description"
content={METADATA.ROADMAP.DESCRIPTION}
key="ogdesc"
/>
<meta property="og:type" content="website" />
<meta property="og:image" content={'site-banner.png'} key="ogimage" />
<meta property="og:url" content={pageURL} />
<link rel="canonical" href={pageURL}></link>
</Head>
<div className="mx-4">

View File

@ -6,3 +6,7 @@ export function generateTitle(prefix: string) {
? `${titleCase(prefix)} - ${METADATA.TITLE_SUFFIX}`
: METADATA.TITLE_SUFFIX;
}
export function generateURL(prefix: string) {
return prefix ? `${METADATA.OXEN_HOST_URL}${prefix}` : METADATA.OXEN_HOST_URL;
}