meow
Some checks failed
Update meta.json / update (push) Failing after 20s

This commit is contained in:
Mrrp 2025-01-15 19:56:01 -08:00
parent 161b3175b5
commit 01b5f4ab80
5 changed files with 35 additions and 5 deletions

View file

@ -0,0 +1,23 @@
name: Update meta.json
on: push
jobs:
update:
runs-on: docker
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Run Update script
run: apk add deno && deno install && deno task update
- name: Commit changes
run: |
git config --global user.name 'Automatic Updates'
git config --global user.email 'autoupdate@noreply.git.smgames.club'
git commit -am "Automated update"
git push

View file

@ -1,3 +1,5 @@
# Site Data Repository
Pending description.
Contains the data for felidae.github.io, and metadata to handle it.
Pending further description.

View file

@ -14,5 +14,6 @@
"url": "./articles/styling_test.md",
"wordCount": 917
}
]
],
"note": "I knew you would look at this file >:3"
}

View file

@ -11,5 +11,6 @@ export interface PageInfo {
}
export interface PageRoot {
articles: Array<PageInfo>
articles: Array<PageInfo>,
note: string
}

View file

@ -2,7 +2,7 @@ import { AnalyzeMarkdown } from "./lib/markdown_analyzer.ts";
import { PageRoot } from "./lib/page.ts";
// Function to recursively crawl through the directory and analyze markdown files
async function analyzeMarkdownFiles(dir: string, pageInfo: PageRoot): PageRoot {
async function analyzeMarkdownFiles(dir: string, pageInfo: PageRoot): Promise<PageRoot> {
for await (const entry of Deno.readDir(dir)) {
const fullPath = `${dir}/${entry.name}`;
@ -21,7 +21,10 @@ async function analyzeMarkdownFiles(dir: string, pageInfo: PageRoot): PageRoot {
// Start the crawling process from the `./articles` directory
const data = await analyzeMarkdownFiles("./articles", {
articles: []
articles: [],
// Something silly in the event someone decides to look at the file
// TODO: Put weird shit here.
note: `I knew you would look at this file >:3`
});
Deno.writeFileSync("./meta.json", new TextEncoder().encode(JSON.stringify(data, null, 2)), {append: false})