1
Fork 0

Compare commits

...

98 Commits
1.0.0 ... main

Author SHA1 Message Date
Bauke 8d9cfa8ad0
Add trash-cli. 2024-01-15 16:32:43 +01:00
Bauke 2352cb5a61
Update dependencies. 2024-01-15 16:31:42 +01:00
Bauke 0a646f0763
Add missing docs lints and add documentation. 2024-01-15 15:55:29 +01:00
Bauke 9b434f8cfe
Remove obsolete redirects. 2024-01-15 15:46:14 +01:00
Bauke aa37acf1dc
Move the pnpm scripts to cargo-make tasks. 2024-01-15 15:45:17 +01:00
Bauke 1549473c46
Add Nix flake and direnv files. 2024-01-15 13:15:26 +01:00
Bauke 4e40f961fa
Remove analytics. 2023-04-22 23:37:35 +02:00
Bauke 0929822465
Change all breakpoints to be 900px. 2023-01-31 12:51:10 +01:00
Bauke fa55c8dc17
Move DRG mods HTML to a separate file. 2023-01-30 12:48:26 +01:00
Bauke 9e64b06c12
Add a seperate DRG section to frontmatter data. 2023-01-30 12:44:16 +01:00
Bauke 3beb305cdf
Add Brighter Objects to the DRG mods filter. 2023-01-30 12:43:46 +01:00
Bauke 7f8d171825
Add the _9xtYCGWtn4 video. 2023-01-29 14:33:48 +01:00
Bauke 796befb383
Move the YouTube iframe outside the speedrun block. 2023-01-29 14:33:01 +01:00
Bauke f4fce844ca
Add doc comments to video structs. 2023-01-16 21:31:13 +01:00
Bauke 27d913a4cb
Make list style square. 2023-01-15 23:30:10 +01:00
Bauke 3eb2cd2381
Add tags to video data. 2023-01-13 14:57:09 +01:00
Bauke 2bfe826454
Slightly adjust spacing. 2023-01-12 12:43:17 +01:00
Bauke 46bf389dc3
Lowercase video directory names and check total count.
Netlify makes paths case-insensitive after deploying so lowercase
the video IDs and then add a check for total count so there isn't
a collision.
2023-01-10 16:17:19 +01:00
Bauke fa7c98e079
Add existing videos. 2023-01-10 15:30:05 +01:00
Bauke 023c6a1dde
Add Makefile. 2023-01-09 16:23:37 +01:00
Bauke c8c9d7c507
Use chars for constant patterns. 2023-01-09 16:22:51 +01:00
Bauke 78187bbe07
Use the correct name for minify-html. 2023-01-09 16:21:04 +01:00
Bauke 6e1a953d63
Fix linting issues. 2023-01-09 16:09:00 +01:00
Bauke 774e1411bb
Add HTML minification. 2023-01-09 15:43:05 +01:00
Bauke 9bfc8477be
Rename id to mod_id for clarity. 2023-01-08 12:55:11 +01:00
Bauke aa6da0069b
Include file name in frontmatter parsing error print. 2023-01-08 12:51:04 +01:00
Bauke 4f206aa95e
Replace manual mod link frontmatter with filter. 2023-01-08 12:45:53 +01:00
Bauke ce8be9e120
Fail parsing frontmatter without panicking. 2023-01-08 12:43:58 +01:00
Bauke cf28b65d16
Add netlify-cli dependency. 2023-01-07 16:35:04 +01:00
Bauke 2e6fddfac8
Simplify gitignore. 2023-01-07 16:34:50 +01:00
Bauke eb21f1b777
Add generation for video pages. 2023-01-07 14:58:05 +01:00
Bauke 235064a0ae
Add comrak dependency. 2023-01-07 13:37:00 +01:00
Bauke 9581974eda
Replace serde_json with toml-frontmatter. 2023-01-07 13:09:16 +01:00
Bauke f2e4ef64ee
Add more redirects. 2023-01-05 13:51:03 +01:00
Bauke 420c6cd93b
Add serde and serde_json dependencies. 2023-01-04 14:43:46 +01:00
Bauke a4b22db9e4
Switch to shareable configs. 2023-01-03 14:41:55 +01:00
Bauke 3d34c3b377
Goodbye Fediverse. 2022-11-10 14:16:33 +01:00
Bauke bcf68d985a
Prevent subtitle overflowing on lower width devices. 2022-10-25 23:54:46 +02:00
Bauke 7d3a89f2b6
Redesign! 2022-10-25 23:51:06 +02:00
Bauke ed0920d324
Switch to Umami analytics. 2022-10-15 13:24:03 +02:00
Bauke 62d1d33970
Let's try this one more time. 😅 2022-10-11 17:45:21 +02:00
Bauke 08bff090ce
Also update link text. 2022-10-11 17:43:50 +02:00
Bauke 1e88509682
Add Fediverse link, remove GitHub link. 2022-10-11 17:42:11 +02:00
Bauke d8adc87ee7
Specify userstyles git revision. 2022-10-04 01:03:55 +02:00
Bauke cd2b6cb03e
Update userstyles link. 2022-10-04 01:00:13 +02:00
Bauke 6be1edc0b4
Add Plausible analytics. 2022-09-29 11:04:14 +02:00
Bauke 163f676cb1
Add redirects. 2022-09-28 21:28:27 +02:00
Bauke b92e5c31bc
Fix deploy instruction. 2022-09-26 11:48:08 +02:00
Bauke 03d473fb8d
Add Gitea profile link. 2022-09-26 11:37:17 +02:00
Bauke 50bdc5bfea
Add the readme. 2022-09-26 00:57:20 +02:00
Bauke 4da9622185
Update dependencies and metadata. 2022-09-26 00:56:32 +02:00
Bauke 0a1f6f2ef1
Adjust colors. 2022-04-09 16:12:48 +02:00
Bauke abc9e983dd
Change shadow pattern color. 2022-04-09 15:56:21 +02:00
Bauke ed739a3421
Adjust colors. 2022-04-09 15:56:09 +02:00
Bauke b4c1daeea9
Continue without cover art if it can't be found. 2022-03-30 18:40:07 +02:00
Bauke cd88730d1c
Swap GitHub link label. 2022-03-29 21:31:49 +02:00
Bauke 110bc4eb28
Add GitHub link. 2022-03-29 18:33:43 +02:00
Bauke 3426ba66c0
Return early if there is no current listen. 2022-03-28 21:10:02 +02:00
Bauke 4a4188243b
Make sure image is defined before using it. 2022-03-28 20:23:31 +02:00
Bauke 2b92f2d5be
Move divider to insertHtml function. 2022-03-28 18:18:14 +02:00
Bauke e275324581
Add the driftingnebula logo. 2022-03-28 18:01:18 +02:00
Bauke 5d5f305514
Add driftingnebula. 2022-03-28 15:54:30 +02:00
Bauke 7a11421702
Make ListenBrainz 100% at smaller widths. 2022-03-28 15:47:29 +02:00
Bauke a89419f3b9
Add labels & titles to contact links. 2022-03-28 15:25:21 +02:00
Bauke 2d2778df9d
Replace usage of null with undefined. 2022-03-28 15:18:16 +02:00
Bauke 8c8c8970d8
Fix a:hover. 2022-03-28 15:16:41 +02:00
Bauke 11a3a083db
Make sure cover art is always https. 2022-03-28 15:14:05 +02:00
Bauke 4fe695f90c
Switch deploy command to pnpm. 2022-03-28 15:08:42 +02:00
Bauke 3c054bdaf0
Add cover art to ListenBrainz releases that have it. 2022-03-28 15:07:22 +02:00
Bauke 1a764d2926
Uppercase name. 2022-03-28 14:59:01 +02:00
Bauke 05c0637d69
Add patterned shadow. 2022-03-28 14:46:44 +02:00
Bauke d0e08574cb
Change spacing. 2022-03-28 14:42:34 +02:00
Bauke 107a2b762e
Add alt and title attributes to ListenBrainz image. 2022-03-28 14:38:48 +02:00
Bauke 6afa125e46
Make ListenBrainz anchor fit width to content. 2022-03-28 14:38:02 +02:00
Bauke c8fa1c5d76
Adjust default a:hover style. 2022-03-28 14:37:26 +02:00
Bauke 10305c021a
Add anchor text-decoration. 2022-03-28 14:30:42 +02:00
Bauke 260cb50bb5
Switch to grid layout for contact links. 2022-03-28 14:25:07 +02:00
Bauke 55f523fe48
Add focus styling. 2022-03-28 14:22:07 +02:00
Bauke 514b10ef84
Change the ListenBrainz style slightly. 2022-03-28 14:19:08 +02:00
Bauke 5e2d50af5b
Replace colors with CSS custom properties. 2022-03-28 14:14:44 +02:00
Bauke 475e4b3c1b
Add responsive containers to page components. 2022-03-28 14:12:12 +02:00
Bauke 375e9be9cf
Link to the correct image. 2022-03-28 14:11:40 +02:00
Bauke 2d8611aa06
Switch to @use everywhere. 2022-03-28 14:08:25 +02:00
Bauke f3f77b6d5a
Uppercase name. 2022-03-28 14:07:15 +02:00
Bauke c900caaf1c
Add a favicon. 2022-03-28 14:06:37 +02:00
Bauke 06f17f7b93
Update dependencies. 2022-03-28 14:05:26 +02:00
Bauke b8cdc833f3
Separate stuff out. 2021-12-14 00:50:38 +01:00
Bauke 97ccb7539b
Fix stuff. 2021-12-04 00:51:55 +01:00
Bauke b3f855440f
Make ListenBrainz loop. 2021-11-27 14:50:35 +01:00
Bauke a03db59c65
Don't insert ListenBrainz element if no listens are available. 2021-11-27 13:05:52 +01:00
Bauke 203e37c35f
Remove Mastodon. 2021-11-26 19:25:16 +01:00
Bauke 4849fb9ebc
Add ListenBrainz currently playing song. 2021-11-26 19:24:42 +01:00
Bauke 72fd3351b3
Redo. 2021-11-26 14:08:13 +01:00
Bauke 7918707dd9
Change style. 2021-11-25 23:28:21 +01:00
Bauke 4b389f9d9e
Update dependencies. 2021-11-25 16:00:56 +01:00
Bauke 5a6d1e8fc7
Add userstyles back. 2021-08-30 16:35:59 +02:00
Bauke 422b9452a2
Add yew-router. 2021-08-30 15:55:08 +02:00
Bauke 78b3fe8065
Add Netlify redirects to / 2021-08-30 15:35:27 +02:00
82 changed files with 1537 additions and 9808 deletions

