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 NewsletterForm from './NewsletterForm';
|
||||
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 code = `export default {
|
||||
@ -72,9 +72,11 @@ export function Hero() {
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<img
|
||||
<Image
|
||||
src="/images/datopian_logo.png"
|
||||
alt="Datopian"
|
||||
width={24}
|
||||
height={20}
|
||||
className="mx-2 mb-1 h-6 inline bg-black rounded-full"
|
||||
/>
|
||||
<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="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" />
|
||||
<Image src={DatahubExampleImg} alt="opendata.datahub.io" />
|
||||
<Image
|
||||
height={400}
|
||||
width={600}
|
||||
src={DatahubExampleImg}
|
||||
alt="opendata.datahub.io"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -3,10 +3,6 @@ import Script from 'next/script';
|
||||
export default function NewsletterForm() {
|
||||
return (
|
||||
<div>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://sibforms.com/forms/end-form/build/sib-styles.css"
|
||||
/>
|
||||
<div
|
||||
id="sib-form-container"
|
||||
className="mt-8 sm:mx-auto sm:text-center lg:text-left lg:mx-0"
|
||||
@ -119,6 +115,7 @@ export default function NewsletterForm() {
|
||||
}}
|
||||
/>
|
||||
<Script
|
||||
strategy="worker"
|
||||
id="newsletter-submit-form"
|
||||
src="https://sibforms.com/forms/end-form/build/main.js"
|
||||
/>
|
||||
|
||||
@ -5,26 +5,26 @@ const items = [
|
||||
{
|
||||
title: 'Open Data Northern Ireland',
|
||||
href: 'https://www.opendatani.gov.uk/',
|
||||
image: '/images/showcases/odni.png',
|
||||
image: '/images/showcases/odni.webp',
|
||||
description: 'Government Open Data Portal',
|
||||
},
|
||||
{
|
||||
title: 'Birmingham City Observatory',
|
||||
href: 'https://www.cityobservatory.birmingham.gov.uk/',
|
||||
image: '/images/showcases/birmingham.png',
|
||||
image: '/images/showcases/birmingham.webp',
|
||||
description: 'Government Open Data Portal',
|
||||
},
|
||||
{
|
||||
title: 'UAE Open Data',
|
||||
href: 'https://opendata.fcsc.gov.ae/',
|
||||
image: '/images/showcases/uae.png',
|
||||
image: '/images/showcases/uae.webp',
|
||||
description: 'Government Open Data Portal',
|
||||
sourceUrl: 'https://github.com/FCSCOpendata/frontend',
|
||||
},
|
||||
{
|
||||
title: 'Datahub Open Data',
|
||||
href: 'https://opendata.datahub.io/',
|
||||
image: '/images/showcases/datahub.png',
|
||||
image: '/images/showcases/datahub.webp',
|
||||
description: 'Demo Data Portal by DataHub',
|
||||
},
|
||||
];
|
||||
|
||||
@ -1,61 +1,68 @@
|
||||
const config = {
|
||||
title:
|
||||
"PortalJS",
|
||||
title: 'PortalJS',
|
||||
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: {
|
||||
default: "dark",
|
||||
toggleIcon: "/images/theme-button.svg",
|
||||
default: 'dark',
|
||||
toggleIcon: '/images/theme-button.svg',
|
||||
},
|
||||
author: "Datopian",
|
||||
authorLogo: "/datopian-logo.png",
|
||||
authorUrl: "https://datopian.com/",
|
||||
author: 'Datopian',
|
||||
authorLogo: '/datopian-logo.webp',
|
||||
authorUrl: 'https://datopian.com/',
|
||||
navbarTitle: {
|
||||
// logo: "/images/logo.svg",
|
||||
text: "🌀 PortalJS",
|
||||
text: '🌀 PortalJS',
|
||||
// version: "Alpha",
|
||||
},
|
||||
navLinks: [
|
||||
{ name: "Docs", href: "/docs" },
|
||||
{ name: 'Docs', href: '/docs' },
|
||||
// { name: "Components", href: "/docs/components" },
|
||||
{ name: "Blog", href: "/blog" },
|
||||
{ name: "Showcases", href: "/#showcases" },
|
||||
{ name: "Howtos", href: "/howtos" },
|
||||
{ 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: 'Blog', href: '/blog' },
|
||||
{ name: 'Showcases', href: '/#showcases' },
|
||||
{ name: 'Howtos', href: '/howtos' },
|
||||
{ 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: "DL Demo", href: "/data-literate/demo" },
|
||||
// { name: "Excel Viewer", href: "/excel-viewer" },
|
||||
],
|
||||
footerLinks: [],
|
||||
nextSeo: {
|
||||
openGraph: {
|
||||
type: "website",
|
||||
type: 'website',
|
||||
title:
|
||||
"PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
||||
'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||
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.",
|
||||
locale: "en_US",
|
||||
'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',
|
||||
images: [
|
||||
{
|
||||
url: "/homepage-screenshot.png", // TODO
|
||||
alt: "PortalJS - rapidly build rich data portals using a modern frontend framework.",
|
||||
url: '/homepage-screenshot.png', // TODO
|
||||
alt: 'PortalJS - rapidly build rich data portals using a modern frontend framework.',
|
||||
width: 1280,
|
||||
height: 720,
|
||||
type: "image/jpg",
|
||||
type: 'image/jpg',
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
handle: "@datopian",
|
||||
site: "https://datopian.com/",
|
||||
cardType: "summary_large_image",
|
||||
handle: '@datopian',
|
||||
site: 'https://datopian.com/',
|
||||
cardType: 'summary_large_image',
|
||||
},
|
||||
},
|
||||
github: "https://github.com/datopian/portaljs",
|
||||
discord: "https://discord.gg/EeyfGrGu4U",
|
||||
github: 'https://github.com/datopian/portaljs',
|
||||
discord: 'https://discord.gg/EeyfGrGu4U',
|
||||
tableOfContents: true,
|
||||
analytics: "G-96GWZHMH57",
|
||||
analytics: 'G-96GWZHMH57',
|
||||
// editLinkShow: true,
|
||||
};
|
||||
export default config;
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import "../styles/globals.css";
|
||||
import "../styles/tailwind.css";
|
||||
import '../styles/globals.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 { siteConfig } from "../config/siteConfig";
|
||||
import { useEffect } from "react";
|
||||
import { useRouter } from "next/dist/client/router";
|
||||
import { NavGroup, NavItem, pageview, ThemeProvider } from '@portaljs/core';
|
||||
import { siteConfig } from '../config/siteConfig';
|
||||
import { useEffect } from 'react';
|
||||
import { useRouter } from 'next/dist/client/router';
|
||||
|
||||
export interface CustomAppProps {
|
||||
meta: {
|
||||
@ -32,9 +33,9 @@ function MyApp({ Component, pageProps }) {
|
||||
const handleRouteChange = (url) => {
|
||||
pageview(url);
|
||||
};
|
||||
router.events.on("routeChangeComplete", handleRouteChange);
|
||||
router.events.on('routeChangeComplete', handleRouteChange);
|
||||
return () => {
|
||||
router.events.off("routeChangeComplete", handleRouteChange);
|
||||
router.events.off('routeChangeComplete', handleRouteChange);
|
||||
};
|
||||
}
|
||||
}, [router.events]);
|
||||
@ -44,7 +45,7 @@ function MyApp({ Component, pageProps }) {
|
||||
disableTransitionOnChange
|
||||
attribute="class"
|
||||
defaultTheme={siteConfig.theme.default}
|
||||
forcedTheme={siteConfig.theme.default ? null : "light"}
|
||||
forcedTheme={siteConfig.theme.default ? null : 'light'}
|
||||
>
|
||||
<DefaultSeo defaultTitle={siteConfig.title} {...siteConfig.nextSeo} />
|
||||
|
||||
@ -71,10 +72,15 @@ function MyApp({ Component, pageProps }) {
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
{/* 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} />
|
||||
</ThemeProvider>
|
||||
);
|
||||
|
||||
@ -7,6 +7,7 @@ import Layout from '../components/Layout';
|
||||
import { useRouter } from 'next/router';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { collectHeadings } from '@portaljs/core';
|
||||
import Head from 'next/head';
|
||||
|
||||
export default function Home({ sidebarTree }) {
|
||||
const router = useRouter();
|
||||
@ -23,7 +24,11 @@ export default function Home({ sidebarTree }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layout isHomePage={true} tableOfContents={tableOfContents} sidebarTree={sidebarTree} >
|
||||
<Layout
|
||||
isHomePage={true}
|
||||
tableOfContents={tableOfContents}
|
||||
sidebarTree={sidebarTree}
|
||||
>
|
||||
<Features />
|
||||
<Showcases />
|
||||
<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 |