mirror of
https://github.com/dzeiocom/markblog.git
synced 2025-06-19 22:19:19 +00:00
@ -5,6 +5,8 @@ import Post from "../../components/Post"
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import Error from "../_error"
|
||||
import Link from "next/link"
|
||||
import Head from "next/head"
|
||||
import config from "../../config"
|
||||
|
||||
interface Props {
|
||||
post: Post
|
||||
@ -18,6 +20,16 @@ export default class PostPage extends Component<Props, States> {
|
||||
public render() {
|
||||
return (
|
||||
<main>
|
||||
<Head>
|
||||
<title key="title">{`${this.props.post.title} - ${config.og.title}`}</title>
|
||||
<meta key="description" name="og:description" content={this.props.post.header.short || this.props.post.header.title}/>
|
||||
|
||||
<meta key="og:title" property="og:title" content={`${this.props.post.header.title} - ${config.og.title}`} />
|
||||
<meta key="og:description" property="og:description" content={this.props.post.header.short || this.props.post.header.title}/>
|
||||
{this.props.post.header.image ? (
|
||||
<meta key="og:image" property="og:image" content={`${config.domain}${this.props.post.header.image}`}/>
|
||||
) : undefined}
|
||||
</Head>
|
||||
{this.props.post === undefined ? (
|
||||
<Error statusCode={404} />
|
||||
) : (
|
||||
@ -48,7 +60,7 @@ export default class PostPage extends Component<Props, States> {
|
||||
main h2 {
|
||||
font-size: 40px;
|
||||
text-align: center;
|
||||
text-shadow: 4px 4px 0px rgba(66, 133, 244, 0.5);
|
||||
text-shadow: 4px 4px 0px rgba(${config.colors.rgb500}, 0.5);
|
||||
}
|
||||
main h2::selection {
|
||||
text-shadow: 4px 4px 0px rgba(255, 255, 255, 0.5);
|
||||
|
@ -2,12 +2,23 @@ import React from 'react'
|
||||
import App from 'next/app'
|
||||
import '../styl/styl.styl'
|
||||
import Layout from '../components/Layout'
|
||||
import Head from 'next/head'
|
||||
import config from '../config'
|
||||
|
||||
class MyApp extends App {
|
||||
render() {
|
||||
const { Component, pageProps } = this.props
|
||||
|
||||
return(
|
||||
<Layout>
|
||||
<Head>
|
||||
<meta key="description" name="description" content={config.og.description}/>
|
||||
|
||||
<meta key="og:url" property="og:url" content={config.domain + this.props.router.asPath} />
|
||||
<meta key="og:title" property="og:title" content={config.og.title}/>
|
||||
<meta key="og:description" property="og:description" content={config.og.description}/>
|
||||
<meta key="og:type" property="og:type" content="website" />
|
||||
</Head>
|
||||
<Component {...pageProps} />
|
||||
</Layout>
|
||||
)
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
// ./pages/_document.js
|
||||
import Document, { Html, Head, Main, NextScript } from 'next/document'
|
||||
import config from '../config'
|
||||
|
||||
class MyDocument extends Document {
|
||||
static async getInitialProps(ctx) {
|
||||
@ -15,6 +16,11 @@ class MyDocument extends Document {
|
||||
<Html>
|
||||
<Head>
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
|
||||
<meta property="twitter:card" content="summary" />
|
||||
<meta property="twitter:site" content="aviortheking" />
|
||||
<meta property="twitter:creator" content="aviortheking" />
|
||||
<meta property="twitter:site:id" content="3240791182" />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
|
@ -90,9 +90,11 @@ export default class Page extends Component<Props, States> {
|
||||
justify-content: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
div {
|
||||
@ -109,6 +111,7 @@ export default class Page extends Component<Props, States> {
|
||||
}
|
||||
main {
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
`}</style>
|
||||
|
Reference in New Issue
Block a user