3
.envrc Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
use flake

122
.gitignore vendored
View File

@ -1,118 +1,8 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
.direnv/
.netlify/
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Generated by Cargo
# will have compiled files and executables
/target/
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# These are backup files generated by rustfmt
**/*.rs.bk
# Build directory
public/
target/
Cargo.lock
pnpm-lock.yaml

View File

@ -2,24 +2,36 @@
[package]
name = "bauke-xyz"
description = "https://bauke.xyz"
version = "1.0.0"
edition = "2018"
repository = "https://git.holllo.cc/Bauke/bauke.xyz"
description = "Bauke's website."
repository = "https://git.bauke.xyz/Bauke/bauke-xyz"
license = "AGPL-3.0-or-later"
version = "1.0.0"
authors = ["Bauke <me@bauke.xyz>"]
edition = "2021"
[[bin]]
name = "bauke-xyz"
path = "source/main.rs"
[dependencies]
gloo-console = "0.1.0"
gloo-timers = "0.2.1"
log = "0.4.14"
rand = "0.8.4"
wasm-logger = "0.2.0"
yew = "0.18.0"
askama = "0.12.1"
color-eyre = "0.6.2"
comrak = "0.20.0"
minify-html = "0.15.0"
rsass = "0.23.4"
toml-frontmatter = "0.1.0"
[dependencies.getrandom]
version = "0.2.3"
features = ["js"]
[dependencies.serde]
features = ["derive"]
version = "1.0.152"
[dependencies.userstyles]
git = "https://git.bauke.xyz/Bauke/userstyles"
rev = "8aa9ad3"
[lints.clippy]
missing_docs_in_private_items = "warn"
[lints.rust]
missing_docs = "warn"
unsafe_code = "forbid"

41
Makefile.toml Normal file
View File

@ -0,0 +1,41 @@
# Build the website.
[tasks.build]
clear = true
command = "cargo"
args = ["run", "--release"]
# Remove build directories.
[tasks.clean]
clear = true
command = "pnpm"
args = ["trash", "public"]
# Deploy the website to Netlify.
[tasks.deploy-netlify]
clear = true
command = "pnpm"
dependencies = ["clean", "lint", "build"]
args = ["netlify", "deploy", "-p", "-d", "public/", "-s", "bauke.xyz"]
# Run all other linting tasks.
[tasks.lint]
clear = true
dependencies = ["lint-clippy", "lint-js", "lint-scss"]
# Run Clippy.
[tasks.lint-clippy]
clear = true
command = "cargo"
args = ["clippy"]
# Run XO.
[tasks.lint-js]
clear = true
command = "pnpm"
args = ["xo"]
# Run Stylelint.
[tasks.lint-scss]
clear = true
command = "pnpm"
args = ["stylelint", "source/**/*.scss"]

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# Bauke 🦖 XYZ
> **Bauke's website.**
## Development
With [Nix flakes](https://nixos.wiki/wiki/Flakes) and [direnv](https://direnv.net/) installed and enabled, all the required dependencies are automatically loaded from [`shell.nix`](./shell.nix). Then [cargo-make](https://sagiegurari.github.io/cargo-make/) can be used to build, deploy and lint the code. The available tasks are all described in the [`Makefile.toml`](Makefile.toml) configuration.
## License
Distributed under the [AGPL-3.0-or-later](https://spdx.org/licenses/AGPL-3.0-or-later.html) license, see [LICENSE](https://git.bauke.xyz/Bauke/bauke-xyz/src/branch/main/LICENSE) for more information.

View File

@ -1,9 +0,0 @@
[build]
dist = "public"
[serve]
no_autoreload = false
port = 5500
[clean]
dist = "public"

2
askama.toml Normal file
View File

@ -0,0 +1,2 @@
[general]
dirs = ["source/templates"]

59
flake.lock Normal file
View File

@ -0,0 +1,59 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1705242415,
"narHash": "sha256-a8DRYrNrzTudvO7XHUPNJD89Wbf1ZZT0VbwCsPnHWaE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ea780f3de2d169f982564128804841500e85e373",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

13
flake.nix Normal file
View File

@ -0,0 +1,13 @@
{
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = import ./shell.nix { inherit pkgs; };
}
);
}

