rebuild with gatsby

This commit is contained in:
2022-10-24 02:55:16 +08:00
parent 7defcb61a2
commit f26a62925a
46 changed files with 26630 additions and 0 deletions

43
src/templates/law.js Normal file
View File

@@ -0,0 +1,43 @@
import * as React from "react"
import Header from "../components/Header"
import {StaticImage} from "gatsby-plugin-image"
import * as style from "../styles/Post.module.css"
import * as homeStyle from "../styles/Home.module.css"
const LawPage = (props) => {
const {pageContext} = props
const {element} = pageContext
return (
<>
<Header Background={
<StaticImage placeholder="blurred"
style={{
gridArea: "1/1",
maxHeight: "50vh",
}}
layout="fullWidth"
alt="header background"
src="../images/mainbg.webp"
/>
} />
<main className={homeStyle.container}>
<section className={style.post}>
<h2>{element.title}<br />{element.titleEn}</h2>
<small>发布于 {element.date}</small>
<hr />
{element.videos.map((video) => {
const poster = video.substr(0, video.indexOf('.mp4')) + '_poster.jpg';
return <p style={{textAlign: "center"}}>
<video src={video} poster={poster || ""} controls preload="none" width="70%" />
</p>
})
}
</section>
</main>
</>
)
}
export default LawPage