[site,seo][xs]: merge main and fix conflict

This commit is contained in:
João Demenech 2023-07-21 17:58:58 -03:00
commit 3e9eadcc69
6 changed files with 51 additions and 39 deletions

View File

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

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

@ -52,7 +52,12 @@ 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:
<<<<<<< HEAD
<img src="/assets/docs/editing-the-page-1.png" alt="PortalJS tutorial project after a simple change is made by a user" /> <img src="/assets/docs/editing-the-page-1.png" alt="PortalJS tutorial project after a simple change is made by a user" />
=======
<img src="/assets/docs/editing-the-page-1.png" alt="Editing base example" />
> > > > > > > da226ef2056391bc2f710b6229645c25488485fb
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.

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

@ -63,7 +63,7 @@ function MyApp({ Component, pageProps }) {
/> />
<Script <Script
id="gtag-init" id="gtag-init"
strategy="afterInteractive" strategy="lazyOnload"
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: ` __html: `
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];

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) */