Compare commits

..

4 Commits

Author SHA1 Message Date
Luccas Mateus de Medeiros Gomes
8784621e43 [site][xs] - fix accessbiility 2023-07-20 11:11:35 -03:00
Luccas Mateus de Medeiros Gomes
6a3b01fd91 [site][lighthouse] - increate accessibility 2023-07-20 10:18:49 -03:00
Luccas Mateus de Medeiros Gomes
e908cb9344 [site][m] - improvements to lighthouse score 2023-07-17 14:44:29 -03:00
João Demenech
172b4b71d4 Merge pull request #980 from datopian/bugfix/pdf-styles
Bugfix/pdf styles
2023-07-17 14:38:34 -03:00
19 changed files with 3223 additions and 96 deletions

View File

@@ -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 {
@@ -41,7 +41,7 @@ export function Hero() {
{/* Commented code on line 37, 39 and 113 will reenable the two columns hero */} {/* Commented code on line 37, 39 and 113 will reenable the two columns hero */}
<div className="mx-auto grid max-w-2xl grid-cols-1 gap-y-16 gap-x-8 px-4 lg:max-w-8xl lg:grid-cols-2 lg:px-8 xl:gap-x-16 xl:px-12"> <div className="mx-auto grid max-w-2xl grid-cols-1 gap-y-16 gap-x-8 px-4 lg:max-w-8xl lg:grid-cols-2 lg:px-8 xl:gap-x-16 xl:px-12">
<div className="relative mb-10 lg:mb-0 md:text-center lg:text-left"> <div className="relative mb-10 lg:mb-0 md:text-center lg:text-left">
<div role="heading"> <div>
<h1 className="inline bg-gradient-to-r from-blue-500 via-blue-300 to-blue-500 bg-clip-text text-5xl tracking-tight text-transparent"> <h1 className="inline bg-gradient-to-r from-blue-500 via-blue-300 to-blue-500 bg-clip-text text-5xl tracking-tight text-transparent">
The JavaScript framework for data portals The JavaScript framework for data portals
</h1> </h1>
@@ -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>

View File

@@ -20,7 +20,7 @@ export default function NavItem({ item }) {
}; };
return ( return (
<Menu as="div" className="relative"> <Menu as="div" role="menu" className="relative">
<Menu.Item> <Menu.Item>
{Object.prototype.hasOwnProperty.call(item, 'href') ? ( {Object.prototype.hasOwnProperty.call(item, 'href') ? (
<Link <Link

View File

@@ -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"
/> />

View File

@@ -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',
}, },
]; ];

View File

@@ -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;

View File

@@ -38,7 +38,7 @@ Let's check it's working and what we have! Open http://localhost:3000 from your
You should see a page like this when you access http://localhost:3000. This is the starter template page which shows the most simple data portal you could have: a simple README plus csv file. You should see a page like this when you access http://localhost:3000. This is the starter template page which shows the most simple data portal you could have: a simple README plus csv file.
<img src="/assets/examples/basic-example.png" /> <img src="/assets/examples/basic-example.png" alt="Basic example" />
### Editing the Page ### Editing the Page
@@ -51,8 +51,8 @@ Lets try editing the starter page.
After refreshing the page, you should see the new text: After refreshing the page, you should see the new text:
<img src="/assets/docs/editing-the-page-1.png" /> <img src="/assets/docs/editing-the-page-1.png" alt="Editing base example" />
Congratulations! The app is up and running and you learned how to edit a page. In the next lesson, you are going to learn how to create new datasets. Congratulations! The app is up and running and you learned how to edit a page. In the next lesson, you are going to learn how to create new datasets.
<DocsPagination next="/docs/creating-new-datasets" /> <DocsPagination next="/docs/creating-new-datasets" />

View File

@@ -1,21 +1,21 @@
import { h } from "hastscript"; import { h } from 'hastscript';
import matter from "gray-matter"; import matter from 'gray-matter';
import mdxmermaid from "mdx-mermaid"; import mdxmermaid from 'mdx-mermaid';
import remarkCallouts from "@portaljs/remark-callouts"; import remarkCallouts from '@portaljs/remark-callouts';
import remarkEmbed from "@portaljs/remark-embed"; import remarkEmbed from '@portaljs/remark-embed';
import remarkGfm from "remark-gfm"; import remarkGfm from 'remark-gfm';
import remarkMath from "remark-math"; import remarkMath from 'remark-math';
import remarkSmartypants from "remark-smartypants"; import remarkSmartypants from 'remark-smartypants';
import remarkToc from "remark-toc"; import remarkToc from 'remark-toc';
import remarkWikiLink, { getPermalinks } from "@portaljs/remark-wiki-link"; import remarkWikiLink, { getPermalinks } from '@portaljs/remark-wiki-link';
import rehypeAutolinkHeadings from "rehype-autolink-headings"; import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeKatex from "rehype-katex"; import rehypeKatex from 'rehype-katex';
import rehypeSlug from "rehype-slug"; import rehypeSlug from 'rehype-slug';
import rehypePrismPlus from "rehype-prism-plus"; import rehypePrismPlus from 'rehype-prism-plus';
import { serialize } from "next-mdx-remote/serialize"; import { serialize } from 'next-mdx-remote/serialize';
import * as tw from "../tailwind.config"; import * as tw from '../tailwind.config';
import { siteConfig } from "../config/siteConfig"; import { siteConfig } from '../config/siteConfig';
/** /**
* Parse a markdown or MDX file to an MDX source form + front matter data * Parse a markdown or MDX file to an MDX source form + front matter data
@@ -36,14 +36,14 @@ const parse = async function (source, format, scope) {
remarkPlugins: [ remarkPlugins: [
remarkEmbed, remarkEmbed,
remarkGfm, remarkGfm,
[remarkSmartypants, { quotes: false, dashes: "oldschool" }], [remarkSmartypants, { quotes: false, dashes: 'oldschool' }],
remarkMath, remarkMath,
remarkCallouts, remarkCallouts,
[remarkWikiLink, { permalinks, pathFormat: "obsidian-short" }], [remarkWikiLink, { permalinks, pathFormat: 'obsidian-short' }],
[ [
remarkToc, remarkToc,
{ {
heading: "Table of contents", heading: 'Table of contents',
tight: true, tight: true,
}, },
], ],
@@ -54,29 +54,36 @@ const parse = async function (source, format, scope) {
[ [
rehypeAutolinkHeadings, rehypeAutolinkHeadings,
{ {
properties: { className: "heading-link" }, properties: { className: 'heading-link' },
test(element) { test(element) {
return ( return (
["h2", "h3", "h4", "h5", "h6"].includes(element.tagName) && ['h2', 'h3', 'h4', 'h5', 'h6'].includes(element.tagName) &&
element.properties?.id !== "table-of-contents" && element.properties?.id !== 'table-of-contents' &&
element.properties?.className !== "blockquote-heading" element.properties?.className !== 'blockquote-heading'
); );
}, },
content() { content(node) {
return [ return [
h( h(
"svg", 'span.invisible.block.h-0.w-0',
{ ariaLabel: node.properties.id },
'Read the “',
node.properties.id,
'” section'
),
h(
'svg',
{ {
xmlns: "http:www.w3.org/2000/svg", xmlns: 'http:www.w3.org/2000/svg',
fill: tw.theme.extend.colors.secondary.DEFAULT, fill: tw.theme.extend.colors.secondary.DEFAULT,
viewBox: "0 0 20 20", viewBox: '0 0 20 20',
className: "w-5 h-5", className: 'w-5 h-5',
}, },
[ [
h("path", { h('path', {
fillRule: "evenodd", fillRule: 'evenodd',
clipRule: "evenodd", clipRule: 'evenodd',
d: "M9.493 2.853a.75.75 0 00-1.486-.205L7.545 6H4.198a.75.75 0 000 1.5h3.14l-.69 5H3.302a.75.75 0 000 1.5h3.14l-.435 3.148a.75.75 0 001.486.205L7.955 14h2.986l-.434 3.148a.75.75 0 001.486.205L12.456 14h3.346a.75.75 0 000-1.5h-3.14l.69-5h3.346a.75.75 0 000-1.5h-3.14l.435-3.147a.75.75 0 00-1.486-.205L12.045 6H9.059l.434-3.147zM8.852 7.5l-.69 5h2.986l.69-5H8.852z", d: 'M9.493 2.853a.75.75 0 00-1.486-.205L7.545 6H4.198a.75.75 0 000 1.5h3.14l-.69 5H3.302a.75.75 0 000 1.5h3.14l-.435 3.148a.75.75 0 001.486.205L7.955 14h2.986l-.434 3.148a.75.75 0 001.486.205L12.456 14h3.346a.75.75 0 000-1.5h-3.14l.69-5h3.346a.75.75 0 000-1.5h-3.14l.435-3.147a.75.75 0 00-1.486-.205L12.045 6H9.059l.434-3.147zM8.852 7.5l-.69 5h2.986l.69-5H8.852z',
}), }),
] ]
), ),
@@ -84,7 +91,7 @@ const parse = async function (source, format, scope) {
}, },
}, },
], ],
[rehypeKatex, { output: "mathml" }], [rehypeKatex, { output: 'mathml' }],
[rehypePrismPlus, { ignoreMissing: true }], [rehypePrismPlus, { ignoreMissing: true }],
], ],
format, format,

View File

@@ -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>
); );

View File

@@ -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 />

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@@ -1,4 +1,4 @@
@import "@portaljs/remark-callouts/styles.css"; @import '@portaljs/remark-callouts/styles.css';
@import './prism.css'; @import './prism.css';
html, html,
@@ -31,7 +31,7 @@ html {
/* tooltip fade-out clip */ /* tooltip fade-out clip */
.tooltip-body::after { .tooltip-body::after {
content: ""; content: '';
position: absolute; position: absolute;
right: 0; right: 0;
top: 3.6rem; /* multiple of $line-height used on the tooltip body (defined in tooltipBodyStyle) */ top: 3.6rem; /* multiple of $line-height used on the tooltip body (defined in tooltipBodyStyle) */

3098
site/styles/sib-form.css Normal file

File diff suppressed because it is too large Load Diff