mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-19 05:05:37 +00:00
Remove custom CSS-inlining HEAD
This commit is contained in:
@@ -3,26 +3,6 @@ import Document, { Html, Head, Main, NextScript } from "next/document";
|
|||||||
import { Footer } from "../components/Footer";
|
import { Footer } from "../components/Footer";
|
||||||
import Fader from "../components/Fader";
|
import Fader from "../components/Fader";
|
||||||
import ReactGA from "react-ga";
|
import ReactGA from "react-ga";
|
||||||
import fs from "fs";
|
|
||||||
import path from "path";
|
|
||||||
|
|
||||||
class CustomNextHead extends Head {
|
|
||||||
// TODO: This might not be needed if Next.js implements built-in support
|
|
||||||
// https://github.com/zeit/next-plugins/issues/364
|
|
||||||
getCssLinks({ allFiles }) {
|
|
||||||
return allFiles
|
|
||||||
.filter((file) => file.endsWith(".css"))
|
|
||||||
.map((file) => (
|
|
||||||
<style
|
|
||||||
key={file}
|
|
||||||
nonce={this.props.nonce}
|
|
||||||
dangerouslySetInnerHTML={{
|
|
||||||
__html: fs.readFileSync(path.join(".next", file), "utf-8"),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function trackPageView() {
|
function trackPageView() {
|
||||||
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
|
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
|
||||||
@@ -49,7 +29,7 @@ class MyDocument extends Document {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Html lang="fi">
|
<Html lang="fi">
|
||||||
<CustomNextHead />
|
<Head />
|
||||||
<body>
|
<body>
|
||||||
<div className="site">
|
<div className="site">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
|
|||||||
Reference in New Issue
Block a user