Skip to content
Open
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
9 changes: 9 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
const { createFilePath } = require(`gatsby-source-filesystem`)
const _ = require("lodash")
const { useAbout } = require("./blog-config")

exports.onCreatePage = ({ page, actions }) => {
const { deletePage } = actions

if (!useAbout && page.path === "/about/") {
deletePage(page)
}
}

exports.createPages = async ({ graphql, actions, reporter }) => {
const { createPage } = actions
Expand Down
9 changes: 5 additions & 4 deletions src/components/Article/Header/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react"
import styled from "styled-components"

import { author } from "../../../../blog-config"
import { author, useAbout } from "../../../../blog-config"

import Divider from "components/Divider"
import TagList from "components/TagList"
Expand All @@ -28,9 +28,10 @@ const Information = styled.div`
`

const Author = styled.span`
font-weight: 700;
color: ${props => props.theme.colors.text};

& > a {
font-weight: 700;
color: ${props => props.theme.colors.text};
text-decoration: none;
}

Expand All @@ -50,7 +51,7 @@ const Header = ({ title, date, tags, minToRead }) => {
<ArticleTitle> {title} </ArticleTitle>
<Information>
<Author>
<Link to="/about">@{author}</Link>
{useAbout ? <Link to="/about">@{author}</Link> : `@${author}`}
</Author>
<Date>· {date} </Date>
<Date>· {minToRead} min read </Date>
Expand Down
6 changes: 1 addition & 5 deletions src/pages/about.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import Article from "components/Article"
import Comment from "components/Article/Footer/Comment"
import Tab from "components/Tab"

import NotFoundPage from "pages/404"

import styled from "styled-components"

import { title, description, siteUrl, useAbout } from "../../blog-config"
import { title, description, siteUrl } from "../../blog-config"
import Divider from "components/Divider"

const ArticleTitle = styled.h1`
Expand All @@ -34,8 +32,6 @@ const BlogIndex = ({ data }) => {
const aboutPost = data.markdownRemark
const postsCount = data.allMarkdownRemark.totalCount

if (!useAbout) return <NotFoundPage />

return (
<Layout>
<SEO title={title} description={description} url={siteUrl} />
Expand Down