Compare commits

..

10 Commits

Author SHA1 Message Date
João Demenech
709b10cef3 Regenerate package-lock 2023-07-18 15:06:00 -03:00
João Demenech
ec8c5d27e8 Rebuild package-lock.json files 2023-07-18 15:04:51 -03:00
João Demenech
cf6fab2c4f [site,seo][s]: review page titles 2023-07-18 11:09:03 -03:00
João Demenech
5088afe69a [site,seo][s]: implement next-sitemap 2023-07-18 10:35:31 -03:00
João Demenech
95af903642 [site,seo][xs]: add icon to default seo 2023-07-18 10:27:27 -03:00
João Demenech
9fee284097 [site,seo][xs]: add apple touch icon, add alt props to images 2023-07-18 10:25:19 -03:00
João Demenech
11a4272f16 [site,seo][xs]: add custom _document with lang prop, add description to meta tags, make title larger 2023-07-18 09:38:30 -03:00
João Demenech
349f5bea66 Merge pull request #982 from datopian/lighthouse-improvements
[site][m] - improvements to lighthouse score
2023-07-17 15:04:25 -03:00
João Demenech
6aef860a81 Merge pull request #981 from datopian/changeset-release/main
Version Packages
2023-07-17 14:51:08 -03:00
github-actions[bot]
1a22e54d5b Version Packages 2023-07-17 17:41:23 +00:00
25 changed files with 149 additions and 65 deletions

View File

@@ -1,5 +0,0 @@
---
'@portaljs/components': patch
---
Fix missing CSS styles for PDF component

2
package-lock.json generated
View File

