mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 01:05:58 +02:00
rename archive to spotlights
This commit is contained in:
+2
-2
@@ -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
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -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 />
|
||||
|
||||
@@ -6,7 +6,7 @@ import { ColumnLayout } from "../ColumnLayout"
|
||||
export const ArchivesLayout: FC = ({ children }) => {
|
||||
return (
|
||||
<ColumnLayout
|
||||
title="Archives"
|
||||
title="Spotlights"
|
||||
sidebar={ArchivesSidebar}
|
||||
content={children}
|
||||
/>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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's Hangout</Link>.
|
||||
</p>
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user