This commit is contained in:
parent
161b3175b5
commit
01b5f4ab80
5 changed files with 35 additions and 5 deletions
23
.forgejo/workflows/update.yml
Normal file
23
.forgejo/workflows/update.yml
Normal 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
|
|
@ -1,3 +1,5 @@
|
||||||
# Site Data Repository
|
# Site Data Repository
|
||||||
|
|
||||||
Pending description.
|
Contains the data for felidae.github.io, and metadata to handle it.
|
||||||
|
|
||||||
|
Pending further description.
|
||||||
|
|
|
@ -14,5 +14,6 @@
|
||||||
"url": "./articles/styling_test.md",
|
"url": "./articles/styling_test.md",
|
||||||
"wordCount": 917
|
"wordCount": 917
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"note": "I knew you would look at this file >:3"
|
||||||
}
|
}
|
|
@ -11,5 +11,6 @@ export interface PageInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PageRoot {
|
export interface PageRoot {
|
||||||
articles: Array<PageInfo>
|
articles: Array<PageInfo>,
|
||||||
|
note: string
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ import { AnalyzeMarkdown } from "./lib/markdown_analyzer.ts";
|
||||||
import { PageRoot } from "./lib/page.ts";
|
import { PageRoot } from "./lib/page.ts";
|
||||||
|
|
||||||
// Function to recursively crawl through the directory and analyze markdown files
|
// 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)) {
|
for await (const entry of Deno.readDir(dir)) {
|
||||||
const fullPath = `${dir}/${entry.name}`;
|
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
|
// Start the crawling process from the `./articles` directory
|
||||||
const data = await analyzeMarkdownFiles("./articles", {
|
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})
|
Deno.writeFileSync("./meta.json", new TextEncoder().encode(JSON.stringify(data, null, 2)), {append: false})
|
Loading…
Add table
Reference in a new issue