SEO Improvements (#983)
* [site,seo][xs]: add custom _document with lang prop, add description to meta tags, make title larger * [site,seo][xs]: add apple touch icon, add alt props to images * [site,seo][xs]: add icon to default seo * [site,seo][s]: implement next-sitemap * [site,seo][s]: review page titles * Rebuild package-lock.json files * Regenerate package-lock
This commit is contained in:
parent
d5899b22ab
commit
9dea140859
2
package-lock.json
generated
2
package-lock.json
generated
@ -40048,7 +40048,7 @@
|
|||||||
},
|
},
|
||||||
"packages/components": {
|
"packages/components": {
|
||||||
"name": "@portaljs/components",
|
"name": "@portaljs/components",
|
||||||
"version": "0.2.0",
|
"version": "0.3.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@githubocto/flat-ui": "^0.14.1",
|
"@githubocto/flat-ui": "^0.14.1",
|
||||||
"@heroicons/react": "^2.0.17",
|
"@heroicons/react": "^2.0.17",
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "portaljs",
|
"name": "portaljs",
|
||||||
"workspaces": ["./packages/*"],
|
"workspaces": [
|
||||||
|
"./packages/*"
|
||||||
|
],
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
5
site/.gitignore
vendored
5
site/.gitignore
vendored
@ -35,3 +35,8 @@ yarn-error.log*
|
|||||||
|
|
||||||
# markdowndb
|
# markdowndb
|
||||||
markdown.db
|
markdown.db
|
||||||
|
|
||||||
|
# seo
|
||||||
|
robots.txt
|
||||||
|
sitemap-0.xml
|
||||||
|
sitemap.xml
|
||||||
|
|||||||
@ -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="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">
|
<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">
|
<h2 className="mt-4 font-display text-base text-primary dark:text-primary-dark">
|
||||||
<span className="absolute -inset-px rounded-xl" />
|
<span className="absolute -inset-px rounded-xl" />
|
||||||
{feature.title}
|
{feature.title}
|
||||||
|
|||||||
@ -12,7 +12,6 @@ export default function MDXPage({ source, frontMatter }) {
|
|||||||
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
|
return <LayoutComponent {...frontMatter}>{children}</LayoutComponent>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<MDXRemote {...source} components={{ DocsPagination, NextSeo, Hero }} />
|
<MDXRemote {...source} components={{ DocsPagination, NextSeo, Hero }} />
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
const config = {
|
const config = {
|
||||||
title: 'PortalJS',
|
title: 'PortalJS - The JavaScript framework for data portals.',
|
||||||
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.',
|
||||||
theme: {
|
theme: {
|
||||||
default: 'dark',
|
default: 'dark',
|
||||||
toggleIcon: '/images/theme-button.svg',
|
toggleIcon: '/images/theme-button.svg',
|
||||||
@ -36,6 +36,10 @@ const config = {
|
|||||||
],
|
],
|
||||||
footerLinks: [],
|
footerLinks: [],
|
||||||
nextSeo: {
|
nextSeo: {
|
||||||
|
additionalLinkTags: [
|
||||||
|
{ rel: 'icon', href: '/favicon.ico' },
|
||||||
|
{ rel: 'apple-touch-icon', href: '/icon.png', sizes: '120x120' },
|
||||||
|
],
|
||||||
openGraph: {
|
openGraph: {
|
||||||
type: 'website',
|
type: 'website',
|
||||||
title:
|
title:
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
---
|
---
|
||||||
showToc: false
|
showToc: false
|
||||||
showSidebar: 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" />
|
<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! 🎉
|
- Visit the site! Yay! Your changes are live! 🎉
|
||||||
|
|
||||||
> [!tip]
|
> [!tip]
|
||||||
> Read full tutorial [[edit-a-website-locally|here!]]
|
> Read full tutorial [[edit-a-website-locally|here!]]
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
# Guides and tutorials
|
---
|
||||||
|
title: Guides and Tutorials
|
||||||
|
---
|
||||||
|
|
||||||
- [[howtos/analytics|How to add web analytics?]]
|
- [[howtos/analytics|How to add web analytics?]]
|
||||||
- [[howtos/seo|How to customize page metadata for SEO?]]
|
- [[howtos/seo|How to customize page metadata for SEO?]]
|
||||||
|
|||||||
@ -6,7 +6,7 @@ export default function DefaultLayout({ children, ...frontMatter }) {
|
|||||||
{/* Default layout */}
|
{/* Default layout */}
|
||||||
{!frontMatter.layout && (
|
{!frontMatter.layout && (
|
||||||
<>
|
<>
|
||||||
<h1>{frontMatter.title}</h1>
|
{!frontMatter.disableTitle && <h1>{frontMatter.title}</h1>}
|
||||||
{frontMatter.author && (
|
{frontMatter.author && (
|
||||||
<div className="-mt-6">
|
<div className="-mt-6">
|
||||||
<p className="opacity-60 pl-1">{frontMatter.author}</p>
|
<p className="opacity-60 pl-1">{frontMatter.author}</p>
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export const DocsLayout: React.FC<any> = ({ children, ...frontMatter }) => {
|
|||||||
<time dateTime={created}>{formatDate(created)}</time>
|
<time dateTime={created}>{formatDate(created)}</time>
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{title && <h1>{title}</h1>}
|
{!frontMatter.disableTitle && title && <h1>{title}</h1>}
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<section>{children}</section>
|
<section>{children}</section>
|
||||||
|
|||||||
5
site/next-sitemap.config.js
Normal file
5
site/next-sitemap.config.js
Normal 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
49
site/package-lock.json
generated
@ -50,6 +50,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/typography": "^0.5.9",
|
"@tailwindcss/typography": "^0.5.9",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
|
"next-sitemap": "^4.1.8",
|
||||||
"postcss": "^8.4.22",
|
"postcss": "^8.4.22",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"remark": "^14.0.2",
|
"remark": "^14.0.2",
|
||||||
@ -229,6 +230,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz",
|
||||||
"integrity": "sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg=="
|
"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": {
|
"node_modules/@docsearch/css": {
|
||||||
"version": "3.5.0",
|
"version": "3.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/@docsearch/css/-/css-3.5.0.tgz",
|
||||||
@ -7087,6 +7094,15 @@
|
|||||||
"node": "*"
|
"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": {
|
"node_modules/minipass": {
|
||||||
"version": "3.3.6",
|
"version": "3.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz",
|
||||||
@ -7330,6 +7346,39 @@
|
|||||||
"react-dom": ">=16.0.0"
|
"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": {
|
"node_modules/next-themes": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.2.1.tgz",
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
"dev": "npm run mddb && next dev",
|
"dev": "npm run mddb && next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"prebuild": "npm run mddb && node ./scripts/fix-symlinks.mjs",
|
"prebuild": "npm run mddb && node ./scripts/fix-symlinks.mjs",
|
||||||
|
"postbuild": "next-sitemap",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"mddb": "mddb content"
|
"mddb": "mddb content"
|
||||||
},
|
},
|
||||||
@ -52,6 +53,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tailwindcss/typography": "^0.5.9",
|
"@tailwindcss/typography": "^0.5.9",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
|
"next-sitemap": "^4.1.8",
|
||||||
"postcss": "^8.4.22",
|
"postcss": "^8.4.22",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^2.8.7",
|
||||||
"remark": "^14.0.2",
|
"remark": "^14.0.2",
|
||||||
|
|||||||
@ -47,7 +47,12 @@ function MyApp({ Component, pageProps }) {
|
|||||||
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}
|
||||||
|
description={siteConfig.description}
|
||||||
|
titleTemplate="PortalJS - %s"
|
||||||
|
{...siteConfig.nextSeo}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Global Site Tag (gtag.js) - Google Analytics */}
|
{/* Global Site Tag (gtag.js) - Google Analytics */}
|
||||||
{siteConfig.analytics && (
|
{siteConfig.analytics && (
|
||||||
|
|||||||
13
site/pages/_document.tsx
Normal file
13
site/pages/_document.tsx
Normal 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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -3,10 +3,12 @@ import computeFields from '@/lib/computeFields';
|
|||||||
import clientPromise from '@/lib/mddb';
|
import clientPromise from '@/lib/mddb';
|
||||||
import { BlogsList, SimpleLayout } from '@portaljs/core';
|
import { BlogsList, SimpleLayout } from '@portaljs/core';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import {NextSeo} from 'next-seo';
|
||||||
|
|
||||||
export default function Blog({ blogs }) {
|
export default function Blog({ blogs }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
<NextSeo title="Blog posts" />
|
||||||
<Layout>
|
<Layout>
|
||||||
<SimpleLayout title="Blog posts">
|
<SimpleLayout title="Blog posts">
|
||||||
<BlogsList blogs={blogs} />
|
<BlogsList blogs={blogs} />
|
||||||
|
|||||||
BIN
site/public/icon.png
Normal file
BIN
site/public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Loading…
x
Reference in New Issue
Block a user