View File

@ -1,19 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>bauke.xyz</title>
<link data-trunk rel="sass" href="source/scss/modern-normalize.scss" />
<link data-trunk rel="sass" href="source/scss/index.scss" />
</head>
<body>
<noscript>
This website requires JavaScript and WebAssembly to work.
</noscript>
</body>
</html>

View File

@ -1,32 +1,24 @@
{
"name": "bauke.xyz",
"version": "0.0.0",
"license": "AGPL-3.0-or-later",
"scripts": {
"deploy": "trunk clean && trunk build --release && yarn deploy:netlify",
"deploy:netlify": "netlify deploy --prod --dir 'public/' -s bauke.xyz",
"test": "stylelint 'source/**/*.scss'"
"private": "true",
"dependencies": {
"modern-normalize": "^2.0.0"
},
"devDependencies": {
"netlify-cli": "^6.7.6",
"stylelint": "^13.13.1",
"stylelint-config-xo-scss": "^0.14.0",
"stylelint-config-xo-space": "^0.15.1"
"@bauke/eslint-config": "^0.1.5",
"@bauke/prettier-config": "^0.1.5",
"@bauke/stylelint-config": "^0.1.5",
"netlify-cli": "^17.13.2",
"stylelint": "^16.1.0",
"trash-cli": "^5.0.0",
"xo": "^0.56.0"
},
"prettier": "@bauke/prettier-config",
"stylelint": {
"extends": [
"stylelint-config-xo-scss",
"stylelint-config-xo-space"
],
"ignoreFiles": [
"**/*.css"
],
"rules": {
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"no-descending-specificity": null,
"scss/at-import-partial-extension": null,
"scss/at-rule-no-unknown": null
}
"extends": "@bauke/stylelint-config"
},
"xo": {
"extends": "@bauke/eslint-config",
"prettier": true,
"space": true
}
}

7
shell.nix Normal file
View File

@ -0,0 +1,7 @@
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
mkShell rec {
packages = [ cargo-make nodejs nodePackages.pnpm ];
}

BIN
source/assets/avatar.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -1,10 +0,0 @@
/// Contains the main page `<footer>` component.
mod page_footer;
/// Contains the main page `<header>` component.
mod page_header;
/// Contains the main page `<main>` component.
mod page_main;
pub(crate) use page_footer::PageFooter;
pub(crate) use page_header::PageHeader;
pub(crate) use page_main::PageMain;

View File

@ -1,164 +0,0 @@
use gloo_timers::callback::Interval;
use rand::Rng;
use yew::prelude::*;
/// The main page `<footer>` element.
pub(crate) struct PageFooter {
/// The handle to the `setInterval`, this is stored so it doesn't get dropped
/// and stop the interval from happening.
_interval_handle: Interval,
/// The number of which square is currently active.
active_square: u32,
/// The link to this component.
link: ComponentLink<Self>,
/// The maximum number of squares to render.
max_squares: u32,
}
/// The possible messages for [`PageFooter`].
#[derive(Debug)]
pub(crate) enum PageFooterMessage {
/// The message to decrease the max squares by 1.
DecrementMaxSquares,
/// The message to increase the max squares by 1.
IncrementMaxSquares,
/// The message from the interval to update the active square.
TickActiveSquare,
}
impl Component for PageFooter {
type Message = PageFooterMessage;
type Properties = ();
fn create(_props: Self::Properties, link: ComponentLink<Self>) -> Self {
log::trace!("Creating PageFooter");
let interval_handle = {
let link = link.clone();
Interval::new(1000, move || {
link.send_message(Self::Message::TickActiveSquare)
})
};
Self {
_interval_handle: interval_handle,
active_square: 0,
link,
max_squares: 5,
}
}
fn update(&mut self, msg: Self::Message) -> ShouldRender {
log::trace!("PageFooterMessage::{:?}", msg);
match msg {
Self::Message::DecrementMaxSquares => {
if self.max_squares > 1 {
self.max_squares -= 1;
log::debug!("Max squares set to {}", self.max_squares);
true
} else {
false
}
}
Self::Message::IncrementMaxSquares => {
if self.max_squares < 360 {
self.max_squares += 1;
log::debug!("Max squares set to {}", self.max_squares);
true
} else {
false
}
}
Self::Message::TickActiveSquare => {
if self.max_squares == 1 {
if self.active_square == 0 {
self.active_square = 1;
} else {
self.active_square = 0;
}
} else {
self.active_square += 1;
if self.active_square >= self.max_squares {
self.active_square = 0;
}
}
true
}
}
}
fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
fn view(&self) -> Html {
let squares = (0..self.max_squares)
.into_iter()
.map(|square| {
let mut classes = classes!("square");
if square == self.active_square {
classes.push("active");
}
let hue = {
if self.max_squares == 1 {
rand::thread_rng().gen_range(0..=360)
} else {
(360 / self.max_squares) * square
}
};
let style = format!("background-color: hsl({}, 100%, 50%);", hue);
return html! {
<div style=style class=classes />
};
})
.collect::<Html>();
let squares = {
let style = format!(
"--square-transition: {0}s; --squares: {0};",
self.max_squares
);
let decrement = self
.link
.callback(|_| PageFooterMessage::DecrementMaxSquares);
let increment = self
.link
.callback(|_| PageFooterMessage::IncrementMaxSquares);
html! {
<div style=style class="squares">
<button onclick=decrement>{"-"}</button>
{squares}
<button onclick=increment>{"+"}</button>
</div>
}
};
let technologies = html! {
<p class="technologies">
{"Written in "}
<a target="_blank" href="https://www.rust-lang.org">{"Rust"}</a>
{" with "}
<a target="_blank" href="https://yew.rs">{"Yew"}</a>
{" and compiled to "}
<a target="_blank" href="https://webassembly.org">{"WebAssembly"}</a>
{" with "}
<a target="_blank" href="https://trunkrs.dev">{"Trunk"}</a>
{"."}
</p>
};
html! {
<footer class="page-footer">
{squares}
{technologies}
</footer>
}
}
}

View File

@ -1,31 +0,0 @@
use yew::prelude::*;
/// The main page `<header>` element.
pub(crate) struct PageHeader;
impl Component for PageHeader {
type Message = ();
type Properties = ();
fn create(_props: Self::Properties, _link: ComponentLink<Self>) -> Self {
log::trace!("Creating PageHeader");
Self
}
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
unimplemented!()
}
fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
fn view(&self) -> Html {
html! {
<header class="page-header">
<h1>{"bauke.xyz"}</h1>
</header>
}
}
}

