diff --git a/.forgejo/workflows/update.yml b/.forgejo/workflows/update.yml new file mode 100644 index 0000000..f16c119 --- /dev/null +++ b/.forgejo/workflows/update.yml @@ -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 \ No newline at end of file diff --git a/README.md b/README.md index a345c6d..3e6855d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # Site Data Repository -Pending description. +Contains the data for felidae.github.io, and metadata to handle it. + +Pending further description. diff --git a/meta.json b/meta.json index ff0dbed..1b61644 100644 --- a/meta.json +++ b/meta.json @@ -14,5 +14,6 @@ "url": "./articles/styling_test.md", "wordCount": 917 } - ] + ], + "note": "I knew you would look at this file >:3" } \ No newline at end of file diff --git a/scripts/lib/page.ts b/scripts/lib/page.ts index fcb4301..7c96e74 100644 --- a/scripts/lib/page.ts +++ b/scripts/lib/page.ts @@ -11,5 +11,6 @@ export interface PageInfo { } export interface PageRoot { - articles: Array + articles: Array, + note: string } \ No newline at end of file diff --git a/scripts/update.ts b/scripts/update.ts index 31c76ed..8e7f975 100644 --- a/scripts/update.ts +++ b/scripts/update.ts @@ -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 { 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}) \ No newline at end of file