mirror of
https://github.com/dzeiocom/markblog.git
synced 2025-06-19 22:19:19 +00:00
@ -6,6 +6,7 @@ import { Component } from 'react'
|
||||
import ReactMarkdown from 'react-markdown/with-html'
|
||||
|
||||
import Post from '../../components/Post'
|
||||
import Picture from '../../components/Picture'
|
||||
import config from '../../config'
|
||||
|
||||
import Error from '../_error'
|
||||
@ -57,11 +58,12 @@ export default class PostPage extends Component<Props, States> {
|
||||
<Error statusCode={404} />
|
||||
) : (
|
||||
<div>
|
||||
<picture>
|
||||
<source srcSet={require(`../../images${this.props.post.header.image}?webp`)} type="image/webp" />
|
||||
<source srcSet={require(`../../images${this.props.post.header.image}`)} type="image/png" />
|
||||
<img src={require(`../../images${this.props.post.header.image}`)} alt={this.props.post.header.imageAlt} />
|
||||
</picture>
|
||||
<Picture src={this.props.post.header.image} alt={this.props.post.header.imageAlt} parentStyle={{zIndex: 999}} style={{
|
||||
maxWidth: "100%",
|
||||
borderRadius: 10,
|
||||
maxHeight: 300,
|
||||
boxShadow: "0px 0px 4px rgba(0, 0, 0, 0.4)"
|
||||
}}/>
|
||||
<ReactMarkdown escapeHtml={false} source={emoji.emojify(this.props.post.content, null, (code, name) => `<span class="emoji">${code}</span>`)}/>
|
||||
<h2>Détails</h2>
|
||||
<p>Tags:</p>
|
||||
|
@ -7,16 +7,25 @@ import config from '../config'
|
||||
import '../styl/styl.styl'
|
||||
|
||||
class MyApp extends App {
|
||||
|
||||
public componentDidMount() {
|
||||
if (window.location.origin !== config.domain && window.location.hostname !== "localhost") {
|
||||
window.location.replace(`${config.domain}${window.location.pathname}`)
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
const { Component, pageProps } = this.props
|
||||
|
||||
return(
|
||||
<Layout>
|
||||
<Head>
|
||||
{/* General */}
|
||||
<title key="title">{config.og.title}</title>
|
||||
<meta key="description" name="description" content={config.og.description}/>
|
||||
|
||||
{/* Open Graph / Twitter */}
|
||||
<meta key="og:url" property="og:url" content={config.domain + this.props.router.asPath} />
|
||||
<title key="title">{config.og.title}</title>
|
||||
<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" />
|
||||
|
@ -15,14 +15,29 @@ class MyDocument extends Document {
|
||||
|
||||
public render() {
|
||||
return (
|
||||
<Html>
|
||||
<Html lang="en">
|
||||
<Head>
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
{/* General */}
|
||||
<meta charSet="UTF-8" />
|
||||
<link rel="icon" href="/logo/32.png"/>
|
||||
|
||||
{/* Web App related */}
|
||||
<link rel="manifest" href="/manifest.json" />
|
||||
<meta name="mobile-web-app-capable" content="yes" />
|
||||
<meta name="msapplication-starturl" content="/" />
|
||||
<meta name="theme-color" content={config.colors[500]} />
|
||||
|
||||
{/* Open Graph / Twitter */}
|
||||
<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" />
|
||||
|
||||
{/* Apple Icons */}
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-touch-icon" content="/logo/512.png" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
</Head>
|
||||
<body>
|
||||
<Main />
|
||||
|
@ -17,14 +17,14 @@ export default class Error extends Component<Props, {}> {
|
||||
return (
|
||||
<main>
|
||||
<Head>
|
||||
<title>Pouet :D</title>
|
||||
<title key="title">{statusCode ? statusCode : '404'} Error - Markblog</title>
|
||||
</Head>
|
||||
<div className="errorContainer">
|
||||
<div>
|
||||
<h1>{statusCode ? statusCode : '404'}</h1>
|
||||
<h2>{statusCode ? codesTexts[statusCode] : codesTexts[404]}</h2>
|
||||
</div>
|
||||
<style jsx>{`
|
||||
.errorContainer {
|
||||
div {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -32,10 +32,6 @@ export default class Error extends Component<Props, {}> {
|
||||
height: 100%
|
||||
}
|
||||
|
||||
.separator {
|
||||
border: 1px solid black
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 250px;
|
||||
margin: 10px;
|
||||
|
Reference in New Issue
Block a user