Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .remarkrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"remark-frontmatter",
"remark-preset-lint-node",
["remark-lint-first-heading-level", false],
["remark-lint-maximum-line-length", false]
["remark-lint-maximum-line-length", false],
["remark-lint-prohibited-strings", false]
]
}
348 changes: 348 additions & 0 deletions content/about/privacy.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = {
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'data',
name: 'about',
path: `${__dirname}/content/about`,
},
},
Expand Down
1 change: 1 addition & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ exports.createPages = ({ graphql, actions }) => {
"homepage"
"trademark-policy"
"resources"
"privacy-policy"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports[`Tests for Footer component renders correctly 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
9 changes: 3 additions & 6 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Link } from 'gatsby';
import React from 'react';
import RandomContributor from '../RandomContributor';
import './footer.scss';

Expand All @@ -23,12 +23,9 @@ function Footer(): JSX.Element {
</Link>
</li>
<li>
<a
className="footer__link"
href="https://nodejs.org/en/about/privacy/"
>
<Link className="footer__link" to="/privacy">
Privacy Policy
</a>
</Link>
</li>
<li>
<a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ exports[`CenteredLayout component renders correctly with footer 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ exports[`PageLayout component renders correctly with data 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
46 changes: 46 additions & 0 deletions src/pages/privacy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';
import { graphql } from 'gatsby';
import { Page } from '../types';
import Layout from '../components/Layout';
import Article from '../components/Article';
import Footer from '../components/Footer';
import '../styles/article-reader.scss';

export default function PrivacyPage({ data }: Page): JSX.Element {
const { title, description } = data.page.frontmatter;
const { html, tableOfContents } = data.page;
const { authors } = data.page.fields;

return (
<>
<Layout title={title} description={description} showFooter={false}>
<main className="blog-container">
<Article
title={title}
html={html}
tableOfContents={tableOfContents}
authors={authors}
editPath="content/about/privacy.md"
/>
</main>
</Layout>
<Footer />
</>
);
}

export const query = graphql`
query {
page: markdownRemark(fields: { slug: { eq: "privacy-policy" } }) {
html
tableOfContents(absolute: false, pathToSlugField: "frontmatter.path")
frontmatter {
title
description
}
fields {
authors
}
}
}
`;
16 changes: 16 additions & 0 deletions test/__fixtures__/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,19 @@ export const createResourcesData = (): Page => ({
},
},
});

export const createPrivacyData = (): Page => ({
data: {
page: {
fields: {
authors: ['Author'],
},
frontmatter: {
description: 'Description',
title: 'Title',
},
html: '<div>Sample</div>',
tableOfContents: 'Table of Contents',
},
},
});
2 changes: 1 addition & 1 deletion test/pages/__snapshots__/404.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ exports[`404 page renders correctly 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
4 changes: 2 additions & 2 deletions test/pages/__snapshots__/blog.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ exports[`Blog page renders correctly 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down Expand Up @@ -485,7 +485,7 @@ exports[`Blog page renders correctly for empty blogs list 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
4 changes: 2 additions & 2 deletions test/pages/__snapshots__/download.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ exports[`Download page renders correctly 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down Expand Up @@ -1086,7 +1086,7 @@ exports[`Download page should handle LTS to Current switch 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
2 changes: 1 addition & 1 deletion test/pages/__snapshots__/home.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ exports[`Home page renders correctly 1`] = `
<li>
<a
class="footer__link"
href="https://nodejs.org/en/about/privacy/"
href="/privacy"
>
Privacy Policy
</a>
Expand Down
Loading