Skip to content

Commit

Permalink
switch build script to typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
SheepTester committed Jun 9, 2024
1 parent 86f1197 commit c74764d
Show file tree
Hide file tree
Showing 5 changed files with 459 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Repository for [group 1's website](https://cse125.ucsd.edu/2024/cse125g1/) for C
Render Markdown as HTML for content pages:

```shell
$ node content/build.js
$ npx tsx content/build.ts
```

### Connecting to cse125.ucsd.edu
Expand Down
17 changes: 10 additions & 7 deletions content/build.js → content/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ marked.use(gfmHeadingId());
marked.use(markedSmartypants());
marked.use(markedFootnote({ refMarkers: true }));

/**
* @param {string} source
* @param {string} dest
*/
type Page = {
title: string;
description: string;
base: string;
image: string;
};

async function build(
source,
dest,
source: string,
dest: string,
{
title = "Page",
description = "something about the page",
base = ".",
image = "../images/bee.png",
}
}: Partial<Page> = {}
) {
const template = await fs.readFile("./content/template.html", "utf-8");
const markdown = await fs.readFile(source, "utf-8");
Expand Down
Loading

0 comments on commit c74764d

Please sign in to comment.