Merge pull request #982 from datopian/lighthouse-improvements
[site][m] - improvements to lighthouse score
@ -2,7 +2,7 @@ import { useRef } from 'react';
|
|||||||
import ButtonLink from './ButtonLink';
|
import ButtonLink from './ButtonLink';
|
||||||
import NewsletterForm from './NewsletterForm';
|
import NewsletterForm from './NewsletterForm';
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
import DatahubExampleImg from "@/public/images/showcases/datahub.png"
|
import DatahubExampleImg from '@/public/images/showcases/datahub.webp';
|
||||||
|
|
||||||
const codeLanguage = 'javascript';
|
const codeLanguage = 'javascript';
|
||||||
const code = `export default {
|
const code = `export default {
|
||||||
@ -72,9 +72,11 @@ export function Hero() {
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
>
|
>
|
||||||
<img
|
<Image
|
||||||
src="/images/datopian_logo.png"
|
src="/images/datopian_logo.png"
|
||||||
alt="Datopian"
|
alt="Datopian"
|
||||||
|
width={24}
|
||||||
|
height={20}
|
||||||
className="mx-2 mb-1 h-6 inline bg-black rounded-full"
|
className="mx-2 mb-1 h-6 inline bg-black rounded-full"
|
||||||
/>
|
/>
|
||||||
<span>Datopian</span>
|
<span>Datopian</span>
|
||||||
@ -85,7 +87,12 @@ export function Hero() {
|
|||||||
<div className="relative rounded-2xl bg-[#0A101F]/80 ring-1 ring-white/10 backdrop-blur">
|
<div className="relative rounded-2xl bg-[#0A101F]/80 ring-1 ring-white/10 backdrop-blur">
|
||||||
<div className="absolute -top-px left-20 right-11 h-px bg-gradient-to-r from-sky-300/0 via-sky-300/70 to-sky-300/0" />
|
<div className="absolute -top-px left-20 right-11 h-px bg-gradient-to-r from-sky-300/0 via-sky-300/70 to-sky-300/0" />
|
||||||
<div className="absolute -bottom-px left-11 right-20 h-px bg-gradient-to-r from-blue-400/0 via-blue-400 to-blue-400/0" />
|
<div className="absolute -bottom-px left-11 right-20 h-px bg-gradient-to-r from-blue-400/0 via-blue-400 to-blue-400/0" />
|
||||||
<Image src={DatahubExampleImg} alt="opendata.datahub.io" />
|
<Image
|
||||||
|
height={400}
|
||||||
|
width={600}
|
||||||
|
src={DatahubExampleImg}
|
||||||
|
alt="opendata.datahub.io"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -3,10 +3,6 @@ import Script from 'next/script';
|
|||||||
export default function NewsletterForm() {
|
export default function NewsletterForm() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<link
|
|
||||||
rel="stylesheet"
|
|
||||||
href="https://sibforms.com/forms/end-form/build/sib-styles.css"
|
|
||||||
/>
|
|
||||||
<div
|
<div
|
||||||
id="sib-form-container"
|
id="sib-form-container"
|
||||||
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
|
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
|
||||||
@ -119,6 +115,7 @@ export default function NewsletterForm() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Script
|
<Script
|
||||||
|
strategy="worker"
|
||||||
id="newsletter-submit-form"
|
id="newsletter-submit-form"
|
||||||
src="https://sibforms.com/forms/end-form/build/main.js"
|
src="https://sibforms.com/forms/end-form/build/main.js"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -5,26 +5,26 @@ const items = [
|
|||||||
{
|
{
|
||||||
title: 'Open Data Northern Ireland',
|
title: 'Open Data Northern Ireland',
|
||||||
href: 'https://www.opendatani.gov.uk/',
|
href: 'https://www.opendatani.gov.uk/',
|
||||||
image: '/images/showcases/odni.png',
|
image: '/images/showcases/odni.webp',
|
||||||
description: 'Government Open Data Portal',
|
description: 'Government Open Data Portal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Birmingham City Observatory',
|
title: 'Birmingham City Observatory',
|
||||||
href: 'https://www.cityobservatory.birmingham.gov.uk/',
|
href: 'https://www.cityobservatory.birmingham.gov.uk/',
|
||||||
image: '/images/showcases/birmingham.png',
|
image: '/images/showcases/birmingham.webp',
|
||||||
description: 'Government Open Data Portal',
|
description: 'Government Open Data Portal',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'UAE Open Data',
|
title: 'UAE Open Data',
|
||||||
href: 'https://opendata.fcsc.gov.ae/',
|
href: 'https://opendata.fcsc.gov.ae/',
|
||||||
image: '/images/showcases/uae.png',
|
image: '/images/showcases/uae.webp',
|
||||||
description: 'Government Open Data Portal',
|
description: 'Government Open Data Portal',
|
||||||
sourceUrl: 'https://github.com/FCSCOpendata/frontend',
|
sourceUrl: 'https://github.com/FCSCOpendata/frontend',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Datahub Open Data',
|
title: 'Datahub Open Data',
|
||||||
href: 'https://opendata.datahub.io/',
|
href: 'https://opendata.datahub.io/',
|
||||||
image: '/images/showcases/datahub.png',
|
image: '/images/showcases/datahub.webp',
|
||||||
description: 'Demo Data Portal by DataHub',
|
description: 'Demo Data Portal by DataHub',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -1,61 +1,68 @@
|
|||||||
const config = {
|
const config = {
|
||||||
title:
|
title: 'PortalJS',
|
||||||
"PortalJS",
|
|
||||||
description:
|
description:
|
||||||
"PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog/portal.",
|
'PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog/portal.',
|
||||||
theme: {
|
theme: {
|
||||||
default: "dark",
|
default: 'dark',
|
||||||
toggleIcon: "/images/theme-button.svg",
|
toggleIcon: '/images/theme-button.svg',
|
||||||
},
|
},
|
||||||
author: "Datopian",
|
author: 'Datopian',
|
||||||
authorLogo: "/datopian-logo.png",
|
authorLogo: '/datopian-logo.webp',
|
||||||
authorUrl: "https://datopian.com/",
|
authorUrl: 'https://datopian.com/',
|
||||||
navbarTitle: {
|
navbarTitle: {
|
||||||
// logo: "/images/logo.svg",
|
// logo: "/images/logo.svg",
|
||||||
text: "🌀 PortalJS",
|
text: '🌀 PortalJS',
|
||||||
// version: "Alpha",
|
// version: "Alpha",
|
||||||
},
|
},
|
||||||
navLinks: [
|
navLinks: [
|
||||||
{ name: "Docs", href: "/docs" },
|
{ name: 'Docs', href: '/docs' },
|
||||||
// { name: "Components", href: "/docs/components" },
|
// { name: "Components", href: "/docs/components" },
|
||||||
{ name: "Blog", href: "/blog" },
|
{ name: 'Blog', href: '/blog' },
|
||||||
{ name: "Showcases", href: "/#showcases" },
|
{ name: 'Showcases', href: '/#showcases' },
|
||||||
{ name: "Howtos", href: "/howtos" },
|
{ name: 'Howtos', href: '/howtos' },
|
||||||
{ name: "Guide", href: "/guide" },
|
{ name: 'Guide', href: '/guide' },
|
||||||
{ name: "Examples", href: "https://github.com/datopian/portaljs/tree/main/examples", target: "_blank" },
|
{
|
||||||
{ name: "Components", href: "https://storybook.portaljs.org", target: "_blank" },
|
name: 'Examples',
|
||||||
|
href: 'https://github.com/datopian/portaljs/tree/main/examples',
|
||||||
|
target: '_blank',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Components',
|
||||||
|
href: 'https://storybook.portaljs.org',
|
||||||
|
target: '_blank',
|
||||||
|
},
|
||||||
// { name: "DL Demo", href: "/data-literate/demo" },
|
// { name: "DL Demo", href: "/data-literate/demo" },
|
||||||
// { name: "Excel Viewer", href: "/excel-viewer" },
|
// { name: "Excel Viewer", href: "/excel-viewer" },
|
||||||
],
|
],
|
||||||
footerLinks: [],
|
footerLinks: [],
|
||||||
nextSeo: {
|
nextSeo: {
|
||||||
openGraph: {
|
openGraph: {
|
||||||
type: "website",
|
type: 'website',
|
||||||
title:
|
title:
|
||||||
"PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||||
description:
|
description:
|
||||||
"PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog and portal.",
|
'PortalJS is a framework for rapidly building rich data portal frontends using a modern frontend approach. PortalJS can be used to present a single dataset or build a full-scale data catalog and portal.',
|
||||||
locale: "en_US",
|
locale: 'en_US',
|
||||||
images: [
|
images: [
|
||||||
{
|
{
|
||||||
url: "/homepage-screenshot.png", // TODO
|
url: '/homepage-screenshot.png', // TODO
|
||||||
alt: "PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
alt: 'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||||
width: 1280,
|
width: 1280,
|
||||||
height: 720,
|
height: 720,
|
||||||
type: "image/jpg",
|
type: 'image/jpg',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
handle: "@datopian",
|
handle: '@datopian',
|
||||||
site: "https://datopian.com/",
|
site: 'https://datopian.com/',
|
||||||
cardType: "summary_large_image",
|
cardType: 'summary_large_image',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
github: "https://github.com/datopian/portaljs",
|
github: 'https://github.com/datopian/portaljs',
|
||||||
discord: "https://discord.gg/EeyfGrGu4U",
|
discord: 'https://discord.gg/EeyfGrGu4U',
|
||||||
tableOfContents: true,
|
tableOfContents: true,
|
||||||
analytics: "G-96GWZHMH57",
|
analytics: 'G-96GWZHMH57',
|
||||||
// editLinkShow: true,
|
// editLinkShow: true,
|
||||||
};
|
};
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
import "../styles/globals.css";
|
import '../styles/globals.css';
|
||||||
import "../styles/tailwind.css";
|
import '../styles/tailwind.css';
|
||||||
|
import '../styles/sib-form.css';
|
||||||
|
|
||||||
import Script from "next/script";
|
import Script from 'next/script';
|
||||||
|
|
||||||
import { DefaultSeo } from "next-seo";
|
import { DefaultSeo } from 'next-seo';
|
||||||
|
|
||||||
import { NavGroup, NavItem, pageview, ThemeProvider } from "@portaljs/core";
|
import { NavGroup, NavItem, pageview, ThemeProvider } from '@portaljs/core';
|
||||||
import { siteConfig } from "../config/siteConfig";
|
import { siteConfig } from '../config/siteConfig';
|
||||||
import { useEffect } from "react";
|
import { useEffect } from 'react';
|
||||||
import { useRouter } from "next/dist/client/router";
|
import { useRouter } from 'next/dist/client/router';
|
||||||
|
|
||||||
export interface CustomAppProps {
|
export interface CustomAppProps {
|
||||||
meta: {
|
meta: {
|
||||||
@ -32,9 +33,9 @@ function MyApp({ Component, pageProps }) {
|
|||||||
const handleRouteChange = (url) => {
|
const handleRouteChange = (url) => {
|
||||||
pageview(url);
|
pageview(url);
|
||||||
};
|
};
|
||||||
router.events.on("routeChangeComplete", handleRouteChange);
|
router.events.on('routeChangeComplete', handleRouteChange);
|
||||||
return () => {
|
return () => {
|
||||||
router.events.off("routeChangeComplete", handleRouteChange);
|
router.events.off('routeChangeComplete', handleRouteChange);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}, [router.events]);
|
}, [router.events]);
|
||||||
@ -44,7 +45,7 @@ function MyApp({ Component, pageProps }) {
|
|||||||
disableTransitionOnChange
|
disableTransitionOnChange
|
||||||
attribute="class"
|
attribute="class"
|
||||||
defaultTheme={siteConfig.theme.default}
|
defaultTheme={siteConfig.theme.default}
|
||||||
forcedTheme={siteConfig.theme.default ? null : "light"}
|
forcedTheme={siteConfig.theme.default ? null : 'light'}
|
||||||
>
|
>
|
||||||
<DefaultSeo defaultTitle={siteConfig.title} {...siteConfig.nextSeo} />
|
<DefaultSeo defaultTitle={siteConfig.title} {...siteConfig.nextSeo} />
|
||||||
|
|
||||||
@ -71,10 +72,15 @@ function MyApp({ Component, pageProps }) {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Umami Analytics */}
|
{/* Umami Analytics */}
|
||||||
<Script async defer data-website-id="061e14c1-6157-4a93-820c-777c7a937c12" src="https://analytics.datopian.com/umami.js" />
|
<Script
|
||||||
|
async
|
||||||
|
defer
|
||||||
|
data-website-id="061e14c1-6157-4a93-820c-777c7a937c12"
|
||||||
|
src="https://analytics.datopian.com/umami.js"
|
||||||
|
/>
|
||||||
|
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import Layout from '../components/Layout';
|
|||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { collectHeadings } from '@portaljs/core';
|
import { collectHeadings } from '@portaljs/core';
|
||||||
|
import Head from 'next/head';
|
||||||
|
|
||||||
export default function Home({ sidebarTree }) {
|
export default function Home({ sidebarTree }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -23,7 +24,11 @@ export default function Home({ sidebarTree }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Layout isHomePage={true} tableOfContents={tableOfContents} sidebarTree={sidebarTree} >
|
<Layout
|
||||||
|
isHomePage={true}
|
||||||
|
tableOfContents={tableOfContents}
|
||||||
|
sidebarTree={sidebarTree}
|
||||||
|
>
|
||||||
<Features />
|
<Features />
|
||||||
<Showcases />
|
<Showcases />
|
||||||
<Community />
|
<Community />
|
||||||
|
|||||||
BIN
site/public/datopian-logo.webp
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
site/public/images/showcases/birmingham.webp
Normal file
|
After Width: | Height: | Size: 65 KiB |
BIN
site/public/images/showcases/brazil.webp
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
site/public/images/showcases/datahub.webp
Normal file
|
After Width: | Height: | Size: 99 KiB |
BIN
site/public/images/showcases/example-ckan.webp
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
site/public/images/showcases/example-simple-catalog.webp
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
site/public/images/showcases/odni.webp
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
site/public/images/showcases/uae.webp
Normal file
|
After Width: | Height: | Size: 45 KiB |