Fix some build issues

This commit is contained in:
Kaan Barmore-Genç 2024-05-08 23:25:31 -05:00
parent e4cce01240
commit f5a1c6de5a
Signed by: kaan
GPG key ID: B2E280771CD62FCF
5 changed files with 19 additions and 83 deletions

View file

@ -2,14 +2,13 @@
import Avif from './profile.avif';
import Jpeg from './profile.avif?format=jpeg';
import WebP from './profile.avif?format=webp';
import cv from '../cv.pdf';
import {
EnvelopeSimple,
FilePlus,
GithubLogo,
LinkedinLogo,
MastodonLogo,
} from 'phosphor-svelte';
import EnvelopeSimple from 'phosphor-svelte/lib/EnvelopeSimple';
import FilePlus from 'phosphor-svelte/lib/FilePlus';
import GithubLogo from 'phosphor-svelte/lib/GithubLogo';
import LinkedinLogo from 'phosphor-svelte/lib/LinkedinLogo';
import MastodonLogo from 'phosphor-svelte/lib/MastodonLogo';
</script>
<div data-pagefind-body>
@ -79,7 +78,7 @@
</a>
</li>
<li>
<a target="_blank" href="/static/cv.pdf">
<a target="_blank" href={cv}>
<FilePlus />
<span>CV</span>
</a>

View file

@ -1,17 +1,21 @@
import _ from 'lodash';
import { readingTime } from 'reading-time-estimator';
import path from 'path';
import { fileURLToPath } from 'url';
import { readFile } from 'fs/promises';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const PAGE_SIZE = 10;
export async function load({ params }) {
const allPostFiles = import.meta.glob<SvelteAllProps>('/src/routes/posts/*.md');
const iterablePostFiles = Object.entries(allPostFiles);
const markdownFilesPath = path.resolve(
process.env.npm_package_json ? path.dirname(process.env.npm_package_json) : '.',
'src',
'routes',
'posts',
);
const posts = await Promise.all(
iterablePostFiles.map(async ([filePath, resolver]) => {
const { metadata } = await resolver();
@ -19,7 +23,7 @@ export async function load({ params }) {
const slug = /[/]([^/]*)[.]md$/.exec(filePath)?.[1];
if (!slug) throw new Error(`Could not parse slug from path: ${filePath}`);
const contents = await readFile(path.join(__dirname, '..', `${slug}.md`), 'utf8');
const contents = await readFile(path.join(markdownFilesPath, `${slug}.md`), 'utf8');
return {
meta: metadata,

View file

@ -1,6 +1,9 @@
<script lang="ts">
import Button from '$lib/Button.svelte';
import { ArrowLeft, ArrowLineLeft, ArrowLineRight, ArrowRight } from 'phosphor-svelte';
import ArrowLeft from 'phosphor-svelte/lib/ArrowLeft';
import ArrowLineLeft from 'phosphor-svelte/lib/ArrowLineLeft';
import ArrowLineRight from 'phosphor-svelte/lib/ArrowLineRight';
import ArrowRight from 'phosphor-svelte/lib/ArrowRight';
import { format } from 'date-fns';
import type { Post } from './+page.server';

View file

@ -1,70 +0,0 @@
/* pygments.org "emacs" style */
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #008800; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #AA22FF; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #008800; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #008800; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #008800 } /* Comment.Preproc */
.highlight .cpf { color: #008800; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #008800; font-style: italic } /* Comment.Single */
.highlight .cs { color: #008800; font-weight: bold } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #888888 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #AA22FF; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #AA22FF } /* Keyword.Pseudo */
.highlight .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #00BB00; font-weight: bold } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BB4444 } /* Literal.String */
.highlight .na { color: #BB4444 } /* Name.Attribute */
.highlight .nb { color: #AA22FF } /* Name.Builtin */
.highlight .nc { color: #0000FF } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #999999; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #00A000 } /* Name.Function */
.highlight .nl { color: #A0A000 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #B8860B } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #666666 } /* Literal.Number.Bin */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sa { color: #BB4444 } /* Literal.String.Affix */
.highlight .sb { color: #BB4444 } /* Literal.String.Backtick */
.highlight .sc { color: #BB4444 } /* Literal.String.Char */
.highlight .dl { color: #BB4444 } /* Literal.String.Delimiter */
.highlight .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BB4444 } /* Literal.String.Double */
.highlight .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BB4444 } /* Literal.String.Heredoc */
.highlight .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #BB6688 } /* Literal.String.Regex */
.highlight .s1 { color: #BB4444 } /* Literal.String.Single */
.highlight .ss { color: #B8860B } /* Literal.String.Symbol */
.highlight .bp { color: #AA22FF } /* Name.Builtin.Pseudo */
.highlight .fm { color: #00A000 } /* Name.Function.Magic */
.highlight .vc { color: #B8860B } /* Name.Variable.Class */
.highlight .vg { color: #B8860B } /* Name.Variable.Global */
.highlight .vi { color: #B8860B } /* Name.Variable.Instance */
.highlight .vm { color: #B8860B } /* Name.Variable.Magic */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */