mirror of
https://github.com/dzeiocom/markblog.git
synced 2025-07-30 00:19:49 +00:00
@ -1,4 +1,5 @@
|
||||
import Document, { Head, Html, Main, NextScript } from 'next/document'
|
||||
import config from '../config'
|
||||
|
||||
class MyDocument extends Document {
|
||||
public static async getInitialProps(ctx) {
|
||||
@ -6,6 +7,12 @@ class MyDocument extends Document {
|
||||
return { ...initialProps }
|
||||
}
|
||||
|
||||
public componentDidMount() {
|
||||
if (window.location.origin !== config.domain && window.location.hostname !== "localhost") {
|
||||
window.location.replace(`${config.domain}${window.location.pathname}`)
|
||||
}
|
||||
}
|
||||
|
||||
public render() {
|
||||
return (
|
||||
<Html>
|
||||
|
Reference in New Issue
Block a user