Initial Commit
This commit is contained in:
commit
161b3175b5
8 changed files with 560 additions and 0 deletions
3
README.md
Normal file
3
README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Site Data Repository
|
||||
|
||||
Pending description.
|
352
articles/styling_test.md
Normal file
352
articles/styling_test.md
Normal file
|
@ -0,0 +1,352 @@
|
|||
---
|
||||
title: Styling Test
|
||||
description: A test post to see how the site styling looks
|
||||
created: 2025-01-01
|
||||
tags: ['meta', 'web']
|
||||
---
|
||||
|
||||
## Styling Test
|
||||
|
||||
This is a test post to see how the site styling looks. I'm going to try out a few different things to see how they look.
|
||||
|
||||
### Headers
|
||||
|
||||
# Header 1
|
||||
## Header 2
|
||||
### Header 3
|
||||
#### Header 4
|
||||
##### Header 5
|
||||
###### Header 6
|
||||
|
||||
### Text
|
||||
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
|
||||
### Lists
|
||||
|
||||
#### Unordered
|
||||
|
||||
- Item 1
|
||||
- Item 2
|
||||
- Item 3
|
||||
- Item 4
|
||||
- Item 5
|
||||
|
||||
#### Ordered
|
||||
|
||||
1. Item 1
|
||||
2. Item 2
|
||||
3. Item 3
|
||||
4. Item 4
|
||||
5. Item 5
|
||||
|
||||
### Links
|
||||
|
||||
[Google](https://www.google.com)
|
||||
[GTA VII](https://www.youtube.com/watch?v=dQw4w9WgXcQ)
|
||||
|
||||
### Images
|
||||
|
||||

|
||||
|
||||
### Code
|
||||
|
||||
```python
|
||||
def hello_world():
|
||||
print("Hello, world!")
|
||||
```
|
||||
|
||||
```rust
|
||||
struct Point {
|
||||
x: f64,
|
||||
y: f64,
|
||||
}
|
||||
|
||||
impl Point {
|
||||
fn new(x: f64, y: f64) -> Point {
|
||||
Point { x, y }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let p = Point::new(1.0, 2.0);
|
||||
println!("({}, {})", p.x, p.y);
|
||||
}
|
||||
```
|
||||
|
||||
### Tables
|
||||
|
||||
| One | Two | Three |
|
||||
|-----|-----|-------|
|
||||
| 1 | 2 | 3 |
|
||||
| 4 | 5 | 6 |
|
||||
| 7 | 8 | 9 |
|
||||
|
||||
### Blockquotes
|
||||
|
||||
> This is a blockquote.
|
||||
> It can span multiple lines.
|
||||
> It can also contain **bold** and *italic* text.
|
||||
> And even links: [Google](https://www.google.com).
|
||||
|
||||
### Horizontal Rules
|
||||
|
||||
---
|
||||
|
||||
### Emphasis
|
||||
|
||||
*Italic text*
|
||||
|
||||
**Bold text**
|
||||
|
||||
***Bold and italic text***
|
||||
|
||||
### Footnotes
|
||||
|
||||
This is a sentence with a footnote[^1].
|
||||
|
||||
### Superscript and Subscript
|
||||
|
||||
This is a superscript: x<sup>2</sup>.
|
||||
|
||||
This is a subscript: H<sub>2</sub>O.
|
||||
|
||||
### Marker
|
||||
|
||||
This is a highlight: ==highlighted text==.
|
||||
|
||||
### Math
|
||||
|
||||
This is an inline math equation: $e^{i\pi} + 1 = 0$.
|
||||
|
||||
This is a block math equation:
|
||||
|
||||
$$
|
||||
|
||||
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
|
||||
|
||||
$$
|
||||
|
||||
### Checkboxes
|
||||
|
||||
- [x] Checked
|
||||
- [ ] Unchecked
|
||||
|
||||
### Alerts
|
||||
|
||||
> [!info]
|
||||
> This is an info alert.
|
||||
|
||||
> [!danger]
|
||||
> This is a danger alert.
|
||||
|
||||
> [!success]
|
||||
> This is a success alert.
|
||||
|
||||
> [!important]
|
||||
> This is an important alert.
|
||||
|
||||
> [!caution]
|
||||
> This is a caution alert.
|
||||
|
||||
> [!note]
|
||||
> This is a note alert.
|
||||
|
||||
> [!tip]
|
||||
> This is a tip alert.
|
||||
|
||||
> [!question]
|
||||
> This is a question alert.
|
||||
|
||||
> [!quote]
|
||||
> This is a quote alert.
|
||||
|
||||
> [!deprecated]
|
||||
> This is a deprecated alert.
|
||||
|
||||
> [!example]
|
||||
> This is an example alert.
|
||||
|
||||
> [!todo]
|
||||
> This is a todo alert.
|
||||
|
||||
> [!done]
|
||||
> This is a done alert.
|
||||
|
||||
<!-- new vers-->
|
||||
> ::alert{type="warning"}
|
||||
> The **alert** component - Warning
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="danger"}
|
||||
> The **alert** component - Danger
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="info"}
|
||||
> The **alert** component - Info
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="success"}
|
||||
> The **alert** component - Success
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="example"}
|
||||
> The **alert** component - Example
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="note"}
|
||||
> The **alert** component - Note
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="tip"}
|
||||
> The **alert** component - Tip
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="important"}
|
||||
> The **alert** component - Important
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="caution"}
|
||||
> The **alert** component - Caution
|
||||
> ::
|
||||
>
|
||||
> ::alert{type="quote"}
|
||||
> The **alert** component - Quote
|
||||
> ::
|
||||
|
||||
|
||||
### Iframes
|
||||
|
||||
<!-- The towwwn inside meeeeee :3 -->
|
||||
|
||||
The colorations are supposed to automagically change based on what you're linking to.
|
||||
|
||||
YouTube:
|
||||
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/69VV0pH57XE" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
||||
|
||||
Spotify:
|
||||
|
||||
<iframe src="https://open.spotify.com/embed/track/0R4EcD2e5m9wsMmWVVbBOc" width="300" height="380" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
|
||||
|
||||
Maps:
|
||||
|
||||
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3153.0000000000005!2d-122.0841926846827!3d37.42199997981999!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x808f7e3f0b0b0f7d%3A0x7d9b1f7f7f7f7f7f!2sGoogleplex!5e0!3m2!1sen!2sus!4v1630483660004!5m2!1sen!2sus" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>
|
||||
|
||||
### Audio
|
||||
|
||||
Bach's Prelude and Fugue in A minor:
|
||||
|
||||
<audio controls>
|
||||
<source src="/files/BWV_543-prelude.ogg" type="audio/ogg">
|
||||
Your browser does not support the audio element.
|
||||
</audio>
|
||||
|
||||
### Tables of Contents
|
||||
|
||||
- [Header 1](#header-1)
|
||||
- [Header 2](#header-2)
|
||||
- [Header 3](#header-3)
|
||||
- [Header 4](#header-4)
|
||||
- [Header 5](#header-5)
|
||||
- [Header 6](#header-6)
|
||||
- [Text](#text)
|
||||
- [Lists](#lists)
|
||||
- [Unordered](#unordered)
|
||||
- [Ordered](#ordered)
|
||||
- [Links](#links)
|
||||
- [Images](#images)
|
||||
- [Code](#code)
|
||||
- [Tables](#tables)
|
||||
- [Blockquotes](#blockquotes)
|
||||
- [Horizontal Rules](#horizontal-rules)
|
||||
- [Emphasis](#emphasis)
|
||||
- [Footnotes](#footnotes)
|
||||
- [Superscript and Subscript](#superscript-and-subscript)
|
||||
- [Marker](#marker)
|
||||
- [Math](#math)
|
||||
- [Checkboxes](#checkboxes)
|
||||
- [Alerts](#alerts)
|
||||
- [Iframes](#iframes)
|
||||
- [Audio](#audio)
|
||||
- [Tables of Contents](#tables-of-contents)
|
||||
- [Embedded CSS](#embedded-css)
|
||||
- [Embedded HTML](#embedded-html)
|
||||
- [Embedded SVG](#embedded-svg)
|
||||
- [Embedded LaTeX](#embedded-latex)
|
||||
- [Interactive Scripting](#interactive-scripting)
|
||||
- [Conclusion](#conclusion)
|
||||
|
||||
### Embedded CSS
|
||||
|
||||
<style>
|
||||
markdown-example-red {
|
||||
color: red;
|
||||
}
|
||||
|
||||
markdown-example-glowing {
|
||||
text-shadow: 0 0 5px #ff0000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<markdown-example-red>This text is red.</markdown-example-red>
|
||||
|
||||
<markdown-example-glowing>This text is glowing.</markdown-example-glowing>
|
||||
|
||||
### Embedded HTML
|
||||
|
||||
<div style="background-color: lightblue; padding: 10px;">
|
||||
This is a div with a light blue background.
|
||||
|
||||
<p>This is a paragraph inside the div.</p>
|
||||
|
||||
<ul>
|
||||
<li>Item 1</li>
|
||||
<li>Item 2</li>
|
||||
<li>Item 3</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
### Embedded SVG
|
||||
|
||||
<svg width="100" height="100">
|
||||
<circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
|
||||
</svg>
|
||||
|
||||
### Embedded LaTeX
|
||||
|
||||
Euler’s identity $e^{i\pi}+1=0$ is a beautiful formula in $\mathbb{R}^2$.
|
||||
|
||||
$$
|
||||
\frac {\partial^r} {\partial \omega^r} \left(\frac {y^{\omega}} {\omega}\right)
|
||||
= \left(\frac {y^{\omega}} {\omega}\right) \left\{(\log y)^r + \sum_{i=1}^r \frac {(-1)^ Ir \cdots (r-i+1) (\log y)^{ri}} {\omega^i} \right\}
|
||||
$$
|
||||
|
||||
### Interactive Scripting
|
||||
|
||||
On click, this button should change color:
|
||||
|
||||
<button onclick="this.style.backgroundColor = 'red';">Click me!</button>
|
||||
|
||||
On click, this button should run JavaScript and create an alert:
|
||||
|
||||
<button onclick="alert('Hello, world!');">Click me!</button>
|
||||
|
||||
And this one uses a `<script>` tag to do the same thing:
|
||||
|
||||
<button id="alert-button">Click me!</button>
|
||||
|
||||
<script>
|
||||
document.getElementById('alert-button').onclick = function() {
|
||||
alert('Hello, world!');
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
### Conclusion
|
||||
|
||||
This is the end of the test post. I hope everything looks good!
|
||||
|
||||
- TheFelidae
|
||||
|
||||
[^1]: This is the footnote.
|
9
deno.json
Normal file
9
deno.json
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"tasks": {
|
||||
"update": "deno run -A ./scripts/update.ts"
|
||||
},
|
||||
"imports": {
|
||||
"front-matter": "npm:front-matter@^4.0.2",
|
||||
"site-lib": "./scripts/lib/"
|
||||
}
|
||||
}
|
107
deno.lock
generated
Normal file
107
deno.lock
generated
Normal file
|
@ -0,0 +1,107 @@
|
|||
{
|
||||
"version": "4",
|
||||
"specifiers": {
|
||||
"npm:front-matter@^4.0.2": "4.0.2"
|
||||
},
|
||||
"npm": {
|
||||
"argparse@1.0.10": {
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"dependencies": [
|
||||
"sprintf-js"
|
||||
]
|
||||
},
|
||||
"esprima@4.0.1": {
|
||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
||||
},
|
||||
"front-matter@4.0.2": {
|
||||
"integrity": "sha512-I8ZuJ/qG92NWX8i5x1Y8qyj3vizhXS31OxjKDu3LKP+7/qBgfIKValiZIEwoVoJKUHlhWtYrktkxV1XsX+pPlg==",
|
||||
"dependencies": [
|
||||
"js-yaml"
|
||||
]
|
||||
},
|
||||
"js-yaml@3.14.1": {
|
||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||
"dependencies": [
|
||||
"argparse",
|
||||
"esprima"
|
||||
]
|
||||
},
|
||||
"sprintf-js@1.0.3": {
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||
}
|
||||
},
|
||||
"redirects": {
|
||||
"https://deno.land/std/fs/mod.ts": "https://deno.land/std@0.224.0/fs/mod.ts"
|
||||
},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.224.0/assert/assert.ts": "09d30564c09de846855b7b071e62b5974b001bb72a4b797958fe0660e7849834",
|
||||
"https://deno.land/std@0.224.0/assert/assertion_error.ts": "ba8752bd27ebc51f723702fac2f54d3e94447598f54264a6653d6413738a8917",
|
||||
"https://deno.land/std@0.224.0/fs/_create_walk_entry.ts": "5d9d2aaec05bcf09a06748b1684224d33eba7a4de24cf4cf5599991ca6b5b412",
|
||||
"https://deno.land/std@0.224.0/fs/_get_file_info_type.ts": "da7bec18a7661dba360a1db475b826b18977582ce6fc9b25f3d4ee0403fe8cbd",
|
||||
"https://deno.land/std@0.224.0/fs/_is_same_path.ts": "709c95868345fea051c58b9e96af95cff94e6ae98dfcff2b66dee0c212c4221f",
|
||||
"https://deno.land/std@0.224.0/fs/_is_subdir.ts": "c68b309d46cc8568ed83c000f608a61bbdba0943b7524e7a30f9e450cf67eecd",
|
||||
"https://deno.land/std@0.224.0/fs/_to_path_string.ts": "29bfc9c6c112254961d75cbf6ba814d6de5349767818eb93090cecfa9665591e",
|
||||
"https://deno.land/std@0.224.0/fs/copy.ts": "7ab12a16adb65d155d4943c88081ca16ce3b0b5acada64c1ce93800653678039",
|
||||
"https://deno.land/std@0.224.0/fs/empty_dir.ts": "e400e96e1d2c8c558a5a1712063bd43939e00619c1d1cc29959babc6f1639418",
|
||||
"https://deno.land/std@0.224.0/fs/ensure_dir.ts": "51a6279016c65d2985f8803c848e2888e206d1b510686a509fa7cc34ce59d29f",
|
||||
"https://deno.land/std@0.224.0/fs/ensure_file.ts": "67608cf550529f3d4aa1f8b6b36bf817bdc40b14487bf8f60e61cbf68f507cf3",
|
||||
"https://deno.land/std@0.224.0/fs/ensure_link.ts": "5c98503ebfa9cc05e2f2efaa30e91e60b4dd5b43ebbda82f435c0a5c6e3ffa01",
|
||||
"https://deno.land/std@0.224.0/fs/ensure_symlink.ts": "cafe904cebacb9a761977d6dbf5e3af938be946a723bb394080b9a52714fafe4",
|
||||
"https://deno.land/std@0.224.0/fs/eol.ts": "18c4ac009d0318504c285879eb7f47942643f13619e0ff070a0edc59353306bd",
|
||||
"https://deno.land/std@0.224.0/fs/exists.ts": "3d38cb7dcbca3cf313be343a7b8af18a87bddb4b5ca1bd2314be12d06533b50f",
|
||||
"https://deno.land/std@0.224.0/fs/expand_glob.ts": "2e428d90acc6676b2aa7b5c78ef48f30641b13f1fe658e7976c9064fb4b05309",
|
||||
"https://deno.land/std@0.224.0/fs/mod.ts": "c25e6802cbf27f3050f60b26b00c2d8dba1cb7fcdafe34c66006a7473b7b34d4",
|
||||
"https://deno.land/std@0.224.0/fs/move.ts": "ca205d848908d7f217353bc5c623627b1333490b8b5d3ef4cab600a700c9bd8f",
|
||||
"https://deno.land/std@0.224.0/fs/walk.ts": "cddf87d2705c0163bff5d7767291f05b0f46ba10b8b28f227c3849cace08d303",
|
||||
"https://deno.land/std@0.224.0/path/_common/assert_path.ts": "dbdd757a465b690b2cc72fc5fb7698c51507dec6bfafce4ca500c46b76ff7bd8",
|
||||
"https://deno.land/std@0.224.0/path/_common/basename.ts": "569744855bc8445f3a56087fd2aed56bdad39da971a8d92b138c9913aecc5fa2",
|
||||
"https://deno.land/std@0.224.0/path/_common/constants.ts": "dc5f8057159f4b48cd304eb3027e42f1148cf4df1fb4240774d3492b5d12ac0c",
|
||||
"https://deno.land/std@0.224.0/path/_common/dirname.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8",
|
||||
"https://deno.land/std@0.224.0/path/_common/from_file_url.ts": "d672bdeebc11bf80e99bf266f886c70963107bdd31134c4e249eef51133ceccf",
|
||||
"https://deno.land/std@0.224.0/path/_common/glob_to_reg_exp.ts": "6cac16d5c2dc23af7d66348a7ce430e5de4e70b0eede074bdbcf4903f4374d8d",
|
||||
"https://deno.land/std@0.224.0/path/_common/normalize.ts": "684df4aa71a04bbcc346c692c8485594fc8a90b9408dfbc26ff32cf3e0c98cc8",
|
||||
"https://deno.land/std@0.224.0/path/_common/normalize_string.ts": "33edef773c2a8e242761f731adeb2bd6d683e9c69e4e3d0092985bede74f4ac3",
|
||||
"https://deno.land/std@0.224.0/path/_common/strip_trailing_separators.ts": "7024a93447efcdcfeaa9339a98fa63ef9d53de363f1fbe9858970f1bba02655a",
|
||||
"https://deno.land/std@0.224.0/path/_os.ts": "8fb9b90fb6b753bd8c77cfd8a33c2ff6c5f5bc185f50de8ca4ac6a05710b2c15",
|
||||
"https://deno.land/std@0.224.0/path/basename.ts": "7ee495c2d1ee516ffff48fb9a93267ba928b5a3486b550be73071bc14f8cc63e",
|
||||
"https://deno.land/std@0.224.0/path/constants.ts": "0c206169ca104938ede9da48ac952de288f23343304a1c3cb6ec7625e7325f36",
|
||||
"https://deno.land/std@0.224.0/path/dirname.ts": "85bd955bf31d62c9aafdd7ff561c4b5fb587d11a9a5a45e2b01aedffa4238a7c",
|
||||
"https://deno.land/std@0.224.0/path/from_file_url.ts": "911833ae4fd10a1c84f6271f36151ab785955849117dc48c6e43b929504ee069",
|
||||
"https://deno.land/std@0.224.0/path/glob_to_regexp.ts": "7f30f0a21439cadfdae1be1bf370880b415e676097fda584a63ce319053b5972",
|
||||
"https://deno.land/std@0.224.0/path/is_absolute.ts": "4791afc8bfd0c87f0526eaa616b0d16e7b3ab6a65b62942e50eac68de4ef67d7",
|
||||
"https://deno.land/std@0.224.0/path/is_glob.ts": "a65f6195d3058c3050ab905705891b412ff942a292bcbaa1a807a74439a14141",
|
||||
"https://deno.land/std@0.224.0/path/join.ts": "ae2ec5ca44c7e84a235fd532e4a0116bfb1f2368b394db1c4fb75e3c0f26a33a",
|
||||
"https://deno.land/std@0.224.0/path/join_globs.ts": "5b3bf248b93247194f94fa6947b612ab9d3abd571ca8386cf7789038545e54a0",
|
||||
"https://deno.land/std@0.224.0/path/normalize.ts": "4155743ccceeed319b350c1e62e931600272fad8ad00c417b91df093867a8352",
|
||||
"https://deno.land/std@0.224.0/path/posix/_util.ts": "1e3937da30f080bfc99fe45d7ed23c47dd8585c5e473b2d771380d3a6937cf9d",
|
||||
"https://deno.land/std@0.224.0/path/posix/basename.ts": "d2fa5fbbb1c5a3ab8b9326458a8d4ceac77580961b3739cd5bfd1d3541a3e5f0",
|
||||
"https://deno.land/std@0.224.0/path/posix/constants.ts": "93481efb98cdffa4c719c22a0182b994e5a6aed3047e1962f6c2c75b7592bef1",
|
||||
"https://deno.land/std@0.224.0/path/posix/dirname.ts": "76cd348ffe92345711409f88d4d8561d8645353ac215c8e9c80140069bf42f00",
|
||||
"https://deno.land/std@0.224.0/path/posix/from_file_url.ts": "951aee3a2c46fd0ed488899d024c6352b59154c70552e90885ed0c2ab699bc40",
|
||||
"https://deno.land/std@0.224.0/path/posix/glob_to_regexp.ts": "76f012fcdb22c04b633f536c0b9644d100861bea36e9da56a94b9c589a742e8f",
|
||||
"https://deno.land/std@0.224.0/path/posix/is_absolute.ts": "cebe561ad0ae294f0ce0365a1879dcfca8abd872821519b4fcc8d8967f888ede",
|
||||
"https://deno.land/std@0.224.0/path/posix/join.ts": "7fc2cb3716aa1b863e990baf30b101d768db479e70b7313b4866a088db016f63",
|
||||
"https://deno.land/std@0.224.0/path/posix/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25",
|
||||
"https://deno.land/std@0.224.0/path/posix/normalize.ts": "baeb49816a8299f90a0237d214cef46f00ba3e95c0d2ceb74205a6a584b58a91",
|
||||
"https://deno.land/std@0.224.0/path/posix/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6",
|
||||
"https://deno.land/std@0.224.0/path/posix/resolve.ts": "08b699cfeee10cb6857ccab38fa4b2ec703b0ea33e8e69964f29d02a2d5257cf",
|
||||
"https://deno.land/std@0.224.0/path/resolve.ts": "a6f977bdb4272e79d8d0ed4333e3d71367cc3926acf15ac271f1d059c8494d8d",
|
||||
"https://deno.land/std@0.224.0/path/windows/_util.ts": "d5f47363e5293fced22c984550d5e70e98e266cc3f31769e1710511803d04808",
|
||||
"https://deno.land/std@0.224.0/path/windows/basename.ts": "6bbc57bac9df2cec43288c8c5334919418d784243a00bc10de67d392ab36d660",
|
||||
"https://deno.land/std@0.224.0/path/windows/constants.ts": "5afaac0a1f67b68b0a380a4ef391bf59feb55856aa8c60dfc01bd3b6abb813f5",
|
||||
"https://deno.land/std@0.224.0/path/windows/dirname.ts": "33e421be5a5558a1346a48e74c330b8e560be7424ed7684ea03c12c21b627bc9",
|
||||
"https://deno.land/std@0.224.0/path/windows/from_file_url.ts": "ced2d587b6dff18f963f269d745c4a599cf82b0c4007356bd957cb4cb52efc01",
|
||||
"https://deno.land/std@0.224.0/path/windows/glob_to_regexp.ts": "e45f1f89bf3fc36f94ab7b3b9d0026729829fabc486c77f414caebef3b7304f8",
|
||||
"https://deno.land/std@0.224.0/path/windows/is_absolute.ts": "4a8f6853f8598cf91a835f41abed42112cebab09478b072e4beb00ec81f8ca8a",
|
||||
"https://deno.land/std@0.224.0/path/windows/join.ts": "8d03530ab89195185103b7da9dfc6327af13eabdcd44c7c63e42e27808f50ecf",
|
||||
"https://deno.land/std@0.224.0/path/windows/join_globs.ts": "a9475b44645feddceb484ee0498e456f4add112e181cb94042cdc6d47d1cdd25",
|
||||
"https://deno.land/std@0.224.0/path/windows/normalize.ts": "78126170ab917f0ca355a9af9e65ad6bfa5be14d574c5fb09bb1920f52577780",
|
||||
"https://deno.land/std@0.224.0/path/windows/normalize_glob.ts": "9c87a829b6c0f445d03b3ecadc14492e2864c3ebb966f4cea41e98326e4435c6",
|
||||
"https://deno.land/std@0.224.0/path/windows/resolve.ts": "8dae1dadfed9d46ff46cc337c9525c0c7d959fb400a6308f34595c45bdca1972"
|
||||
},
|
||||
"workspace": {
|
||||
"dependencies": [
|
||||
"npm:front-matter@^4.0.2"
|
||||
]
|
||||
}
|
||||
}
|
18
meta.json
Normal file
18
meta.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"articles": [
|
||||
{
|
||||
"created": "2025-01-01T00:00:00.000Z",
|
||||
"edited": "2025-01-15T20:10:51.016Z",
|
||||
"author": null,
|
||||
"title": "Styling Test",
|
||||
"description": "A test post to see how the site styling looks",
|
||||
"tags": [
|
||||
"meta",
|
||||
"web"
|
||||
],
|
||||
"categories": null,
|
||||
"url": "./articles/styling_test.md",
|
||||
"wordCount": 917
|
||||
}
|
||||
]
|
||||
}
|
29
scripts/lib/markdown_analyzer.ts
Normal file
29
scripts/lib/markdown_analyzer.ts
Normal file
|
@ -0,0 +1,29 @@
|
|||
import { PageInfo } from "./page.ts";
|
||||
import fm, { type FrontMatterResult } from 'front-matter';
|
||||
import {existsSync} from "https://deno.land/std/fs/mod.ts";
|
||||
|
||||
export async function AnalyzeMarkdown(file: string | URL): Promise<PageInfo> {
|
||||
if (!existsSync(file))
|
||||
throw new Error("File not found: " + file)
|
||||
|
||||
const contents = new TextDecoder().decode(Deno.readFileSync(file))
|
||||
const stat = await Deno.stat(file);
|
||||
|
||||
const fm_result: FrontMatterResult<any> = fm(contents);
|
||||
|
||||
const info: PageInfo = {
|
||||
created: fm_result.attributes.created ?
|
||||
fm_result.attributes.created : new Date(),
|
||||
edited: stat.mtime ?
|
||||
stat.mtime : new Date(),
|
||||
author: fm_result.attributes.author ? fm_result.attributes.author : null,
|
||||
title: fm_result.attributes.title ? fm_result.attributes.title : null,
|
||||
description: fm_result.attributes.description ? fm_result.attributes.description : null,
|
||||
tags: fm_result.attributes.tags ? fm_result.attributes.tags : null,
|
||||
categories: fm_result.attributes.categories ? fm_result.attributes.categories : null,
|
||||
url: file as URL,
|
||||
wordCount: fm_result.body.trim().split(/\s+/).length
|
||||
};
|
||||
|
||||
return info;
|
||||
}
|
15
scripts/lib/page.ts
Normal file
15
scripts/lib/page.ts
Normal file
|
@ -0,0 +1,15 @@
|
|||
export interface PageInfo {
|
||||
title?: string,
|
||||
description?: string,
|
||||
author?: string,
|
||||
wordCount?: number,
|
||||
created: Date,
|
||||
edited: Date,
|
||||
tags?: Array<string>,
|
||||
categories?: Array<string>
|
||||
url: URL
|
||||
}
|
||||
|
||||
export interface PageRoot {
|
||||
articles: Array<PageInfo>
|
||||
}
|
27
scripts/update.ts
Normal file
27
scripts/update.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
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 {
|
||||
for await (const entry of Deno.readDir(dir)) {
|
||||
const fullPath = `${dir}/${entry.name}`;
|
||||
|
||||
if (entry.isDirectory) {
|
||||
// Recurse into subdirectories
|
||||
pageInfo = await analyzeMarkdownFiles(fullPath, pageInfo);
|
||||
} else if (entry.isFile && fullPath.endsWith(".md")) {
|
||||
// Analyze markdown file
|
||||
console.log(`Analyzing: ${fullPath}`);
|
||||
pageInfo.articles.push(await AnalyzeMarkdown(fullPath));
|
||||
}
|
||||
}
|
||||
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
// Start the crawling process from the `./articles` directory
|
||||
const data = await analyzeMarkdownFiles("./articles", {
|
||||
articles: []
|
||||
});
|
||||
|
||||
Deno.writeFileSync("./meta.json", new TextEncoder().encode(JSON.stringify(data, null, 2)), {append: false})
|
Loading…
Add table
Reference in a new issue