mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
59 lines
1.4 KiB
TypeScript
59 lines
1.4 KiB
TypeScript
import { graphql } from "gatsby"
|
|
import React, { FC, Fragment } from "react"
|
|
import { Header } from "../components/Header"
|
|
import { Markdown } from "../components/Markdown"
|
|
import { SEO } from "../components/SEO"
|
|
|
|
import "katex/dist/katex.min.css"
|
|
|
|
// @todo maybe find alternative type for data
|
|
const LanguagePost: FC<any> = ({ data }) => {
|
|
const { relativePath } = data.file
|
|
const { html, excerpt, fields, frontmatter, timeToRead } = data.file.post
|
|
|
|
return (
|
|
<Fragment>
|
|
<SEO title={frontmatter.title} description={excerpt} />
|
|
<Header
|
|
relativePath={relativePath}
|
|
basePath="/resources"
|
|
title={frontmatter.title}
|
|
authors={fields.authors}
|
|
createdAt={frontmatter.created_at}
|
|
timeToRead={timeToRead}
|
|
recommendedReading={frontmatter.recommended_reading}
|
|
externalResources={frontmatter.external_resources}
|
|
/>
|
|
<Markdown content={html} />
|
|
</Fragment>
|
|
)
|
|
}
|
|
|
|
export default LanguagePost
|
|
|
|
export const query = graphql`
|
|
query LanguagePost($file: String!) {
|
|
file(relativePath: { eq: $file }) {
|
|
relativePath
|
|
post: childMarkdownRemark {
|
|
html
|
|
excerpt
|
|
fields {
|
|
authors {
|
|
name
|
|
hash
|
|
avatar
|
|
}
|
|
}
|
|
frontmatter {
|
|
created_at
|
|
title
|
|
recommended_reading
|
|
external_resources
|
|
}
|
|
timeToRead
|
|
}
|
|
}
|
|
}
|
|
`
|