Skip to content

Commit

Permalink
Fix blog links
Browse files Browse the repository at this point in the history
  • Loading branch information
shiro committed Mar 27, 2024
1 parent cd58e29 commit e38cdfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import Text from "~/atoms/Text.md";
import fs from "fs";
import path from "path";
import { NoHydration } from "solid-js/web";
import { config } from "~/config";

const base = "./src/routes/articles";
const list = () => {
"use server";
return fs.readdirSync(base).map((x) => {
const raw = fs.readFileSync(path.join(base, x)).toString();
const title = raw.split("\n")[0].slice(2);
const url = `/articles/${x.split(".")[0]}`;
const url = `${config.base}/articles/${x.split(".")[0]}`;
return { title, url };
});
};
Expand Down

0 comments on commit e38cdfe

Please sign in to comment.