fix lightning font loading

This commit is contained in:
keyan 2022-02-23 21:02:23 -06:00
parent 8e857fd8a7
commit 3e977c020d
3 changed files with 12 additions and 7 deletions

View File

@ -1,11 +1,21 @@
import Document, { Html, Head, Main, NextScript } from 'next/document' import Document, { Html, Head, Main, NextScript } from 'next/document'
const publicPrefix = process.env.NODE_ENV === 'development' ? '' : 'https://a.stacker.news'
class MyDocument extends Document { class MyDocument extends Document {
render () { render () {
return ( return (
<Html> <Html>
<Head> <Head>
<link rel='preload' href='/Lightningvolt-xoqm.ttf' as='font' type='font/ttf' crossOrigin='' /> <link rel='preload' href={`${publicPrefix}/Lightningvolt-xoqm.ttf`} as='font' type='font/ttf' crossOrigin='' />
<style
dangerouslySetInnerHTML={{
__html:
` @font-face {
font-family: lightning;
src: url(${publicPrefix}/Lightningvolt-xoqm.ttf);
}`
}}
/>
</Head> </Head>
<body> <body>
<script src='/darkmode.js' /> <script src='/darkmode.js' />

View File

@ -21,7 +21,7 @@ export default async function handler (req, res) {
const searchQ = req.query.q ? `?q=${req.query.q}` : '' const searchQ = req.query.q ? `?q=${req.query.q}` : ''
const s3PathPUT = s3PathPrefix + (joinedPath === '.' ? '_' : joinedPath) + searchQ const s3PathPUT = s3PathPrefix + (joinedPath === '.' ? '_' : joinedPath) + searchQ
const s3PathGET = s3PathPrefix + (joinedPath === '.' ? '_' : joinedPath) + encodeS3URI(searchQ) const s3PathGET = s3PathPrefix + (joinedPath === '.' ? '_' : joinedPath) + encodeS3URI(searchQ)
const url = process.env.SELF_URL + '/' + joinedPath + searchQ const url = process.env.PUBLIC_URL + '/' + joinedPath + searchQ
const aws = new AWS.S3({apiVersion: '2006-03-01'}) const aws = new AWS.S3({apiVersion: '2006-03-01'})
// check to see if we have a recent version of the object // check to see if we have a recent version of the object

View File

@ -53,11 +53,6 @@ $tooltip-bg: #5c8001;
@import "~bootstrap/scss/bootstrap"; @import "~bootstrap/scss/bootstrap";
@font-face {
font-family: lightning;
src: url(/Lightningvolt-xoqm.ttf);
}
@media screen and (min-width: 767px) { @media screen and (min-width: 767px) {
.table-sm th, .table-sm td { .table-sm th, .table-sm td {
padding: .3rem .75rem; padding: .3rem .75rem;