rename archive to spotlights

This commit is contained in:
Mark
2021-10-24 16:35:05 +01:00
parent 3aa18ba885
commit 4d000252ec
31 changed files with 25 additions and 25 deletions
+2 -2
View File
@@ -68,8 +68,8 @@ module.exports = {
{
resolve: `gatsby-source-filesystem`,
options: {
name: `what-is-archive`,
path: `${__dirname}/src/content/archives`,
name: `spotlights`,
path: `${__dirname}/src/content/spotlights`,
},
},
`gatsby-transformer-sharp`,
+7 -7
View File
@@ -7,7 +7,7 @@ const fs = require("fs")
const requiredArticleFrontmatter = ["authors", "date"]
const LAYOUT_RESOURCES = "resources"
const LAYOUT_ARCHIVES = "archives"
const LAYOUT_ARCHIVES = "spotlights"
const LAYOUT_REGULAR = "regular"
const LAYOUT_HOME = "home"
@@ -20,7 +20,7 @@ function resolveLayout(path) {
return LAYOUT_RESOURCES
}
if (path.match(/archives/)) {
if (path.match(/spotlights/)) {
return LAYOUT_ARCHIVES
}
@@ -133,7 +133,7 @@ const createArchives = async ({ createPage, graphql }) => {
const result = await graphql(`
query FetchArchives {
allFile(filter: { sourceInstanceName: { eq: "what-is-archive" } }) {
allFile(filter: { sourceInstanceName: { eq: "spotlights" } }) {
edges {
node {
relativePath
@@ -150,7 +150,7 @@ const createArchives = async ({ createPage, graphql }) => {
return result.data.allFile.edges.forEach(({ node }) => {
createPage({
path: path.posix.join("archives", node.relativePath),
path: path.posix.join("spotlights", node.relativePath),
component: archive,
context: {
file: node.relativePath,
@@ -163,7 +163,7 @@ const createArchives = async ({ createPage, graphql }) => {
exports.onCreateNode = async ({ node, getNode, actions }) => {
const { createPage, createNodeField } = actions
// TODO: find a better way to avoid handling non-resources
// or better, attach authors to what-is archives
// or better, attach authors to spotlights
if (node.internal.type === "Mdx" && node.frontmatter.authors) {
const { frontmatter } = node
const isDoc = Boolean(!frontmatter.path)
@@ -197,9 +197,9 @@ exports.onCreatePage = async ({ page, actions }) => {
const oldPage = { ...page }
page.matchPath = `/resources/*`
deletePage(oldPage)
} else if (page.path.match(/^\/archives\/404/)) {
} else if (page.path.match(/^\/spotlights\/404/)) {
const oldPage = { ...page }
page.matchPath = `/archives/*`
page.matchPath = `/spotlights/*`
deletePage(oldPage)
}
+2 -2
View File
@@ -12,7 +12,7 @@ import * as SC from "./styles"
const ALL_ARCHIVES = graphql`
query {
archives: allFile(
filter: { sourceInstanceName: { eq: "what-is-archive" } }
filter: { sourceInstanceName: { eq: "spotlights" } }
) {
edges {
node {
@@ -44,7 +44,7 @@ function Tree({ item }: { item: IFileOrFolder }) {
export const ArchivesSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
const { archives } = useStaticQuery(ALL_ARCHIVES)
const tree = useBuildTree(archives, "/archives")
const tree = useBuildTree(archives, "/spotlights")
const sortedTree = sort((a, b) => a.title.localeCompare(b.title), tree)
return (
+1 -1
View File
@@ -78,7 +78,7 @@ export const Home: FC = () => {
<MenuItem to="/faq">faq</MenuItem>
<MenuItem to="/bots">bots</MenuItem>
<MenuItem to="/resources">resources</MenuItem>
<MenuItem to="/archives">tech spotlights</MenuItem>
<MenuItem to="/spotlights">tech spotlights</MenuItem>
</SC.Menu>
<DiscordButton>join us</DiscordButton>
<HomePartner />
+1 -1
View File
@@ -44,7 +44,7 @@ export const Sidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
<MenuItem to="/faq">faq</MenuItem>
<MenuItem to="/bots">bots</MenuItem>
<MenuItem to="/resources">resources</MenuItem>
<MenuItem to="/archives">tech spotlights</MenuItem>
<MenuItem to="/spotlights">tech spotlights</MenuItem>
</SC.Menu>
<ThemeToggler />
+1 -1
View File
@@ -6,7 +6,7 @@ import { ColumnLayout } from "../ColumnLayout"
export const ArchivesLayout: FC = ({ children }) => {
return (
<ColumnLayout
title="Archives"
title="Spotlights"
sidebar={ArchivesSidebar}
content={children}
/>
+1 -1
View File
@@ -21,7 +21,7 @@ const BaseLayout: FC<IBaseLayout> = (props) => {
switch (props.pageContext.layout) {
case "resources":
return ResourcesLayout
case "archives":
case "spotlights":
return ArchivesLayout
case "regular":
return PageLayout
+4 -4
View File
@@ -14,12 +14,12 @@ const FourZeroFourPage: React.FC<{ data: { allFile: FileConnection } }> = ({
data,
}: ComponentQuery<{ allFile: FileConnection }>) => (
<Fragment>
<SEO title="404: Archive Not found" />
<FourZeroFour title="ARCHIVE NOT FOUND">
<SEO title="404: Spotlight Not found" />
<FourZeroFour title="SPOTLIGHT NOT FOUND">
<Location>
{({ location }) => (
<FourZeroFourHint
basepath="archives/"
basepath="spotlights/"
location={location}
data={data}
/>
@@ -33,7 +33,7 @@ export default FourZeroFourPage
export const query = graphql`
query {
allFile(filter: { sourceInstanceName: { eq: "what-is-archive" } }) {
allFile(filter: { sourceInstanceName: { eq: "spotlights" } }) {
edges {
node {
relativePath
+5 -5
View File
@@ -8,15 +8,15 @@ import { SEO } from "../../components/SEO"
function ArchivesPage() {
return (
<Fragment>
<SEO title="Tech Spotlights Archives" />
<HeaderBarebone title="Welcome to the TPH tech spotlights archives." />
<SEO title="Tech Spotlights" />
<HeaderBarebone title="Welcome to the TPH tech spotlights." />
<PageContent
content={
<p>
This regroups the archives of our occasional, temporary channels
that cover a piece of technology that might be unknown to part of
our users. You can find those on{" "}
This is a collection of our technology spotlights that have been
highlighted in our discord server. Spotlights run for one month
within the server before appearing here. You can find those on{" "}
<Link to="/about">The Programmer&apos;s Hangout</Link>.
</p>
}
+1 -1
View File
@@ -18,7 +18,7 @@ const Archive: FC<any> = ({ data }) => {
<SEO title={title} description={excerpt} />
<Header
relativePath={relativePath}
basePath="/archives"
basePath="/spotlights"
title={title}
authors={fields.authors}
createdAt={frontmatter.created_at}