Skip to content

Commit

Permalink
Fix SSR bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
shiro committed Apr 4, 2024
1 parent f63afaa commit 289c4ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/SVG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function getInitialData(src: string, async?: boolean) {
} else {
// if (src.startsWith(config.resourceBaseURL))
// src = src.slice(config.resourceBaseURL.length);
if (src.startsWith(config.base)) src = src.slice(config.base.length);

src = path.join(process.cwd(), "public", src);

Expand Down
1 change: 0 additions & 1 deletion src/ssg/getArticles.ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const getArticlesSSG = () => {

const title = frontmatter.title ?? raw.match(/# [^\n]*/)![0].slice(2);
const description = raw.match(/# [^\n]+\n+([\s\S]+?)(?=\n\n)/)?.[1];
console.log(description);

const url = `/articles/${x.split(".")[0]}`;
const date = x.split("-").slice(0, 3).reverse().join(".");
Expand Down
4 changes: 3 additions & 1 deletion src/style/fontFaces.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { config } from "~/config";

type FontLoader = (font: string, format: string) => string;

const japaneseCodeRange = (show: boolean) =>
show ? `unicode-range: U+3000-30FF , U+FF00-FFEF , U+4E00-9FAF ;` : "";
const nameSuffix = (isFull: boolean) => (isFull ? "" : " JP Only");

const interPath = `/fonts/inter-3.19-roman/Inter`;
const interPath = `${config.base}/fonts/inter-3.19-roman/Inter`;

// language=SCSS
const notoFragments = (isFull: boolean, fontLoader?: FontLoader) => `
Expand Down

0 comments on commit 289c4ff

Please sign in to comment.