View File

@ -1,43 +0,0 @@
use yew::prelude::*;
/// The main page `<main>` element.
pub(crate) struct PageMain;
impl Component for PageMain {
type Message = ();
type Properties = ();
fn create(_props: Self::Properties, _link: ComponentLink<Self>) -> Self {
log::trace!("Creating PageMain");
Self
}
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
unimplemented!()
}
fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
fn view(&self) -> Html {
html! {
<main class="page-main">
<div class="contact-links">
<a target="_blank" href="mailto:me@bauke.xyz">
{"me@bauke.xyz"}
</a>
<a target="_blank" href="https://matrix.to/#/@baukexyz:matrix.org">
{"@baukexyz:matrix.org"}
</a>
<a target="_blank" href="https://mastodon.social/@bauke">
{"@bauke@mastodon.social"}
</a>
</div>
</main>
}
}
}

42
source/copy.rs Normal file
View File

@ -0,0 +1,42 @@
//! The logic for files that need be directly copied over.
use std::{fs, path::Path, process::Command};
use color_eyre::Result;
/// Struct to contain functionality for copying.
pub struct Copy;
impl Copy {
/// Copy all the files to their respective destinations.
pub fn write(
build_dir: &Path,
public_dir: &Path,
source_dir: &Path,
) -> Result<()> {
let files_to_copy = vec![(
source_dir.join("netlify/_redirects"),
public_dir.join("_redirects"),
)];
for (source, destination) in files_to_copy {
fs::copy(source, destination)?;
}
let dirs_to_copy = vec![
(source_dir.join("assets"), &public_dir),
(source_dir.join("js"), &public_dir),
(build_dir.join("userstyles"), &public_dir),
];
for (source, destination) in dirs_to_copy {
Command::new("cp")
.arg("-r")
.arg(source)
.arg(destination)
.output()?;
}
Ok(())
}
}

99
source/js/listenbrainz.js Normal file
View File

@ -0,0 +1,99 @@
/* global document window */
window.addEventListener("DOMContentLoaded", async () => {
const loop = async () => {
const listen = await getCurrentListen();
if (listen === undefined) {
return;
}
let image;
try {
image = await getCoverArt(listen);
} catch (error) {
console.warn(error);
}
insertHtml(listen, image);
};
await loop();
setInterval(loop, 5 * 60 * 1000);
});
async function getCoverArt(listen) {
const releaseMbid = listen.track_metadata.additional_info?.release_mbid;
if (releaseMbid === undefined) {
return;
}
const result = await window.fetch(
`https://coverartarchive.org/release/${releaseMbid}`,
{
headers: {
Accept: "application/json",
},
},
);
if (!result.ok) {
return;
}
const data = await result.json();
if (data.images[0]?.thumbnails === undefined) {
return;
}
const thumbnails = data.images[0].thumbnails;
return (
thumbnails.small ?? thumbnails["250"] ?? thumbnails["500"] ?? undefined
);
}
async function getCurrentListen() {
const result = await window.fetch(
"https://api.listenbrainz.org/1/user/BaukeXYZ/playing-now",
);
if (!result.ok) {
console.warn(result.status);
return;
}
const data = await result.json();
if (data.payload.listens.length === 0) {
return;
}
return data.payload.listens[0];
}
function insertHtml(listen, image) {
if (listen === undefined) {
return;
}
const existing = document.querySelector(".listenbrainz") ?? undefined;
if (existing !== undefined) {
existing.remove();
}
const text = `${listen.track_metadata.artist_name} - ${listen.track_metadata.track_name}`;
const alt = image === undefined ? "ListenBrainz Logo" : `${text} Cover Art`;
image = image ?? "https://listenbrainz.org/static/img/logo_big.svg";
image = image.startsWith("http://") ? "https" + image.slice(4) : image;
const listenHtml = `
<p class="listenbrainz">
<img alt="${alt}" title="${alt}" src="${image}">
<span class="byline">Currently listening to</span>
<a href="https://listenbrainz.org/user/BaukeXYZ/" target="_blank">
${text}
</a>
</p>`;
document
.querySelector(".page-header")
.insertAdjacentHTML("beforeend", listenHtml);
}

View File

