Skip to content

Commit

Permalink
Update page metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
iaincollins committed Sep 12, 2024
1 parent c78fa25 commit 30d2bfb
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 11 deletions.
10 changes: 7 additions & 3 deletions components/layout.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import Loader from './loader'
import Head from 'next/head'

const DEFAULT_TITLE = 'Ardent Industry – Trade & Exploration'
const DEFAULT_DESCRIPTION = 'Ardent Industry provides trade and exploration data for the game Elite Dangerous'

export default ({
title = 'Ardent Industry – Trade & Exploration',
title = DEFAULT_TITLE,
description = DEFAULT_DESCRIPTION,
loading = false,
loadingText,
children
}) =>
<>
<Head>
<title>{title}</title>
<meta name='description' content='Ardent Industry provides trade and exploration data for the game Elite Dangerous' />
<title>{title ?? DEFAULT_TITLE}</title>
<meta name='description' content={description ?? DEFAULT_DESCRIPTION} />
<meta name='keywords' content='Ardent Industry, Elite Dangerous, Elite: Dangerous, market, trade, commodities, pricing, prices, systems, exploration, API, SQL' />
<meta name='author' content='Iain Collins' />
<meta name='viewport' content='width=device-width' />
Expand Down
4 changes: 4 additions & 0 deletions css/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
opacity: 0;
}

.text-large {
font-size: 1.2rem;
}

.text-positive {
color: var(--color-positive);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ardent-www",
"version": "0.47.2",
"version": "0.47.4",
"description": "Ardent Industry",
"main": "index.js",
"scripts": {
Expand Down
5 changes: 4 additions & 1 deletion pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ export default () => {
}, [])

return (
<Layout>
<Layout
title='About Ardent Industry for Elite Dangerous'
description='Ardent Industry is companion software for the game Elite Dangerous.'
>
<Head>
<link rel='canonical' href='https://ardent-industry.com/about' />
</Head>
Expand Down
11 changes: 8 additions & 3 deletions pages/commodity/[commodity-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ export default () => {
}, [])

return (
<Layout loading={!commodity} loadingText='Loading trade data'>
<Layout
loading={commodity === undefined}
loadingText='Loading trade data'
title={commodity ? `${commodity.name} in Elite Dangerous` : null}
description={commodity ? `Where to buy and sell ${commodity.name} in Elite Dangerous` : null}
>
<Head>
<link rel='canonical' href={`https://ardent-industry.com/system/${commodity?.symbol}/${tabs[tabIndex]}`} />
</Head>
Expand All @@ -116,7 +121,7 @@ export default () => {
<li><Link href='/'>Home</Link></li>
<li><Link href='/commodities'>Commodities</Link></li>
</ul>
{commodity === null && <><h2>Error</h2><p className='clear'>Commodity not found</p></>}
{commodity === null && <><h1>Error: Not found</h1><p className='text-large clear'>Commodity not found.</p></>}
{commodity &&
<div className='fx__fade-in'>
<h2 className='heading--with-icon'>
Expand Down Expand Up @@ -233,7 +238,7 @@ export default () => {
<p style={{margin: 0, textTransform: 'none'}}>
Rare goods are only available in limited quantities from exclusive locations but can be sold almost anywhere.
</p>
<p style={{marginBottom: 0, textTransform: 'none'}}>
<p style={{margin: '.5rem 0 0 0', textTransform: 'none'}}>
They increase in value the further they are traded from the source, reaching maximum value when traded
around 150-200 ly away.
</p>
Expand Down
5 changes: 4 additions & 1 deletion pages/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default () => {
})()
}, [])
return (
<Layout>
<Layout
title='About Ardent Industry for Elite Dangerous'
description='Download bulk exports of the Elite Dangerous trade and system data from Ardent Industry.'
>
<Head>
<link rel='canonical' href='https://ardent-industry.com/downloads' />
</Head>
Expand Down
9 changes: 7 additions & 2 deletions pages/system/[system-name]/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ export default () => {
}, [router.query['system-name']])

return (
<Layout loading={system === undefined} loadingText='Loading system data'>
<Layout
loading={system === undefined}
loadingText='Loading system data'
title={system ? `${system.systemName} system in Elite Dangerous` : null}
description={system ? `Trade data for ${system.systemName} in Elite Dangerous` : null}
>
<Head>
<link rel='canonical' href={`https://ardent-industry.com/system/${system?.systemName}/${tabs[tabIndex]}`} />
</Head>
Expand All @@ -166,7 +171,7 @@ export default () => {
<li><Link href='/'>Home</Link></li>
<li><Link href='/'>Systems</Link></li>
</ul>
{system === null && <><h2>Error</h2><p className='clear'>System not found</p></>}
{system === null && <><h1>Error: Not found</h1><p className='text-large clear'>System not found.</p></>}
{system &&
<div className='fx__fade-in'>
<h2 className='heading--with-icon'>
Expand Down

0 comments on commit 30d2bfb

Please sign in to comment.