Skip to content
Draft
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
24 changes: 24 additions & 0 deletions components/Head.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import NextHead from 'next/head';

export default function Head({ host, categories }) {
const categoryLabels = categories.filter(c => c.tag && c.tag !== 'ALL').map(c => c.label.toLowerCase());

return (
<NextHead>
<title>Discover {host.name}</title>
<meta
name="description"
content={`Discover ${host.count.toLocaleString('en')} collectives ${host.root ? 'on' : 'hosted by'} ${
host.name
} making an impact in ${categoryLabels.join(', ')} and more.`}
/>
<meta
property="og:image"
content={`https://discover.opencollective.com/api/og?${!host.root ? `hostSlug=${host.slug}&` : ``}count=${
host.count
}&tags=${categoryLabels.map(label => encodeURIComponent(label)).join(',')}`}
/>
</NextHead>
);
}
19 changes: 13 additions & 6 deletions lib/hosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,15 @@ export const hosts: {
currency: string;
startYear: number;
logoSrc: string;
color: string;
styles: { text: string; groupHoverText: string; button: string; brandBox: string; box: string; border: string };
color: { closestPaletteColor: string; brand: string };
styles: {
text: string;
groupHoverText: string;
button: string;
brandBox: string;
box: string;
border: string;
};
website?: string;
cta?: { text: string; textLonger: string; href: string; buttonLabel: string };
groupTags: { [key: string]: string[] };
Expand Down Expand Up @@ -58,7 +65,7 @@ export const hosts: {
currency: 'USD',
startYear: 2016,
logoSrc: '/oc-logo.svg',
color: 'blue',
color: { closestPaletteColor: 'blue', brand: '#0C2D66' },
website: 'https://opencollective.com',
styles: {
text: 'text-[#0C2D66]',
Expand All @@ -82,7 +89,7 @@ export const hosts: {
currency: 'USD',
startYear: 2018,
logoSrc: '/ocf-logo.svg',
color: 'teal',
color: { closestPaletteColor: 'teal', brand: '#0C5559' },
styles: {
text: 'text-[#0C5559]',
groupHoverText: 'group-hover:text-[#0C5559]',
Expand Down Expand Up @@ -110,7 +117,7 @@ export const hosts: {
startYear: 2016,
logoSrc: '/osc-logo.svg',
website: 'https://opencollective.com/opensource',
color: 'purple',
color: { closestPaletteColor: 'purple', brand: '#4B3084' },
styles: {
text: 'text-[#4B3084]',
groupHoverText: 'group-hover:text-[#4B3084]',
Expand All @@ -132,7 +139,7 @@ export const hosts: {
startYear: 2019,
logoSrc: '/oce-logo.svg',
website: 'https://opencollective.com/europe',
color: 'blue',
color: { closestPaletteColor: 'blue', brand: '#0C2D66' },
styles: {
text: 'text-[#0C2D66]',
groupHoverText: 'group-hover:text-[#0C2D66]',
Expand Down
Loading