1
Fork 0

Compare commits

...

116 Commits
0.1.5 ... 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
Bauke 8597ec3f37
Start over with Rust. 2021-08-26 17:52:13 +02:00
Bauke e3089afaf1
Change license to AGPL-3.0-or-later. 2021-08-14 12:57:12 +02:00
Bauke 1281d45007
Add Discord invite link. 2021-08-05 14:52:44 +02:00
Bauke 72ae5cc0a0
Update dependencies. 2020-09-26 14:15:54 +02:00
Bauke 20d6b5faa4
Update stuff. 2020-09-24 14:51:55 +02:00
Bauke dd5d5cf5ab
Add a favicon and use absolute links. 2020-09-23 22:44:31 +02:00
Bauke 50d4b35f18
Add Mastodon link. 2020-09-20 14:47:34 +02:00
Bauke f229ad0ca5
Add liver crate. 2020-09-03 18:29:50 +02:00
Bauke 7761fb90c6
Add the new Crates. 2020-08-28 14:06:56 +02:00
Bauke ae50137a45
Switch to SCSS, fix CSS custom properties. 2020-08-13 16:20:07 +02:00
Bauke 71227e0a44
Replace colors with CSS custom properties. 2020-08-12 23:59:47 +02:00
Bauke c33cf5b532
Remove cpy-cli from the dependencies. 2020-08-04 17:54:32 +02:00
Bauke fc31109291
Replace the individual Yarn scripts with a single Node script. 2020-08-04 15:36:48 +02:00
Bauke d8027cf19b
Replace the dodgy submodules thing with git npm dependencies. 2020-08-03 14:50:45 +02:00
Bauke f890a97eb1
Add a primary configurable accent. 2020-08-03 00:26:46 +02:00
Bauke fbe5a3fede
Add a userscripts page. 2020-08-03 00:22:17 +02:00
Bauke 3542dc72d2
Redo the submodules file. 2020-08-02 22:18:02 +02:00
Bauke 7aff924a13
Add a userstyles page. 2020-08-02 17:04:14 +02:00
82 changed files with 2264 additions and 8342 deletions

3
.envrc Normal file
View File

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

111
.gitignore vendored
View File

@ -1,107 +1,8 @@
# Logs .direnv/
logs .netlify/
*.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
node_modules/ 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
# Build directory.
public/ public/
target/
Cargo.lock
pnpm-lock.yaml

37
Cargo.toml Normal file
View File

@ -0,0 +1,37 @@
# https://doc.rust-lang.org/cargo/reference/manifest.html
[package]
name = "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]
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.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"

674
LICENSE
View File

@ -1,21 +1,661 @@
The MIT License GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (c) 2020 Bauke <me@bauke.xyz> Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy Preamble
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The GNU Affero General Public License is a free, copyleft license for
copies or substantial portions of the Software. software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR The licenses for most software and other practical works are designed
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, to take away your freedom to share and change the works. By contrast,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE our General Public Licenses are intended to guarantee your freedom to
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER share and change all versions of a program--to make sure it remains free
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, software for all its users.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

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"]

View File

