Add beginner page
This commit is contained in:
@ -87,6 +87,15 @@ exports.createPages = ({ graphql, actions }) => {
|
||||
});
|
||||
});
|
||||
|
||||
createPage({
|
||||
path: `/beginner`,
|
||||
component: tagPage,
|
||||
context: {
|
||||
tag: `beginner snippets`,
|
||||
tagRegex: `/beginner/`,
|
||||
},
|
||||
});
|
||||
|
||||
return null;
|
||||
});
|
||||
};
|
||||
|
||||
@ -21,9 +21,9 @@ const ArchivePage = props => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Meta title='Archived' />
|
||||
<Meta title='Archived snippets' />
|
||||
<Shell>
|
||||
<h2 className='page-title'>Archived</h2>
|
||||
<h2 className='page-title'>Archived snippets</h2>
|
||||
<p className='page-sub-title'>These snippets, while useful and interesting, didn't quite make it into the repository due to either having very specific use-cases or being outdated. However we felt like they might still be useful to some readers, so here they are.</p>
|
||||
<p className='light-sub'>Click on a snippet's name to view its code.</p>
|
||||
{posts &&
|
||||
|
||||
@ -64,7 +64,12 @@ const ListPage = props => {
|
||||
{
|
||||
url: 'about',
|
||||
title: 'About',
|
||||
description: 'A few word about us, our goals and our projects.'
|
||||
description: 'A few word about us, our goals and our projects.',
|
||||
},
|
||||
{
|
||||
url: 'beginner',
|
||||
title: 'Beginner snippets',
|
||||
description: 'Snippets aimed towards individuals at the start of their web developer journey.',
|
||||
}
|
||||
];
|
||||
|
||||
@ -111,7 +116,7 @@ const ListPage = props => {
|
||||
to={`/archive`}
|
||||
hex={props.isDarkMode ? '#434E76' : '#FFFFFF'}
|
||||
>
|
||||
Archived
|
||||
Archived snippets
|
||||
</AniLink></h3>
|
||||
{archivedSnippets
|
||||
.filter(snippet => snippet.archived)
|
||||
|
||||
2
src/docs/templates/TagPage.js
vendored
2
src/docs/templates/TagPage.js
vendored
@ -61,7 +61,7 @@ export const tagPageQuery = graphql`
|
||||
allMarkdownRemark(
|
||||
limit: 1000
|
||||
sort: { fields: [frontmatter___title], order: ASC }
|
||||
filter: { frontmatter: { tags: { regex: $tagRegex } } }
|
||||
filter: { fileAbsolutePath: { regex: "/snippets(?!_archive)/" }, frontmatter: { tags: { regex: $tagRegex } } }
|
||||
) {
|
||||
totalCount
|
||||
edges {
|
||||
|
||||
Reference in New Issue
Block a user