@ -1,48 +1,54 @@
#![forbid(unsafe_code)]
#![warn(missing_docs, clippy::missing_docs_in_private_items)]
//! # Bauke 🦖 XYZ
//!
//! > **Bauke's website.**
//! # [bauke.xyz](https://bauke.xyz)
use std::{
fs,
path::{Path, PathBuf},
};
use yew::prelude::*;
use color_eyre::{install, Result};
/// Components collection.
pub(crate) mod components;
mod copy;
mod minify;
mod scss;
mod templates;
mod video;
use components::{PageFooter, PageHeader, PageMain};
fn main() -> Result<()> {
install()?;
/// The main component.
pub(crate) struct Model;
let build_dir = PathBuf::from("target");
let public_dir = PathBuf::from("public");
let source_dir = PathBuf::from("source");
impl Component for Model {
type Message = ();
type Properties = ();
build_userstyles(&build_dir)?;
templates::Index::write(&public_dir)?;
scss::Scss::write(&public_dir, &source_dir)?;
copy::Copy::write(&build_dir, &public_dir, &source_dir)?;
video::write_all(&public_dir)?;
fn create(_props: Self::Properties, _link: ComponentLink<Self>) -> Self {
Self
}
Ok(())
}
fn update(&mut self, _msg: Self::Message) -> ShouldRender {
unimplemented!()
}
/// Write the userstyle files to the right place in the build directory.
fn build_userstyles(build_dir: &Path) -> Result<()> {
for target in userstyles::ALL_USERSTYLES {
let style = userstyles::Userstyle::load(target)?;
let style_name = style.metadata.name.to_lowercase().replace(' ', "-");
fn change(&mut self, _props: Self::Properties) -> ShouldRender {
false
}
let style_dir = build_dir.join("userstyles");
fs::create_dir_all(&style_dir)?;
fn view(&self) -> Html {
html! {
<>
<PageHeader />
<PageMain />
<PageFooter />
</>
let style_file = style_dir.join(format!("{}.user.css", style_name));
let formatted = style.format();
fs::write(style_file, formatted)?;
if let Some(image) = style.image {
let image_file = style_dir.join(format!("{}.png", style_name));
fs::write(image_file, image)?;
}
}
}
/// Our main function.
pub(crate) fn main() {
wasm_logger::init(wasm_logger::Config::new(log::Level::Debug));
log::debug!("Initializing Yew");
yew::start_app::<Model>();
Ok(())
}

26
source/minify.rs Normal file
View File

@ -0,0 +1,26 @@
//! Code for minifying.
use color_eyre::Result;
/// Minify HTML using [`minify-html`].
pub fn html(data: String) -> Result<String> {
let minify_config = minify_html::Cfg {
do_not_minify_doctype: true,
ensure_spec_compliant_unquoted_attribute_values: true,
keep_closing_tags: true,
keep_comments: false,
keep_html_and_head_opening_tags: true,
keep_input_type_text_attr: true,
keep_spaces_between_attributes: true,
keep_ssi_comments: false,
minify_css: false,
minify_js: false,
preserve_brace_template_syntax: false,
preserve_chevron_percent_template_syntax: false,
remove_bangs: false,
remove_processing_instructions: false,
};
let minified_data = minify_html::minify(&data.into_bytes(), &minify_config);
String::from_utf8(minified_data).map_err(Into::into)
}

10
source/netlify/_redirects Normal file
View File

@ -0,0 +1,10 @@
# Redirect any non-existing files to /
/* / 404
# Other redirects
/driftingnebula https://driftingnebula.com
/git https://git.bauke.xyz
/github https://github.com/Bauke
/gitlab https://gitlab.com/Bauke
/holllo https://holllo.org
/tildes https://tildes.net/user/Bauke

View File

@ -1,5 +0,0 @@
@mixin responsive-container {
margin-left: auto;
margin-right: auto;
width: 1000px;
}

View File

@ -0,0 +1,24 @@
@use "mixins";
.listenbrainz {
align-items: center;
background-color: #0002;
display: grid;
grid-template-columns: min-content auto;
padding: 8px;
width: fit-content;
@media (max-width: mixins.$breakpoint) {
width: 100%;
}
a {
width: fit-content;
}
img {
grid-row: 1 / 3;
margin-right: 8px;
width: 48px;
}
}

View File

@ -1,40 +1,7 @@
@use "mixins";
.page-footer {
@include responsive-container;
margin-top: 1rem;
@include mixins.responsive-container;
.squares {
display: grid;
grid-template-columns: min-content repeat(var(--squares, 5), 1fr) min-content;
height: 1rem;
margin-bottom: 1rem;
button {
align-items: center;
border: none;
display: flex;
font-family: monospace;
font-size: 1rem;
height: 100%;
justify-content: center;
width: 2rem;
}
.square {
height: 100%;
&.active {
opacity: 100%;
}
&:not(.active) {
opacity: 0%;
transition: opacity var(--square-transition, 5s);
}
}
}
.technologies {
background-color: #333;
padding: 1rem;
}
margin-bottom: 2rem;
}

View File

@ -1,6 +1,32 @@
@use "mixins";
.page-header {
@include responsive-container;
background-color: #333;
margin-top: 1rem;
padding: 1rem;
--anchor-color: #000;
--anchor-hover: #fff;
background: linear-gradient(to right, #5bc2e7, #b7cf81);
height: 256px;
display: flex;
gap: 8px;
flex-direction: column;
justify-content: center;
@media (max-width: mixins.$breakpoint) {
height: 50vh;
.subtitle {
flex-direction: column;
}
}
h1 {
border-bottom: 2px dotted;
padding-left: 64px;
}
.subtitle {
display: flex;
gap: 16px;
margin-left: 64px;
}
}

View File

@ -1,24 +1,41 @@
@use "mixins";
.page-main {
@include responsive-container;
background-color: #333;
margin-top: 1rem;
padding: 1rem;
.contact-links {
a {
align-items: center;
display: flex;
flex-direction: column;
gap: 1rem;
height: calc(50vh - 128px);
justify-content: center;
padding: 64px;
text-decoration: none;
a {
border: 2px solid;
color: #fff;
padding: 1rem;
text-decoration: none;
@media (max-width: mixins.$breakpoint) {
height: 50vh;
}
&.driftingnebula {
background: url("/assets/driftingnebula 2022-03-09.jpeg");
background-position: center center;
background-repeat: no-repeat;
&:hover {
background-color: #fff;
color: #000;
filter: hue-rotate(180deg);
}
}
&.holllo {
background: url("/assets/holllo-mark-square-pattern.png");
background-color: #1f1731;
background-repeat: repeat;
background-size: 48px;
&:hover {
filter: grayscale(100%);
}
}
img {
max-width: 256px;
}
}
}

View File

@ -1,30 +1,49 @@
@import 'reset';
@import 'mixins';
@use "reset";
html {
font-size: 62.5%;
}
body {
background-color: #111;
color: #fff;
--anchor-color: #f0f;
--anchor-hover: #000;
background-color: #000;
color: #000;
font-family: sans-serif;
font-size: 2rem;
}
a {
color: #ff0;
color: var(--anchor-color);
font-weight: bold;
text-decoration: 2px dotted underline;
&:hover {
background-color: var(--anchor-color);
color: var(--anchor-hover);
}
}
button {
cursor: pointer;
}
:focus {
outline: 2px dotted #f0f;
}
.monospace {
font-family: monospace;
}
@import 'components/page-footer';
@import 'components/page-header';
@import 'components/page-main';
.divider {
border-top: 2px dotted var(--foreground-1);
margin-bottom: 2rem;
margin-top: 2rem;
}
@use "components/page-footer";
@use "components/page-header";
@use "components/page-main";
@use "components/listenbrainz";

11
source/scss/mixins.scss Normal file
View File

@ -0,0 +1,11 @@
$breakpoint: 900px;
@mixin responsive-container {
margin-left: auto;
margin-right: auto;
width: $breakpoint;
@media (max-width: $breakpoint) {
width: 100%;
}
}

39
source/scss/mod.rs Normal file
View File

@ -0,0 +1,39 @@
//! Logic for building and writing the SCSS.
use std::{
fs::{create_dir_all, write},
path::Path,
};
use color_eyre::Result;
use rsass::{
compile_scss_path,
output::{Format, Style},
};
/// Struct to contain functionality for building the SCSS.
pub struct Scss;
impl Scss {
/// Build the SCSS and write the CSS to their respective places.
pub fn write(public_dir: &Path, source_dir: &Path) -> Result<()> {
let css_dir = public_dir.join("css");
create_dir_all(&css_dir)?;
let scss_dir = source_dir.join("scss");
let scss_filenames = vec!["index", "modern-normalize", "video"];
let format = Format {
precision: 5,
style: Style::Compressed,
};
for filename in scss_filenames {
let scss_path = scss_dir.join(format!("{}.scss", filename));
let css = compile_scss_path(&scss_path, format)?;
let css_path = css_dir.join(format!("{}.css", filename));
write(css_path, css)?;
}
Ok(())
}
}

View File

@ -1,283 +1 @@
/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
/*
Document
========
*/
/**
Use a better box model (opinionated).
*/
*,
::before,
::after {
box-sizing: border-box;
}
/**
Use a more readable tab size (opinionated).
*/
/**
1. Correct the line height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
-moz-tab-size: 4;
tab-size: 4;
line-height: 1.15; /* 1 */
text-size-adjust: 100%; /* 2 */
}
/*
Sections
========
*/
/**
Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
*/
/**
Remove the margin in all browsers.
*/
body {
font-family: system-ui;
margin: 0;
}
/*
Grouping content
================
*/
/**
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
*/
hr {
height: 0; /* 1 */
color: inherit; /* 2 */
}
/*
Text-level semantics
====================
*/
/**
Add the correct text decoration in Chrome, Edge, and Safari.
*/
abbr[title] {
text-decoration: underline dotted;
}
/**
Add the correct font weight in Edge and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
2. Correct the odd 'em' font sizing in all browsers.
*/
code,
kbd,
samp,
pre {
font-family:
ui-monospace,
SFMono-Regular,
Consolas,
'Liberation Mono',
Menlo,
monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/*
Tabular data
============
*/
/**
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
*/
table {
text-indent: 0; /* 1 */
border-color: inherit; /* 2 */
}
/*
Forms
=====
*/
/**
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
Remove the inheritance of text transform in Edge and Firefox.
1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type='button'],
[type='reset'],
[type='submit'] {
-webkit-appearance: button;
}
/**
Remove the inner border and padding in Firefox.
*/
::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
Restore the focus styles unset by the previous rule.
*/
:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
Remove the additional ':invalid' styles in Firefox.
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
*/
:-moz-ui-invalid {
box-shadow: none;
}
/**
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
*/
legend {
padding: 0;
}
/**
Add the correct vertical alignment in Chrome and Firefox.
*/
progress {
vertical-align: baseline;
}
/**
Correct the cursor style of increment and decrement buttons in Safari.
*/
::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
height: auto;
}
/**
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/
[type='search'] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
Remove the inner padding in Chrome and Safari on macOS.
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to 'inherit' in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/*
Interactive
===========
*/
/*
Add the correct display in Chrome and Safari.
*/
summary {
display: list-item;
}
@use "../../node_modules/modern-normalize/modern-normalize.css";

64
source/scss/video.scss Normal file
View File

@ -0,0 +1,64 @@
@use "mixins";
@use "reset";
body {
// Colors.
--foreground: #f1ebff;
--background: #1f003e;
--anchor: #89c3ff;
// Spacing constants.
--spacing-small: 8px;
--spacing-medium: 16px;
--spacing-large: 32px;
background-color: var(--background);
color: var(--foreground);
font-size: 1rem;
}
a {
color: var(--anchor);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
ul {
list-style-type: square;
margin-left: 1rem;
}
iframe,
h2 {
margin-top: var(--spacing-large);
}
iframe {
aspect-ratio: 16 / 9;
border: 2px dashed;
display: block;
width: 100%;
margin-bottom: var(--spacing-large);
max-width: 1280px;
padding: var(--spacing-small);
}
.page-header {
border-bottom: 2px dashed;
padding: var(--spacing-medium);
h1 {
@include mixins.responsive-container;
}
}
.page-main {
@include mixins.responsive-container;
}
.timestamp-link {
font-family: monospace;
}

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page_title }}</title>
<link rel="shortcut icon" href="/assets/avatar.jpg" type="image/jpeg">
<link rel="stylesheet" href="/css/modern-normalize.css">
{% block head %}{% endblock %}
</head>
<body>
{% block body %}{% endblock %}
</body>
</html>

View File

@ -0,0 +1,9 @@
<h2>Mods</h2>
<ul>
{% for mod_id in mods %}
{% let (mod_link, mod_title) = mod_id|drg_mod %}
<li>
<a href="{{ mod_link }}" target="_blank">{{ mod_title }}</a>
</li>
{% endfor %}
</ul>

View File

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block head %}
<link rel="stylesheet" href="/css/index.css">
{% endblock %}
{% block body %}
<header class="page-header">
<h1>Bauke</h1>
<p class="subtitle">
<a href="mailto:me@bauke.xyz" title="me@bauke.xyz">
Email
</a>
<a href="https://git.bauke.xyz/explore/repos">
Software
</a>
</p>
</header>
<main class="page-main">
<a class="driftingnebula" href="https://driftingnebula.com">
<img alt="driftingnebula" src="/assets/driftingnebula.png">
</a>
<a class="holllo" href="https://holllo.org">
<img alt="Holllo" src="/assets/holllo-text.png">
</a>
</main>
<script src="/js/listenbrainz.js"></script>
{% endblock %}

