Skip to content

Commit

Permalink
added project routes & fixed front matter parsing
Browse files Browse the repository at this point in the history
icanc0 committed Feb 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4475207 commit b6334bf
Showing 4 changed files with 49 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/lib/server/PageGeneration.ts
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import remarkStringify from 'remark-stringify';
import { matter } from 'vfile-matter';


export type PageOption = "blog" | "project";
export type PageOption = "blogs" | "projects";
export interface PageMeta {
title: string;
date: string;
@@ -54,7 +54,7 @@ export const readPage = async (fileName: string, pageType: PageOption): Promise<
const data = await unified()
.use(remarkParse)
.use(remarkStringify)
.use(remarkFrontmatter(['yaml', 'toml']))
.use(remarkFrontmatter)
.use(() => (tree, vfile) => matter(vfile))
.process(page)
.then((file) => file.data.matter) as PageMeta;
13 changes: 13 additions & 0 deletions src/routes/blogs/[blog]/+page.server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { readPage } from '$lib/server/PageGeneration';
import { processMarkdown } from '$lib/server/PageGeneration';
import type { PageServerLoad } from './$types';

export const load: PageServerLoad = async ({ params }) => {

console.log(params.blog);

let rawJSON = await readPage(params.blog, 'blogs');
rawJSON = await processMarkdown(rawJSON);

return rawJSON
};
9 changes: 5 additions & 4 deletions src/routes/projects/[project]/+page.server.ts
Original file line number Diff line number Diff line change
@@ -3,10 +3,11 @@ import { processMarkdown } from '$lib/server/PageGeneration';
import type { PageServerLoad } from './$types';

export const load: PageServerLoad = async ({ params }) => {
const slug = params.project
console.log(slug);
let rawJSON = await readPage(slug, 'project');

console.log(params.project);

let rawJSON = await readPage(params.project, 'projects');
rawJSON = await processMarkdown(rawJSON);

return { rawJSON };
return rawJSON
};
29 changes: 29 additions & 0 deletions static/projects/project-north-star.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: About us
date: 2019-02-23 19:20:33
description: About Our Team
thumbnail: NorthStarHeadset.jpg
category: About
author: UW Reality Labs
tags:
- About
- VR
- AR
- Design
- Development
lastMod: 2019-02-23 19:20:33
license: CC BY-NC-ND
---

## 👋 Hello From UW Reality Labs

We're the newest design team on the block, and we're here to make your virtual reality dreams come true.
We're a small team of designers, developers, and artists who are passionate about creating the best virtual reality experiences possible.
We're always looking for new ways to push the boundaries of what's possible in VR, and we're excited to share our work with you.

## 📓 Contacts
You can reach us at:

Github: [@uwrealitylabs](https://github.com/uwrealitylabs)

Twitter: [UW Reality Labs](https://twitter.com/uwrealitylabs)

0 comments on commit b6334bf

Please sign in to comment.