From 4d000252ecfa6e893e6c35e827c2b74f236cead4 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 24 Oct 2021 16:35:05 +0100 Subject: [PATCH] rename archive to spotlights --- gatsby-config.js | 4 ++-- gatsby-node.js | 14 +++++++------- src/components/ArchivesSidebar/index.tsx | 4 ++-- src/components/Home/index.tsx | 2 +- src/components/Sidebar/index.tsx | 2 +- .../{archives => spotlights}/what-is-ansible.md | 0 .../{archives => spotlights}/what-is-clojure.md | 0 .../{archives => spotlights}/what-is-deno.md | 0 .../{archives => spotlights}/what-is-discordjs.md | 0 .../{archives => spotlights}/what-is-docker.md | 0 .../{archives => spotlights}/what-is-elixir.md | 0 .../{archives => spotlights}/what-is-emacs.md | 0 .../{archives => spotlights}/what-is-google.md | 0 .../{archives => spotlights}/what-is-graphql.md | 0 .../{archives => spotlights}/what-is-haskell.md | 0 .../{archives => spotlights}/what-is-julia.md | 0 .../{archives => spotlights}/what-is-kotlin.md | 0 .../{archives => spotlights}/what-is-lisp.md | 0 .../{archives => spotlights}/what-is-redis.md | 0 .../{archives => spotlights}/what-is-rust.md | 0 .../{archives => spotlights}/what-is-sqlite.md | 0 .../{archives => spotlights}/what-is-svelte.md | 0 .../{archives => spotlights}/what-is-symfony.md | 0 .../{archives => spotlights}/what-is-vim.md | 0 .../{archives => spotlights}/what-is-wsl.md | 0 .../{archives => spotlights}/what-is-zsh.md | 0 src/layouts/ArchivesLayout/index.tsx | 2 +- src/layouts/index.tsx | 2 +- src/pages/archives/404.tsx | 8 ++++---- src/pages/archives/index.tsx | 10 +++++----- src/templates/archive.tsx | 2 +- 31 files changed, 25 insertions(+), 25 deletions(-) rename src/content/{archives => spotlights}/what-is-ansible.md (100%) rename src/content/{archives => spotlights}/what-is-clojure.md (100%) rename src/content/{archives => spotlights}/what-is-deno.md (100%) rename src/content/{archives => spotlights}/what-is-discordjs.md (100%) rename src/content/{archives => spotlights}/what-is-docker.md (100%) rename src/content/{archives => spotlights}/what-is-elixir.md (100%) rename src/content/{archives => spotlights}/what-is-emacs.md (100%) rename src/content/{archives => spotlights}/what-is-google.md (100%) rename src/content/{archives => spotlights}/what-is-graphql.md (100%) rename src/content/{archives => spotlights}/what-is-haskell.md (100%) rename src/content/{archives => spotlights}/what-is-julia.md (100%) rename src/content/{archives => spotlights}/what-is-kotlin.md (100%) rename src/content/{archives => spotlights}/what-is-lisp.md (100%) rename src/content/{archives => spotlights}/what-is-redis.md (100%) rename src/content/{archives => spotlights}/what-is-rust.md (100%) rename src/content/{archives => spotlights}/what-is-sqlite.md (100%) rename src/content/{archives => spotlights}/what-is-svelte.md (100%) rename src/content/{archives => spotlights}/what-is-symfony.md (100%) rename src/content/{archives => spotlights}/what-is-vim.md (100%) rename src/content/{archives => spotlights}/what-is-wsl.md (100%) rename src/content/{archives => spotlights}/what-is-zsh.md (100%) diff --git a/gatsby-config.js b/gatsby-config.js index 5aced78..3b62f8b 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -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`, diff --git a/gatsby-node.js b/gatsby-node.js index 8039556..b73d3cd 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -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) } diff --git a/src/components/ArchivesSidebar/index.tsx b/src/components/ArchivesSidebar/index.tsx index 388d70f..f6a3424 100644 --- a/src/components/ArchivesSidebar/index.tsx +++ b/src/components/ArchivesSidebar/index.tsx @@ -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> = (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 ( diff --git a/src/components/Home/index.tsx b/src/components/Home/index.tsx index aa47650..3e76353 100644 --- a/src/components/Home/index.tsx +++ b/src/components/Home/index.tsx @@ -78,7 +78,7 @@ export const Home: FC = () => { faq bots resources - tech spotlights + tech spotlights join us diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 9a9ca88..c03722b 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -44,7 +44,7 @@ export const Sidebar: FC> = (props) => { faq bots resources - tech spotlights + tech spotlights diff --git a/src/content/archives/what-is-ansible.md b/src/content/spotlights/what-is-ansible.md similarity index 100% rename from src/content/archives/what-is-ansible.md rename to src/content/spotlights/what-is-ansible.md diff --git a/src/content/archives/what-is-clojure.md b/src/content/spotlights/what-is-clojure.md similarity index 100% rename from src/content/archives/what-is-clojure.md rename to src/content/spotlights/what-is-clojure.md diff --git a/src/content/archives/what-is-deno.md b/src/content/spotlights/what-is-deno.md similarity index 100% rename from src/content/archives/what-is-deno.md rename to src/content/spotlights/what-is-deno.md diff --git a/src/content/archives/what-is-discordjs.md b/src/content/spotlights/what-is-discordjs.md similarity index 100% rename from src/content/archives/what-is-discordjs.md rename to src/content/spotlights/what-is-discordjs.md diff --git a/src/content/archives/what-is-docker.md b/src/content/spotlights/what-is-docker.md similarity index 100% rename from src/content/archives/what-is-docker.md rename to src/content/spotlights/what-is-docker.md diff --git a/src/content/archives/what-is-elixir.md b/src/content/spotlights/what-is-elixir.md similarity index 100% rename from src/content/archives/what-is-elixir.md rename to src/content/spotlights/what-is-elixir.md diff --git a/src/content/archives/what-is-emacs.md b/src/content/spotlights/what-is-emacs.md similarity index 100% rename from src/content/archives/what-is-emacs.md rename to src/content/spotlights/what-is-emacs.md diff --git a/src/content/archives/what-is-google.md b/src/content/spotlights/what-is-google.md similarity index 100% rename from src/content/archives/what-is-google.md rename to src/content/spotlights/what-is-google.md diff --git a/src/content/archives/what-is-graphql.md b/src/content/spotlights/what-is-graphql.md similarity index 100% rename from src/content/archives/what-is-graphql.md rename to src/content/spotlights/what-is-graphql.md diff --git a/src/content/archives/what-is-haskell.md b/src/content/spotlights/what-is-haskell.md similarity index 100% rename from src/content/archives/what-is-haskell.md rename to src/content/spotlights/what-is-haskell.md diff --git a/src/content/archives/what-is-julia.md b/src/content/spotlights/what-is-julia.md similarity index 100% rename from src/content/archives/what-is-julia.md rename to src/content/spotlights/what-is-julia.md diff --git a/src/content/archives/what-is-kotlin.md b/src/content/spotlights/what-is-kotlin.md similarity index 100% rename from src/content/archives/what-is-kotlin.md rename to src/content/spotlights/what-is-kotlin.md diff --git a/src/content/archives/what-is-lisp.md b/src/content/spotlights/what-is-lisp.md similarity index 100% rename from src/content/archives/what-is-lisp.md rename to src/content/spotlights/what-is-lisp.md diff --git a/src/content/archives/what-is-redis.md b/src/content/spotlights/what-is-redis.md similarity index 100% rename from src/content/archives/what-is-redis.md rename to src/content/spotlights/what-is-redis.md diff --git a/src/content/archives/what-is-rust.md b/src/content/spotlights/what-is-rust.md similarity index 100% rename from src/content/archives/what-is-rust.md rename to src/content/spotlights/what-is-rust.md diff --git a/src/content/archives/what-is-sqlite.md b/src/content/spotlights/what-is-sqlite.md similarity index 100% rename from src/content/archives/what-is-sqlite.md rename to src/content/spotlights/what-is-sqlite.md diff --git a/src/content/archives/what-is-svelte.md b/src/content/spotlights/what-is-svelte.md similarity index 100% rename from src/content/archives/what-is-svelte.md rename to src/content/spotlights/what-is-svelte.md diff --git a/src/content/archives/what-is-symfony.md b/src/content/spotlights/what-is-symfony.md similarity index 100% rename from src/content/archives/what-is-symfony.md rename to src/content/spotlights/what-is-symfony.md diff --git a/src/content/archives/what-is-vim.md b/src/content/spotlights/what-is-vim.md similarity index 100% rename from src/content/archives/what-is-vim.md rename to src/content/spotlights/what-is-vim.md diff --git a/src/content/archives/what-is-wsl.md b/src/content/spotlights/what-is-wsl.md similarity index 100% rename from src/content/archives/what-is-wsl.md rename to src/content/spotlights/what-is-wsl.md diff --git a/src/content/archives/what-is-zsh.md b/src/content/spotlights/what-is-zsh.md similarity index 100% rename from src/content/archives/what-is-zsh.md rename to src/content/spotlights/what-is-zsh.md diff --git a/src/layouts/ArchivesLayout/index.tsx b/src/layouts/ArchivesLayout/index.tsx index 8d047b6..52e2fd8 100644 --- a/src/layouts/ArchivesLayout/index.tsx +++ b/src/layouts/ArchivesLayout/index.tsx @@ -6,7 +6,7 @@ import { ColumnLayout } from "../ColumnLayout" export const ArchivesLayout: FC = ({ children }) => { return ( diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index aa0bd2d..9b1644f 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -21,7 +21,7 @@ const BaseLayout: FC = (props) => { switch (props.pageContext.layout) { case "resources": return ResourcesLayout - case "archives": + case "spotlights": return ArchivesLayout case "regular": return PageLayout diff --git a/src/pages/archives/404.tsx b/src/pages/archives/404.tsx index 6e86591..a036748 100644 --- a/src/pages/archives/404.tsx +++ b/src/pages/archives/404.tsx @@ -14,12 +14,12 @@ const FourZeroFourPage: React.FC<{ data: { allFile: FileConnection } }> = ({ data, }: ComponentQuery<{ allFile: FileConnection }>) => ( - - + + {({ location }) => ( @@ -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 diff --git a/src/pages/archives/index.tsx b/src/pages/archives/index.tsx index 310fb22..31d4990 100644 --- a/src/pages/archives/index.tsx +++ b/src/pages/archives/index.tsx @@ -8,15 +8,15 @@ import { SEO } from "../../components/SEO" function ArchivesPage() { return ( - - + + - 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{" "} The Programmer's Hangout.

} diff --git a/src/templates/archive.tsx b/src/templates/archive.tsx index 6c40ddf..e8a9cb9 100644 --- a/src/templates/archive.tsx +++ b/src/templates/archive.tsx @@ -18,7 +18,7 @@ const Archive: FC = ({ data }) => {