33
source/templates/mod.rs Normal file
View File

@ -0,0 +1,33 @@
//! The main [`askama`] templates.
use std::{
fs::{create_dir_all, write},
path::Path,
};
use askama::Template;
use color_eyre::Result;
/// The template for the home page.
#[derive(Debug, Template)]
#[template(path = "index.html")]
pub struct Index {
/// The text for the `<title>` element.
pub page_title: String,
}
impl Index {
/// Build, minify and write the template.
pub fn write(public_dir: &Path) -> Result<()> {
let destination = public_dir.join("index.html");
create_dir_all(destination.parent().unwrap())?;
let template = Self {
page_title: "Bauke".to_string(),
};
write(destination, crate::minify::html(template.render()?)?)?;
Ok(())
}
}

View File

@ -0,0 +1,62 @@
{% extends "base.html" %}
{% block head %}
<link rel="stylesheet" href="/css/video.css">
{% endblock %}
{% block body %}
<header class="page-header">
<h1>{{ page_title }}</h1>
</header>
<main class="page-main">
{{ rendered_markdown|safe }}
{% if let Some(speedrun) = speedrun %}
<h2>Speedrun</h2>
<ul>
<li>
<a href="{{ speedrun.entry }}" target="_blank">Entry</a>
</li>
<li>
<a href="{{ speedrun.leaderboard }}" target="_blank">Leaderboard</a>
</li>
</ul>
{% if let Some(mods) = speedrun.mods %}
{% include "drg-mods.html" %}
{% endif %}
{% if let Some(chapters) = speedrun.chapters %}
<h2>Chapters</h2>
<ul>
{% for (timestamp, text) in chapters %}
<li>
<p>
<a
class="timestamp-link"
href="https://youtu.be/{{ video_id }}?t={{ timestamp|timestamp_to_seconds }}"
target="_blank"
>{{ timestamp }}</a>
{{ text }}
</p>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% if let Some(drg) = drg %}
{% if let Some(mods) = drg.mods %}
{% include "drg-mods.html" %}
{% endif %}
{% endif %}
<iframe
src="https://www.youtube-nocookie.com/embed/{{ video_id }}"
title="Embedded YouTube video player"
frameborder="0"
allowfullscreen>
</iframe>
</main>
{% endblock %}

View File

