mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-05 16:06:15 +02:00
feat(archives): bootstrap what-is-archives from Github
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { graphql } from "gatsby"
|
||||
import React, { FC, Fragment } from "react"
|
||||
import { ColumnHeader } from "../components/ColumnHeader"
|
||||
import { Markdown } from "../components/Markdown"
|
||||
import { SEO } from "../components/SEO"
|
||||
import { humanize } from "../utils"
|
||||
|
||||
// @todo maybe find alternative type for data
|
||||
const Archive: FC<any> = ({ data }) => {
|
||||
const { relativePath, ctime } = data.file
|
||||
const { html, excerpt, timeToRead } = data.file.post
|
||||
|
||||
const title = humanize(relativePath)
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<SEO title={title} description={excerpt} />
|
||||
<ColumnHeader
|
||||
relativePath={relativePath}
|
||||
basePath="/archives"
|
||||
title={title}
|
||||
createdAt={ctime}
|
||||
timeToRead={timeToRead}
|
||||
/>
|
||||
<Markdown content={html} />
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default Archive
|
||||
|
||||
export const query = graphql`
|
||||
query Archive($file: String!) {
|
||||
file(relativePath: { eq: $file }) {
|
||||
relativePath
|
||||
ctime
|
||||
post: childMarkdownRemark {
|
||||
html
|
||||
excerpt
|
||||
timeToRead
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
@@ -1,7 +1,7 @@
|
||||
import { graphql } from "gatsby"
|
||||
import React, { FC, Fragment } from "react"
|
||||
import { ColumnHeader } from "../components/ColumnHeader"
|
||||
import { Markdown } from "../components/Markdown"
|
||||
import { ResourceHeader } from "../components/ResourceHeader"
|
||||
import { SEO } from "../components/SEO"
|
||||
|
||||
import "katex/dist/katex.min.css"
|
||||
@@ -14,8 +14,9 @@ const LanguagePost: FC<any> = ({ data }) => {
|
||||
return (
|
||||
<Fragment>
|
||||
<SEO title={frontmatter.title} description={excerpt} />
|
||||
<ResourceHeader
|
||||
<ColumnHeader
|
||||
relativePath={relativePath}
|
||||
basePath="/resources"
|
||||
title={frontmatter.title}
|
||||
authors={fields.authors}
|
||||
createdAt={frontmatter.created_at}
|
||||
|
||||
Reference in New Issue
Block a user