@@ -40048,7 +40048,7 @@
},
"packages/components": {
"name": "@portaljs/components",
"version": "0.2.0",
"version": "0.3.1",
"dependencies": {
"@githubocto/flat-ui": "^0.14.1",
"@heroicons/react": "^2.0.17",

View File

@@ -1,6 +1,8 @@
{
"name": "portaljs",
"workspaces": ["./packages/*"],
"workspaces": [
"./packages/*"
],
"version": "0.0.0",
"license": "MIT",
"scripts": {

View File

@@ -1,5 +1,11 @@
# @portaljs/components
## 0.3.1
### Patch Changes
- [#980](https://github.com/datopian/portaljs/pull/980) [`38738525`](https://github.com/datopian/portaljs/commit/3873852567b1aab4827a716bd588bd5de3223e2b) Thanks [@demenech](https://github.com/demenech)! - Fix missing CSS styles for PDF component
## 0.3.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@portaljs/components",
"version": "0.3.0",
"version": "0.3.1",
"type": "module",
"description": "https://portaljs.org",
"keywords": [

5
site/.gitignore vendored
View File

@@ -35,3 +35,8 @@ yarn-error.log*
# markdowndb
markdown.db
# seo
robots.txt
sitemap-0.xml
sitemap.xml

View File

@@ -58,7 +58,7 @@ export default function Features() {
>
<div className="absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.blue.300),theme(colors.blue.400),theme(colors.blue.500))_border-box] group-hover:opacity-100 dark:[--quick-links-hover-bg:theme(colors.slate.800)]" />
<div className="relative overflow-hidden rounded-xl p-6">
<img src={feature.icon} alt="" className="h-24 w-auto" />
<img src={feature.icon} alt={feature.title} className="h-24 w-auto" />
<h2 className="mt-4 font-display text-base text-primary dark:text-primary-dark">
<span className="absolute -inset-px rounded-xl" />
{feature.title}

View File

@@ -41,7 +41,7 @@ export function 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="relative mb-10 lg:mb-0 md:text-center lg:text-left">
<div>
<div role="heading">
<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
</h1>

View File

@@ -12,7 +12,6 @@ export default function MDXPage({ source, frontMatter }) {
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
};
return (
<Layout>
<MDXRemote {...source} components={{ DocsPagination, NextSeo, Hero }} />

View File

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

View File

@@ -1,7 +1,7 @@
const config = {
title: 'PortalJS',
title: 'PortalJS - The JavaScript framework for data portals.',
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.',
theme: {
default: 'dark',
toggleIcon: '/images/theme-button.svg',
@@ -36,6 +36,10 @@ const config = {
],
footerLinks: [],
nextSeo: {
additionalLinkTags: [
{ rel: 'icon', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/icon.png', sizes: '120x120' },
],
openGraph: {
type: 'website',
title:

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.
<img src="/assets/examples/basic-example.png" alt="Basic example" />
<img src="/assets/examples/basic-example.png" />
### Editing the Page
@@ -51,8 +51,8 @@ Lets try editing the starter page.
After refreshing the page, you should see the new text:
<img src="/assets/docs/editing-the-page-1.png" alt="Editing base example" />
<img src="/assets/docs/editing-the-page-1.png" />
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" />

View File

@@ -1,6 +1,8 @@
---
showToc: false
showSidebar: false
title: "Markdown-based Websites Guide"
disableTitle: true
---
<Hero title="Markdown-based Websites" subtitle="Create markdown-based website, update it, add collaborators and discover markdown superpowers" />
@@ -79,4 +81,4 @@ Below is a screenshot of how the final website will look like:
- Visit the site! Yay! Your changes are live! 🎉
> [!tip]
> Read full tutorial [[edit-a-website-locally|here!]]
> Read full tutorial [[edit-a-website-locally|here!]]

View File

@@ -1,4 +1,6 @@
# Guides and tutorials
---
title: Guides and Tutorials
---
- [[howtos/analytics|How to add web analytics?]]
- [[howtos/seo|How to customize page metadata for SEO?]]

View File

@@ -6,7 +6,7 @@ export default function DefaultLayout({ children, ...frontMatter }) {
{/* Default layout */}
{!frontMatter.layout && (
<>
<h1>{frontMatter.title}</h1>
{!frontMatter.disableTitle && <h1>{frontMatter.title}</h1>}
{frontMatter.author && (
<div className="-mt-6">
<p className="opacity-60 pl-1">{frontMatter.author}</p>

View File

@@ -13,7 +13,7 @@ export const DocsLayout: React.FC<any> = ({ children, ...frontMatter }) => {
<time dateTime={created}>{formatDate(created)}</time>
</p>
)}
{title && <h1>{title}</h1>}
{!frontMatter.disableTitle && title && <h1>{title}</h1>}
</div>
</header>
<section>{children}</section>

View File

@@ -1,21 +1,21 @@
import { h } from 'hastscript';
import matter from 'gray-matter';
import mdxmermaid from 'mdx-mermaid';
import remarkCallouts from '@portaljs/remark-callouts';
import remarkEmbed from '@portaljs/remark-embed';
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
import remarkSmartypants from 'remark-smartypants';
import remarkToc from 'remark-toc';
import remarkWikiLink, { getPermalinks } from '@portaljs/remark-wiki-link';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypeKatex from 'rehype-katex';
import rehypeSlug from 'rehype-slug';
import rehypePrismPlus from 'rehype-prism-plus';
import { serialize } from 'next-mdx-remote/serialize';
import { h } from "hastscript";
import matter from "gray-matter";
import mdxmermaid from "mdx-mermaid";
import remarkCallouts from "@portaljs/remark-callouts";
import remarkEmbed from "@portaljs/remark-embed";
import remarkGfm from "remark-gfm";
import remarkMath from "remark-math";
import remarkSmartypants from "remark-smartypants";
import remarkToc from "remark-toc";
import remarkWikiLink, { getPermalinks } from "@portaljs/remark-wiki-link";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypeKatex from "rehype-katex";
import rehypeSlug from "rehype-slug";
import rehypePrismPlus from "rehype-prism-plus";
import { serialize } from "next-mdx-remote/serialize";
import * as tw from '../tailwind.config';
import { siteConfig } from '../config/siteConfig';
import * as tw from "../tailwind.config";
import { siteConfig } from "../config/siteConfig";
/**
* 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: [
remarkEmbed,
remarkGfm,
[remarkSmartypants, { quotes: false, dashes: 'oldschool' }],
[remarkSmartypants, { quotes: false, dashes: "oldschool" }],
remarkMath,
remarkCallouts,
[remarkWikiLink, { permalinks, pathFormat: 'obsidian-short' }],
[remarkWikiLink, { permalinks, pathFormat: "obsidian-short" }],
[
remarkToc,
{
heading: 'Table of contents',
heading: "Table of contents",
tight: true,
},
],
@@ -54,36 +54,29 @@ const parse = async function (source, format, scope) {
[
rehypeAutolinkHeadings,
{
properties: { className: 'heading-link' },
properties: { className: "heading-link" },
test(element) {
return (
['h2', 'h3', 'h4', 'h5', 'h6'].includes(element.tagName) &&
element.properties?.id !== 'table-of-contents' &&
element.properties?.className !== 'blockquote-heading'
["h2", "h3", "h4", "h5", "h6"].includes(element.tagName) &&
element.properties?.id !== "table-of-contents" &&
element.properties?.className !== "blockquote-heading"
);
},
content(node) {
content() {
return [
h(
'span.invisible.block.h-0.w-0',
{ ariaLabel: node.properties.id },
'Read the “',
node.properties.id,
'” section'
),
h(
'svg',
"svg",
{
xmlns: 'http:www.w3.org/2000/svg',
xmlns: "http:www.w3.org/2000/svg",
fill: tw.theme.extend.colors.secondary.DEFAULT,
viewBox: '0 0 20 20',
className: 'w-5 h-5',
viewBox: "0 0 20 20",
className: "w-5 h-5",
},
[
h('path', {
fillRule: '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',
h("path", {
fillRule: "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",
}),
]
),
@@ -91,7 +84,7 @@ const parse = async function (source, format, scope) {
},
},
],
[rehypeKatex, { output: 'mathml' }],
[rehypeKatex, { output: "mathml" }],
[rehypePrismPlus, { ignoreMissing: true }],
],
format,

View File

@@ -0,0 +1,5 @@
/** @type {import('next-sitemap').IConfig} */
module.exports = {
siteUrl: process.env.SITE_URL || 'https://portaljs.org',
generateRobotsTxt: true,
}

49
site/package-lock.json generated
View File

@@ -50,6 +50,7 @@
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"next-sitemap": "^4.1.8",
"postcss": "^8.4.22",
"prettier": "^2.8.7",
"remark": "^14.0.2",
@@ -229,6 +230,12 @@
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz",
"integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg=="
},
"node_modules/@corex/deepmerge": {
"version": "4.0.43",
"resolved": "https://registry.npmjs.org/@corex/deepmerge/-/deepmerge-4.0.43.tgz",
"integrity": "sha512-N8uEMrMPL0cu/bdboEWpQYb/0i2K5Qn8eCsxzOmxSggJbbQte7ljMRoXm917AbntqTGOzdTu+vP3KOOzoC70HQ==",
"dev": true
},
"node_modules/@docsearch/css": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.0.tgz",
@@ -7087,6 +7094,15 @@
"node": "*"
}
},
"node_modules/minimist": {
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/minipass": {
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
@@ -7330,6 +7346,39 @@
"react-dom": ">=16.0.0"
}
},
"node_modules/next-sitemap": {
"version": "4.1.8",
"resolved": "https://registry.npmjs.org/next-sitemap/-/next-sitemap-4.1.8.tgz",
"integrity": "sha512-XAXpBHX4o89JfMgvrm0zimlZwpu2iBPXHpimJMUrqOZSc4C2oB1Lv89mxuVON9IE8HOezaM+w4GjJxcYCuGPTQ==",
"dev": true,
"funding": [
{
"url": "https://github.com/iamvishnusankar/next-sitemap.git"
}
],
"dependencies": {
"@corex/deepmerge": "^4.0.43",
"@next/env": "^13.4.3",
"fast-glob": "^3.2.12",
"minimist": "^1.2.8"
},
"bin": {
"next-sitemap": "bin/next-sitemap.mjs",
"next-sitemap-cjs": "bin/next-sitemap.cjs"
},
"engines": {
"node": ">=14.18"
},
"peerDependencies": {
"next": "*"
}
},
"node_modules/next-sitemap/node_modules/@next/env": {
"version": "13.4.10",
"resolved": "https://registry.npmjs.org/@next/env/-/env-13.4.10.tgz",
"integrity": "sha512-3G1yD/XKTSLdihyDSa8JEsaWOELY+OWe08o0LUYzfuHp1zHDA8SObQlzKt+v+wrkkPcnPweoLH1ImZeUa0A1NQ==",
"dev": true
},
"node_modules/next-themes": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",

View File

@@ -6,6 +6,7 @@
"dev": "npm run mddb && next dev",
"build": "next build",
"prebuild": "npm run mddb && node ./scripts/fix-symlinks.mjs",
"postbuild": "next-sitemap",
"start": "next start",
"mddb": "mddb content"
},
@@ -52,6 +53,7 @@
"devDependencies": {
"@tailwindcss/typography": "^0.5.9",
"autoprefixer": "^10.4.14",
"next-sitemap": "^4.1.8",
"postcss": "^8.4.22",
"prettier": "^2.8.7",
"remark": "^14.0.2",

View File

@@ -47,7 +47,12 @@ function MyApp({ Component, pageProps }) {
defaultTheme={siteConfig.theme.default}
forcedTheme={siteConfig.theme.default ? null : 'light'}
>
<DefaultSeo defaultTitle={siteConfig.title} {...siteConfig.nextSeo} />
<DefaultSeo
defaultTitle={siteConfig.title}
description={siteConfig.description}
titleTemplate="PortalJS - %s"
{...siteConfig.nextSeo}
/>
{/* Global Site Tag (gtag.js) - Google Analytics */}
{siteConfig.analytics && (

13
site/pages/_document.tsx Normal file
View File

@@ -0,0 +1,13 @@
import { Html, Head, Main, NextScript } from 'next/document';
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
);
}

View File

@@ -3,10 +3,12 @@ import computeFields from '@/lib/computeFields';
import clientPromise from '@/lib/mddb';
import { BlogsList, SimpleLayout } from '@portaljs/core';
import * as fs from 'fs';
import {NextSeo} from 'next-seo';
export default function Blog({ blogs }) {
return (
<>
<NextSeo title="Blog posts" />
<Layout>
<SimpleLayout title="Blog posts">
<BlogsList blogs={blogs} />

BIN
site/public/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

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