@ -0,0 +1,18 @@
---toml
id = "Ip5J1LTd8Gk"
page_title = "Solo Industrial Sabotage Speedrun (13:30)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/y6nn9kqz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_RUNS"
chapters = [
["00:00", "Start"],
["00:51", "Power Station 1"],
["05:07", "Power Station 2"],
["10:34", "Caretaker"],
["12:47", "Extraction"],
["14:22", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "VjU-Id4gs18"
page_title = "Hazard 5 Solo Mining Expedition Speedrun (200 Morkite, 4:49)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/m7ww3x0z"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Mining_Expedition_%7C_200_Morkite?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:46", "Mission Start"],
["05:36", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,18 @@
---toml
id = "m6Yah6GyW-g"
page_title = "Solo Industrial Sabotage Speedrun (11:52)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zn77e1lm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_RUNS"
chapters = [
["00:00", "Start"],
["00:55", "Power Station 1"],
["04:53", "Power Station 2"],
["08:57", "Caretaker"],
["11:05", "Extraction"],
["12:47", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "w4oRDd2fybk"
page_title = "Hazard 5 Solo Egg Hunt Speedrun (4 Eggs, 2:49)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5vvl6nm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Egg_Hunt_%7C_4_Egg?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:53", "Mission Start"],
["03:43", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "Gloz61Dw8x4"
page_title = "Hazard 5 Solo On-site Refining Speedrun (8:37)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/y6nnkppz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/On-Site_Refining?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:40", "Mission Start"],
["09:20", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "cMzU0nE1cSo"
page_title = "Hazard 5 Solo Escort Duty Speedrun (13:14)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/ydwwkl0m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Escort_Duty_%7C_1-Stop?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:46", "Mission Start"],
["14:01", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "8xUq2JO9ETc"
page_title = "Hazard 5 Solo Elimination Speedrun (6:25)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5v27nem"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Elimination_%7C_2_Dreadnoughts?h=SOLO_HAZARD_5 "
chapters = [
["00:00", "Loading In"],
["00:50", "Mission Start"],
["07:16", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "tfOMqvli_Pg"
page_title = "Solo Salvage Operation Speedrun (8:01)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mej3410y"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Salvage_%7C_3_Mules?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["01:00", "Mission Start"],
["09:01", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "vUhm3UoTf78"
page_title = "Solo Escort Duty Speedrun (11:18)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zp296w8y"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Escort_Duty_%7C_1-Stop?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:44", "Mission Start"],
["11:59", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "hc_PwibsZRI"
page_title = "Solo Elimination Speedrun (2:51)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mej3r92y"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Elimination_%7C_2_Dreadnoughts?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:46", "Mission Start"],
["03:37", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "qTGumEaVE3g"
page_title = "Solo On-site Refining Speedrun (6:06)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/m7wxwwez"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/On-Site_Refining?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:49", "Mission Start"],
["06:55", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,19 @@
---toml
id = "0kW5RVGAYno"
page_title = "Solo All Missions Speedrun (34:41)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zq09j2ry"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/full_game?h=All_missions_Solo"
chapters = [
["00:00", "Loading In"],
["00:54", "Salvage Operation (2 Mules)"],
["10:23", "Egg Hunt (6 Eggs)"],
["14:32", "Point Extraction (7 Aquarqs)"],
["21:41", "Mining Expedition (225 Morkite)"],
["30:10", "Elimination (2 Dreadnoughts)"],
["35:35", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "SgyWLeUPDeE"
page_title = "Solo Industrial Sabotage Speedrun (10:53)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z12g7ojy"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:56", "Mission Start"],
["11:50", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,19 @@
---toml
id = "InqqFwV0jWI"
page_title = "Co-op Industrial Sabotage Speedrun (7:17)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mked6k3m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=COOP_RUNS"
chapters = [
["00:00", "Loading In"],
["00:52", "Mission Start"],
["08:09", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---
## Featuring
- [Nxiety](https://www.youtube.com/channel/UCi1bh6yImZVLSFo4rlrt2NQ)

View File

@ -0,0 +1,15 @@
---toml
id = "z-G49AcwgB8"
page_title = "Hazard 5 Solo Industrial Sabotage Speedrun (19:59)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/yjx864gz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["01:16", "Mission Start"],
["21:17", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "jSCZ14mZI9s"
page_title = "Solo Egg Hunt Speedrun (4 Eggs, 1:31)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mr6o6lgm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Egg_Hunt_%7C_4_Egg?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:44", "Mission Start"],
["02:15", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "RlvDM3_lPc0"
page_title = "Hazard 5 Solo Point Extraction Speedrun (7:13)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5vekl5m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Point_Extraction_%7C_10_AquarQ?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:59", "Mission Start"],
["08:12", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "YCjH0GvytBc"
page_title = "Solo Industrial Sabotage Speedrun (9:47)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/ylenwn3z"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:46", "Mission Start"],
["10:32", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "r-_QyaigSgg"
page_title = "Solo Salvage Operation Speedrun (7:56)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5ve6kgm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Salvage_%7C_3_Mules?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["01:05", "Mission Start"],
["09:01", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "36vWJjwL_ho"
page_title = "Solo Point Extraction Speedrun (4:41)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zgd20enz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Point_Extraction_%7C_10_AquarQ?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:59", "Mission Start"],
["05:41", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "gr6UD4Ud_WI"
page_title = "Hazard 5 Solo Egg Hunt Speedrun (8 Eggs, 7:36)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zxlnrn8z"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Egg_Hunt_%7C_8_Egg?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading"],
["00:52", "Start"],
["08:28", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "4o2xfNnIktk"
page_title = "Hazard 5 Solo Salvage Operation Speedrun (13:37)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/yvq8k8em"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Salvage_%7C_3_Mules?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading"],
["00:56", "Start"],
["14:33", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "8oyxCcJ8yEU"
page_title = "Hazard 5 Solo Salvage Operation Speedrun (11:06)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/y6n27qjz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Salvage_%7C_3_Mules?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading"],
["00:45", "Start"],
["11:53", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "8uqrfl4WBvQ"
page_title = "Hazard 5 Solo Mining Expedition Speedrun (325 Morkite, 7:09)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/y48o913m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Mining_Expedition_%7C_325_Morkite?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading"],
["00:56", "Start"],
["08:07", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "PqFr-qAA58Q"
page_title = "Solo Industrial Sabotage Speedrun (8:34)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/ywjrxr0z"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Industrial_Sabotage?h=SOLO_RUNS"
chapters = [
["00:00", "Loading"],
["00:58", "Start"],
["09:33", "Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "L7EQ_O4Q3zE"
page_title = "Hazard 5 Solo Mining Expedition Speedrun (200 Morkite, 4:09)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/m7w0o0ez"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Mining_Expedition_%7C_200_Morkite?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:43", "Mission Start"],
["04:53", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "diKBY6D8XQg"
page_title = "Hazard 5 Solo Point Extraction Speedrun (5:48)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/yvqvg4om"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Point_Extraction_%7C_10_AquarQ?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:45", "Mission Start"],
["06:34", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "o7r8UV8isHc"
page_title = "Hazard 5 Solo Escort Duty Speedrun (12:22)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/zq0dkxxy"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Escort_Duty_%7C_1-Stop?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:53", "Mission Start"],
["13:16", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "yAFgpw-YSe8"
page_title = "Hazard 5 Solo Salvage Operation Speedrun (9:57)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mr62e07m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Salvage_%7C_3_Mules?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:46", "Mission Start"],
["10:44", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "1rQoSxwLklw"
page_title = "Hazard 5 Solo Mining Expedition Speedrun (200 Morkite, 3:16)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/yjxw5xdz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Mining_Expedition_%7C_200_Morkite?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:43", "Mission Start"],
["03:59", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "Yn8LB4sXpJw"
page_title = "Solo On-site Refining Speedrun (5:47)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/ylelnvkz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/On-Site_Refining?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["00:48", "Mission Start"],
["06:36", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "bp83fj0lGtk"
page_title = "Solo Egg Hunt Speedrun (8 Eggs, 3:34)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/ylelxekz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Egg_Hunt_%7C_8_Egg"
chapters = [
["00:00", "Loading In"],
["01:01", "Mission Start"],
["03:34", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "57E-cUobZkg"
page_title = "Solo Escort Duty Speedrun (10:56)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/m36kj7wm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Escort_Duty_%7C_1-Stop"
chapters = [
["00:00", "Loading In"],
["00:48", "Mission Start"],
["11:45", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "sxZ85FSbQeo"
page_title = "Hazard 5 Solo On-site Refining Speedrun (7:37)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/mr6v8d2m"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/On-Site_Refining?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:56", "Mission Start"],
["08:33", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "ZgTm21GpfYE"
page_title = "Hazard 5 Solo Elimination Speedrun (5:40)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5v81wgm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Elimination_%7C_2_Dreadnoughts?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:59", "Mission Start"],
["06:40", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "6t05P9bgjQU"
page_title = "Hazard 5 Solo Egg Hunt Speedrun (4 Eggs, 2:39)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/yled5xrz"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Egg_Hunt_%7C_4_Egg?h=SOLO_HAZARD_5"
chapters = [
["00:00", "Loading In"],
["00:50", "Mission Start"],
["03:29", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,15 @@
---toml
id = "UShJaRrBhVY"
page_title = "Solo Elimination Speedrun (2:29)"
tags = ["Deep Rock Galactic", "Speedrun"]
[speedrun]
entry = "https://www.speedrun.com/deep_rock_galactic/run/z5v84lnm"
leaderboard = "https://www.speedrun.com/deep_rock_galactic/level/Elimination_%7C_2_Dreadnoughts?h=SOLO_RUNS"
chapters = [
["00:00", "Loading In"],
["01:05", "Mission Start"],
["03:35", "Mission Finish"],
]
mods = ["drglib", "simplemissiontimer"]
---

View File

@ -0,0 +1,16 @@
---toml
id = "_9xtYCGWtn4"
page_title = "No HUD Hazard 5 Mining Expedition"
tags = ["Deep Rock Galactic", "No HUD"]
[drg]
mods = ["brighter-objects"]
---
## Description
Trying something new with Deep Rock Galactic: playing without the HUD. Can't see how much health I have, how far off I'm from completing the mission objective, the terrain scanner no longer works and even where the drop pod will land is a mystery.
## Build
The build I used is available on [Karl.gg](https://karl.gg/preview/21636#/). Try it out yourself!

27
source/video/filters.rs Normal file
View File

@ -0,0 +1,27 @@
//! Custom filters for [`askama`] templates.
/// Get the DRG mod link and title from a given ID.
pub fn drg_mod(mod_id: &str) -> askama::Result<(String, &str)> {
let mods = std::collections::HashMap::<_, _>::from_iter([
("brighter-objects", "Brighter Objects"),
("drglib", "DRGLib"),
("simplemissiontimer", "SimpleMissionTimer"),
]);
let mod_title = mods.get(mod_id).unwrap();
Ok((format!("https://drg.mod.io/{mod_id}"), mod_title))
}
/// Turn a timestamp with format `mm:ss` into its total seconds.
///
/// ## Examples
///
/// - `00:30` -> 30 seconds
/// - `01:00` -> 60 seconds
/// - `01:30` -> 90 seconds
pub fn timestamp_to_seconds(timestamp: &str) -> askama::Result<i32> {
let mut split = timestamp.split(':');
let minutes = split.next().map(str::parse::<i32>).unwrap().unwrap();
let seconds = split.next().map(str::parse::<i32>).unwrap().unwrap();
Ok(minutes * 60 + seconds)
}

138
source/video/mod.rs Normal file
View File

@ -0,0 +1,138 @@
//! Templates, data structures and logic for the video pages.
use std::{fs, path::Path};
use {
askama::Template,
color_eyre::{eyre::eyre, Result},
serde::Deserialize,
};
mod filters;
/// The template for videos.
#[derive(Debug, Template)]
#[template(path = "video.html")]
pub struct VideoTemplate {
/// Deep Rock Galactic data.
pub drg: Option<DeepRockGalacticData>,
/// The title of the page.
pub page_title: String,
/// Markdown rendered by [`comrak`].
pub rendered_markdown: String,
/// Data for a speedrun video.
pub speedrun: Option<SpeedrunData>,
/// The YouTube video ID.
pub video_id: String,
}
/// The frontmatter data for a video.
#[derive(Debug, Deserialize)]
pub struct VideoData {
/// Deep Rock Galactic data.
pub drg: Option<DeepRockGalacticData>,
/// The YouTube video ID.
pub id: String,
/// The title of the page.
pub page_title: String,
/// Data for a speedrun video.
pub speedrun: Option<SpeedrunData>,
/// Tags for the video.
#[serde(default)]
pub tags: Vec<String>,
}
/// Data for speedrun videos.
#[derive(Debug, Deserialize)]
pub struct SpeedrunData {
/// Video chapters as with timestamps and chapter titles.
pub chapters: Option<Vec<(String, String)>>,
/// A link to the entry for this specific speedrun.
pub entry: String,
/// A link to the leaderboard for this speedrun's category.
pub leaderboard: String,
/// Deep Rock Galactic mods used in the run.
pub mods: Option<Vec<String>>,
}
/// Additional data for Deep Rock Galactic videos.
#[derive(Debug, Deserialize)]
pub struct DeepRockGalacticData {
/// Deep Rock Galactic mods used in the run.
pub mods: Option<Vec<String>>,
}
/// Compile and write all the found videos to their respective locations.
pub fn write_all(public_dir: &Path) -> Result<()> {
let video_datas = {
let mut data = vec![];
for dir in ["2022", "2023"] {
for file in fs::read_dir(format!("source/video/{dir}"))? {
let file_path = file?.path();
if file_path.extension().unwrap() != "md" {
continue;
}
let file_contents = fs::read_to_string(&file_path)?;
let (video_data, markdown) =
match toml_frontmatter::parse::<VideoData>(&file_contents) {
Ok(parsed) => parsed,
Err(error) => {
println!("{:?} {}", file_path.file_name().unwrap(), error);
continue;
}
};
data.push((video_data, markdown.to_string()));
}
}
data
};
let video_dir = public_dir.join("v");
let expected_video_count = video_datas.len();
for (video_data, markdown) in video_datas {
let video_dir = video_dir.join(&video_data.id.to_lowercase());
fs::create_dir_all(&video_dir)?;
let template = VideoTemplate {
drg: video_data.drg,
page_title: video_data.page_title,
rendered_markdown: comrak::markdown_to_html(
&markdown,
&Default::default(),
),
speedrun: video_data.speedrun,
video_id: video_data.id,
};
fs::write(
video_dir.join("index.html"),
crate::minify::html(template.render()?)?,
)?;
}
let actual_video_count = fs::read_dir(video_dir)?.count();
if expected_video_count != actual_video_count {
return Err(eyre!(
"Expected {} videos, found {}",
expected_video_count,
actual_video_count
));
}
Ok(())
}

8992
yarn.lock

File diff suppressed because it is too large Load Diff