Add beginner page

This commit is contained in:
Angelos Chalaris
2019-08-19 10:28:45 +03:00
parent f9656c18ac
commit 25aeb11e43
4 changed files with 19 additions and 5 deletions

View File

@ -87,6 +87,15 @@ exports.createPages = ({ graphql, actions }) => {
}); });
}); });
createPage({
path: `/beginner`,
component: tagPage,
context: {
tag: `beginner snippets`,
tagRegex: `/beginner/`,
},
});
return null; return null;
}); });
}; };

View File

@ -21,9 +21,9 @@ const ArchivePage = props => {
return ( return (
<> <>
<Meta title='Archived' /> <Meta title='Archived snippets' />
<Shell> <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='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> <p className='light-sub'>Click on a snippet's name to view its code.</p>
{posts && {posts &&

View File

@ -64,7 +64,12 @@ const ListPage = props => {
{ {
url: 'about', url: 'about',
title: '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`} to={`/archive`}
hex={props.isDarkMode ? '#434E76' : '#FFFFFF'} hex={props.isDarkMode ? '#434E76' : '#FFFFFF'}
> >
Archived Archived snippets
</AniLink></h3> </AniLink></h3>
{archivedSnippets {archivedSnippets
.filter(snippet => snippet.archived) .filter(snippet => snippet.archived)

View File

@ -61,7 +61,7 @@ export const tagPageQuery = graphql`
allMarkdownRemark( allMarkdownRemark(
limit: 1000 limit: 1000
sort: { fields: [frontmatter___title], order: ASC } sort: { fields: [frontmatter___title], order: ASC }
filter: { frontmatter: { tags: { regex: $tagRegex } } } filter: { fileAbsolutePath: { regex: "/snippets(?!_archive)/" }, frontmatter: { tags: { regex: $tagRegex } } }
) { ) {
totalCount totalCount
edges { edges {