@ -1,15 +1,11 @@
# bauke.xyz # Bauke 🦖 XYZ
> My personal website. > **Bauke's website.**
[![Netlify deploy status](https://api.netlify.com/api/v1/badges/37bb1f7c-2abb-419f-9a31-a4b72209c1c8/deploy-status)](https://app.netlify.com/sites/bauke/deploys) ## Development
## Building 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.
To build the site [Node](https://nodejs.org) and [Yarn](https://yarnpkg.com) are required.
Then, run `yarn build`. The site will be built to the `public/` directory.
## License ## License
Code open-sourced with the [MIT license](https://git.holllo.cc/Bauke/bauke.xyz/src/branch/main/LICENSE), content licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). 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.

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,42 +1,24 @@
{ {
"name": "bauke.xyz", "private": "true",
"description": "My personal website.",
"version": "0.1.5",
"author": "Bauke <me@bauke.xyz>",
"homepage": "https://bauke.xyz",
"repository": "https://git.holllo.cc/Bauke/bauke.xyz",
"license": "MIT",
"scripts": {
"start": "nodemon --watch 'source/' --exec 'yarn build' --ext 'html css'",
"build": "cpy '**' '../public/' --cwd='source' --parents && yarn build:css",
"build:css": "cpy 'node_modules/modern-normalize/modern-normalize.css' 'public/css/'",
"test": "stylelint 'source/css/*.css'",
"deploy": "rm -rf 'public/' && yarn build && yarn deploy:netlify",
"deploy:netlify": "netlify deploy --prod --dir 'public/' -s 37bb1f7c-2abb-419f-9a31-a4b72209c1c8"
},
"dependencies": { "dependencies": {
"modern-normalize": "^0.7.0" "modern-normalize": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"cpy-cli": "^3.1.1", "@bauke/eslint-config": "^0.1.5",
"husky": "^4.2.5", "@bauke/prettier-config": "^0.1.5",
"netlify-cli": "^2.58.0", "@bauke/stylelint-config": "^0.1.5",
"nodemon": "^2.0.4", "netlify-cli": "^17.13.2",
"stylelint": "^13.6.1", "stylelint": "^16.1.0",
"stylelint-config-xo-space": "^0.14.0" "trash-cli": "^5.0.0",
"xo": "^0.56.0"
}, },
"prettier": "@bauke/prettier-config",
"stylelint": { "stylelint": {
"extends": [ "extends": "@bauke/stylelint-config"
"stylelint-config-xo-space"
],
"rules": {
"no-descending-specificity": null
}
}, },
"husky": { "xo": {
"hooks": { "extends": "@bauke/eslint-config",
"pre-commit": "yarn test", "prettier": true,
"pre-push": "yarn test" "space": true
}
} }
} }

2
rustfmt.toml Normal file
View File

@ -0,0 +1,2 @@
max_width = 80
tab_spaces = 2

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

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(())
}
}

View File

@ -1,99 +0,0 @@
html {
font-size: 62.5%;
}
body {
background-color: #1f1731;
color: #f2efff;
font-size: 1.75rem;
padding: 16px;
}
main {
align-items: center;
display: flex;
gap: 16px;
flex-direction: column;
margin: 0 auto;
margin-bottom: 16px;
max-width: 500px;
padding: 16px;
}
h1,
h2 {
background-color: #2a2041;
padding: 16px;
width: 100%;
}
h1,
h2,
p {
margin: 0;
}
a {
border: 1px dashed transparent;
color: #41c8e5;
display: inline-block;
font-weight: bold;
padding: 4px 8px;
text-decoration: none;
}
a:hover {
background-color: #d2b83a;
color: #1f1731;
}
a:active,
a:focus {
border: 1px dashed #f2efff;
outline: none;
}
img {
display: inline-block;
}
main,
footer,
h1,
ul {
border: 1px solid #3bd18a;
}
ul {
align-items: center;
background-color: #2a2041;
list-style: none;
margin: 0;
overflow: auto;
padding: 16px;
width: 100%;
}
li {
margin-bottom: 8px;
}
li:last-child {
margin-bottom: 0;
}
.divider {
border-top: 1px solid #3bd18a;
width: 100%;
}
footer {
font-weight: bold;
margin: 0 auto;
max-width: 500px;
padding: 16px;
}
footer a {
padding: 0;
}

View File

@ -1,43 +0,0 @@
.libraries {
background-color: transparent;
border: none;
padding: 0;
}
.libraries li {
background-color: #2a2041;
padding: 16px;
}
.libraries a {
margin-bottom: 8px;
}
.libraries a:hover {
background-color: #3bd18a;
}
.libraries .badges {
display: flex;
gap: 8px;
}
#npm,
.libraries li.npm {
border: 1px solid #f99fb1;
}
.npm a {
background-color: #f99fb1;
color: #1f1731;
}
#crates,
.libraries li.crates {
border: 1px solid #96c839;
}
.crates a {
background-color: #96c839;
color: #1f1731;
}

View File

@ -1,68 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bauke</title>
<link rel="stylesheet" href="css/modern-normalize.css">
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<main>
<h1>Bauke</h1>
<ul>
<li>
<a href="https://git.holllo.cc/Bauke" target="_blank">Gitea</a>
</li>
<li>
<a href="https://github.com/Bauke" target="_blank">GitHub</a>
</li>
<li>
<a href="https://gitlab.com/Bauke" target="_blank">GitLab</a>
</li>
</ul>
<ul>
<li>
<a href="https://holllo.cc" target="_blank">Holllo</a>
</li>
<li>
<a href="https://driftingnebula.com" target="_blank">driftingnebula</a>
</li>
</ul>
<ul>
<li>
<a href="https://tildes.net/user/Bauke" target="_blank">Tildes</a>
</li>
</ul>
<ul>
<li>
<a href="https://matrix.org" target="_blank">Matrix: @baukexyz:matrix.org</a>
</li>
<li>
<a href="mailto:me@bauke.xyz">Email: me@bauke.xyz</a>
</li>
</ul>
<div class="divider"></div>
<ul>
<li>
<a href="https://git.holllo.cc/Bauke?q=open-source" target="_blank">♡ Open Source</a>
</li>
<li>
<a href="https://git.holllo.cc/Bauke?q=rust" target="_blank">♥ Rust</a>
</li>
<li>
<a href="https://git.holllo.cc/Bauke?q=javascript" target="_blank">♡ TypeScript & JavaScript</a>
</li>
</ul>
</main>
<footer>
<p>
&copy; Bauke
<a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">CC BY-SA 4.0</a>
</p>
</footer>
</body>
</html>

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,80 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Libraries</title>
<link rel="stylesheet" href="../css/modern-normalize.css">
<link rel="stylesheet" href="../css/index.css">
<link rel="stylesheet" href="../css/libraries.css">
</head>
<body>
<main>
<h1>Libraries</h1>
<h2 id="crates">Crates.io</h2>
<ul class="libraries">
<li class="crates" id="opml">
<a href="https://crates.io/crates/opml" target="_blank">opml</a>
<p class="badges">
<img src="https://img.shields.io/crates/v/opml?color=yellowgreen&amp;style=flat-square"
alt="Crates.io version">
<img src="https://img.shields.io/crates/dr/opml?color=yellowgreen&amp;style=flat-square"
alt="Crates.io recent downloads">
<img src="https://img.shields.io/crates/l/opml?color=yellowgreen&amp;style=flat-square"
alt="Crates.io license">
</p>
</li>
</ul>
<div class="divider"></div>
<h2 id="npm">npm</h2>
<ul class="libraries">
<li class="npm" id="fancify">
<a href="https://npmjs.com/package/fancify" target="_blank">fancify</a>
<p class="badges">
<img src="https://img.shields.io/npm/v/fancify?color=red&amp;style=flat-square"
alt="npm version">
<img src="https://img.shields.io/npm/dm/fancify?color=red&amp;style=flat-square"
alt="npm downloads per month">
<img src="https://img.shields.io/npm/l/fancify?color=red&amp;style=flat-square"
alt="npm license">
</p>
</li>
<li class="npm" id="node-ddg">
<a href="https://npmjs.com/package/node-ddg" target="_blank">node-ddg</a>
<p class="badges">
<img src="https://img.shields.io/npm/v/node-ddg?color=red&amp;style=flat-square"
alt="npm version">
<img src="https://img.shields.io/npm/dm/node-ddg?color=red&amp;style=flat-square"
alt="npm downloads per month">
<img src="https://img.shields.io/npm/l/node-ddg?color=red&amp;style=flat-square"
alt="npm license">
</p>
</li>
<li class="npm" id="owofy">
<a href="https://npmjs.com/package/owofy" target="_blank">owofy</a>
<p class="badges">
<img src="https://img.shields.io/npm/v/owofy?color=red&amp;style=flat-square"
alt="npm version">
<img src="https://img.shields.io/npm/dm/owofy?color=red&amp;style=flat-square"
alt="npm downloads per month">
<img src="https://img.shields.io/npm/l/owofy?color=red&amp;style=flat-square"
alt="npm license">
</p>
</li>
</ul>
</main>
<footer>
<p>
&copy; Bauke
<a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">CC BY-SA 4.0</a>
</p>
</footer>
</body>
</html>

54
source/main.rs Normal file
View File

@ -0,0 +1,54 @@
//! # Bauke 🦖 XYZ
//!
//! > **Bauke's website.**
use std::{
fs,
path::{Path, PathBuf},
};
use color_eyre::{install, Result};
mod copy;
mod minify;
mod scss;
mod templates;
mod video;
fn main() -> Result<()> {
install()?;
let build_dir = PathBuf::from("target");
let public_dir = PathBuf::from("public");
let source_dir = PathBuf::from("source");
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)?;
Ok(())
}
/// 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(' ', "-");
let style_dir = build_dir.join("userstyles");
fs::create_dir_all(&style_dir)?;
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)?;
}
}
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

14
source/scss/_reset.scss Normal file
View File

@ -0,0 +1,14 @@
h1,
h2,
h3,
h4,
h5,
ol,
ul,
li,
p,
button,
input {
margin: 0;
padding: 0;
}

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

@ -0,0 +1,7 @@
@use "mixins";
.page-footer {
@include mixins.responsive-container;
margin-bottom: 2rem;
}

View File

@ -0,0 +1,32 @@
@use "mixins";
.page-header {
--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

@ -0,0 +1,41 @@
@use "mixins";
.page-main {
a {
align-items: center;
display: flex;
height: calc(50vh - 128px);
justify-content: center;
padding: 64px;
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 {
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;
}
}
}

49
source/scss/index.scss Normal file
View File

@ -0,0 +1,49 @@
@use "reset";
html {
font-size: 62.5%;
}
body {
--anchor-color: #f0f;
--anchor-hover: #000;
background-color: #000;
color: #000;
font-family: sans-serif;
font-size: 2rem;
}
a {
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;
}
.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

@ -0,0 +1 @@
@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(())
}

7888
yarn.lock

File diff suppressed because it is too large Load Diff