Compare commits

...

82 Commits
main ... rust

Author SHA1 Message Date
Elnu 35d9135e07 cargo upgrade
9 months ago
Elnu de67ef1dec Use flake
9 months ago
Elnu 1aecdf3333 Start reorganizing styles
11 months ago
Elnu dfe14639b2 Remove liveSassCompile extension configuration, doesn't support dart-sass
11 months ago
Elnu a936117827 Convert SCSS to Sass
11 months ago
Elnu 43b2f58897 Configure liveSassCompile extension
11 months ago
Elnu 79705d03a4 cargo fmt
11 months ago
Elnu 6286b73b4b cargo clippy --fix
11 months ago
Elnu b343b6138b Better display missing localizations
11 months ago
Elnu 4e2230d6f3 Add Japanese menu localization
11 months ago
Elnu 78fe1ebab1 Add dart-sass, stop using sass_rocket_fairing
11 months ago
Elnu 1538f088d6 Update and add profile link
11 months ago
Elnu e18c31999a Fix session user avatar display
11 months ago
Elnu 4970ffd845 Fix login by adding default user deleted value
11 months ago
Elnu 21f490c183 Error handling for user profiles
11 months ago
Elnu 5aa4c4d203 Add user pages
11 months ago
Elnu e729eee137 cargo update
11 months ago
Elnu dd856d93d5 Adjust submissions padding
11 months ago
Elnu fa9d7e9be0 Add challenge content footer
11 months ago
Elnu a9d6a3800e Make footer go to bottom
11 months ago
Elnu 8b7f5b39b8 Add submissions copyright footer
11 months ago
Elnu a3f85e4cba Fix scrolling styles with CSS grid
11 months ago
Elnu 2794359218 cargo clippy --fix
11 months ago
Elnu a048d313bf Better legacy migration, deleted user handling
11 months ago
Elnu be8122d356 Remove empty word on challenge #110
11 months ago
Elnu 20ae442418 Remove shortcodes from challenge #99 content
11 months ago
Elnu e54ce5b52e Show formatted challenge content text
11 months ago
Elnu 0620607c6d Correct word not displaying on #66
11 months ago
Elnu 811afd0333 Handle challenges with no Japanese content like #59
11 months ago
Elnu fd6619320e Add fix for comrak bug not finding frontmatter
11 months ago
Elnu 86f81ccc35 Properly handle songs with only English title
11 months ago
Elnu a33a05a60a Add furigana tera filter
11 months ago
Elnu 981a78f36e Fix redundant_closure
11 months ago
Elnu 24b87d9b78 Manually fix unnecessary_filter_map
11 months ago
Elnu 2e704dc90d cargo clippy --fix
11 months ago
Elnu e2a35a271b Working database submission display
11 months ago
Elnu b20fa28198 cargo clippy --fix
11 months ago
Elnu 427b019a49 Database implementation, migration, user rework, animated server icons
11 months ago
Elnu 48ac5a44e2 Improve UX while server statuses are loading
11 months ago
Elnu a8c0969a71 Use SSE for get_guilds
11 months ago
Elnu 6b6c047b68 Proper welcome modal implementation
11 months ago
Elnu 50dce8da96 Use K-Gothic
11 months ago
Elnu 81a85cc628 Fix random SECRET generation command
11 months ago
Elnu a754fe5fce Add Traditional Chinese
11 months ago
Elnu 0e1995065b Improve navbar
11 months ago
Elnu 351c173357 cargo clippy --fix
11 months ago
Elnu 857832e052 cargo fmt
11 months ago
Elnu 3abc45cd4f Working localization
11 months ago
Elnu 245fcbcf1e cargo fmt
11 months ago
Elnu 76e359ea89 Implement i18n backend
11 months ago
Elnu 1de0633833 Challenge nav, style tweaks
11 months ago
Elnu e4bf1e733c Update servers with invite link
11 months ago
Elnu 56f54553ce Disable selection of recommended label
11 months ago
Elnu 6118231117 Use API for welcome modal
11 months ago
Elnu 839d6f80ab Mockup welcome modal
11 months ago
Elnu af9aa1b326 Fix clippy warnings
11 months ago
Elnu a282d06bc5 cargo fmt
11 months ago
Elnu 94bd2da27b Refactoring
11 months ago
Elnu 244e66cfa3 Create demo serenity/poise integration
11 months ago
Elnu 381c2b282d Make navbar dropdown
11 months ago
Elnu 1f33a60f7a Set secrete_key to fix cookie persistence
11 months ago
Elnu 53de257960 cargo fmt
11 months ago
Elnu 3d925edaad cargo clippy --fix
11 months ago
Elnu e624453472 Fix navbar username alignment
11 months ago
Elnu 06b032cabf Add success error catching redirect
11 months ago
Elnu 5ef44a787e Implement user data cookie storage
11 months ago
Elnu 3fdd1c870f Enforce stricter login rules
11 months ago
Elnu d2758c852e Improve initialization in test_user
11 months ago
Elnu 04b4240e0f cargo clippy --fix
11 months ago
Elnu cd34cd721e Implement basic login system
11 months ago
Elnu 57c2ef9aea cargo cippy --fix
11 months ago
Elnu 136852171e cargo fmt
11 months ago
Elnu 8674adb1a5 Implement basic login system
11 months ago
Elnu d669adeb2f Navbar mockup
11 months ago
Elnu 1c660608ee Fix whitespace issues
11 months ago
Elnu 3b7e03874f Implement kyujitai
11 months ago
Elnu ccba51e277 Implement styling
11 months ago
Elnu 25906df967 Working dictionary links
11 months ago
Elnu bd58b7aecd Implement basic challenge rendering
11 months ago
Elnu 1cf099845b Implement basic templating
11 months ago
Elnu 234458e11c Configure rocket.rs project
11 months ago
Elnu 9b386cd7b0 Remove Hugo
11 months ago

@ -1 +1 @@
use nix
use flake

22
.gitignore vendored

@ -1,19 +1,3 @@
# Generated files by hugo
/public/
/resources/_gen/
/assets/jsconfig.json
hugo_stats.json
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# Temporary lock file while building
/.hugo_build.lock
# Ignore challenge submissions to prevent bloating git repo
/assets/
# Ignore challenge data files
/data/
/target
.direnv
result

@ -0,0 +1,5 @@
{
"rust-analyzer.linkedProjects": [
"./tegakituesday/Cargo.toml",
]
}

4240
Cargo.lock generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,3 @@
[workspace]
members = ["tegakituesday"]
resolver = "2"

@ -1,6 +0,0 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

@ -1,3 +0,0 @@
#!/bin/bash
hugo
#find public -name '*.html' -type f -exec tidy --quiet yes --drop-empty-elements no --hide-comments yes -mq '{}' \; &> /dev/null

@ -1,20 +0,0 @@
baseURL = 'https://tegakituesday.com/'
languageCode = 'en-us'
title = 'Tegaki Tuesday'
theme = 'tegakituesday.com'
enableEmoji = true
disableKinds = ["taxonomy", "taxonomyTerm", "RSS"]
[params]
AuthorName = "Elnu"
MatomoURL = "matomo.elnu.com"
MatomoSiteId = "4"
CopyrightStart = 2021
[permalinks]
challenges = "/:filename"
[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true

@ -0,0 +1,96 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1693377291,
"narHash": "sha256-vYGY9bnqEeIncNarDZYhm6KdLKgXMS+HA2mTRaWEc80=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e7f38be3775bab9659575f192ece011c033655f0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1693447852,
"narHash": "sha256-K9npbs4S6+r51vpiElJi+0vwbAeftCAcOGbot/PCBnQ=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "40e851593ef4f9f8cd0b69c8cae7b722b9953a23",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"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
}

@ -0,0 +1,118 @@
/*
Some utility commands:
- `nix flake update --commit-lock-file`
- `nix flake lock update-input <input>`
- `nix build .#tegakituesday` or `nix build .`
- `nix run .#tegakituesday` or `nix run .`
*/
{
description = "The website for the Tegaki Tuesday handwriting challenge.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, rust-overlay }:
let
overlays = [ (import rust-overlay) ];
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system overlays;
};
rust = pkgs.rust-bin.nightly.latest;
rust-bin = rust.minimal;
rustPlatform = pkgs.makeRustPlatform {
cargo = rust-bin;
rustc = rust-bin;
};
rustSettings = with pkgs; {
src = ./.;
cargoHash = nixpkgs.lib.fakeHash;
};
meta = with nixpkgs.lib; {
homepage = "https://tegakituesday.com";
#license = [ licenses.unfree ];
platforms = [ system ];
maintainers = with maintainers; [ elnudev ];
};
in {
devShells.${system}.default = with pkgs; mkShell {
packages = [
(pkgs.rust-bin.nightly.latest.default.override {
extensions = [ "rust-src" ];
})
cargo-edit
bacon
];
inputsFrom = with self.packages.${system}; [ tegakituesday ];
allowUnfree = true;
};
packages.${system} = {
default = self.packages.${system}.tegakituesday;
tegakituesday = rustPlatform.buildRustPackage (rustSettings // {
pname = "tegakituesday";
version = "0.1.0";
nativeBuildInputs = with pkgs; [ pkg-config dart-sass ];
buildInputs = with pkgs; [ openssl gettext sqlite ];
buildAndTestSubdir = "tegakituesday";
cargoHash = "sha256-XvC5YRt9q39L+b/SHJd7e1VutrEUlKpfbVhJP75/qco=";
postPatch = ''
pushd tegakituesday
sass styles/sass/style.sass:$out/share/styles/css/style.css
if [ -d assets ]; then
cp -r assets $out/share
else
mkdir -p $out/share/assets
fi
cp -r static $out/share
sed -i -E "s|relative\!\(\"([^\"]+)\"\)|\"''${out}\/share\/\1\"|" src/main.rs
popd
'';
meta = meta // {
description = "The website for the Tegaki Tuesday handwriting challenge.";
};
});
};
/*
nixosModules.default = { config, ... }: let
lib = nixpkgs.lib;
in {
options.services.tegakituesday = {
enable = lib.mkEnableOption (lib.mdDoc "tegakituesday service");
package = lib.mkOption {
type = lib.types.package;
default = self.packages.${system}.tegakituesday;
defaultText = "pkgs.tegakituesday";
description = lib.mdDoc ''
The tegakituesday package that should be used.
'';
};
port = lib.mkOption {
type = lib.types.port;
default = 8000;
description = lib.mdDoc ''
The port at which to run.
'';
};
};
config.systemd.services.tegakituesday = let
cfg = config.services.tegakituesday;
pkg = self.packages.${system}.tegakituesday;
in lib.mkIf cfg.enable {
description = pkg.meta.description;
after = [ "network.target" ];
wantedBy = [ "network.target" ];
serviceConfig = {
ExecStart = ''
${cfg.package}/bin/tegakituesday --port ${builtins.toString cfg.port}
'';
Restart = "always";
DynamicUser = true;
};
};
};
*/
};
}

@ -1,3 +0,0 @@
<div id="cc"><a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank"><img src="https://mirrors.creativecommons.org/presskit/buttons/88x31/svg/by-sa.svg"></a></div>
<br>
Submissions are copyright &copy; {{ partial "copyright-years.html" . }} their respective submitters, and are licensed under the <a href="https://creativecommons.org/licenses/by-sa/4.0/" target="_blank">Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)</a> license.

@ -1 +0,0 @@
leaderboard.html

@ -1,3 +0,0 @@
<hr>
<p style="text-align: center">{{ markdownify .Inner }}</p>
<hr>

@ -1,23 +0,0 @@
<!--
Parameters:
type - (Required) album / track / playlist / artist
id - (Required) Target ID
width - (Optional) width
height - (Optional) height
-->
{{ if .IsNamedParams }}
<iframe src="https://open.spotify.com/embed/{{ .Get "type" }}/{{ .Get "id" }}"
width="{{ default "100%" (.Get "width") }}"
height="{{ default "380" (.Get "height") }}"
frameborder="0"
allowtransparency="true"
allow="encrypted-media"></iframe>
{{ else }}
<iframe src="https://open.spotify.com/embed/{{ .Get 0 }}/{{ .Get 1 }}"
width="{{ default "100%" (.Get 2) }}"
height="{{ default "380" (.Get 3) }}"
frameborder="0"
allowtransparency="true"
allow="encrypted-media"></iframe>
{{ end }}

@ -1,9 +0,0 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
mkShell {
buildInputs = [
hugo
];
}

@ -0,0 +1,6 @@
CLIENT_ID=
CLIENT_SECRET=
DOMAIN=https://tegakituesday.com/
# head -c32 /dev/urandom | base64
SECRET=
DISCORD_TOKEN=

@ -0,0 +1,8 @@
# Ignore challenge submissions to prevent bloating git repo
/assets/
# Ignore challenge data files
/data/
.env
*.db

@ -0,0 +1,29 @@
[package]
name = "tegakituesday"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
accept-language = "2.0.0"
chrono = { version = "0.4.28", features = ["serde"] }
clap = "4.4.2"
comrak = "0.18.0"
derive_more = "0.99.17"
dotenv = "0.15.0"
gettext = "0.4.0"
gh-emoji = "1.0.7"
poise = "0.5.5"
r2d2 = "0.8.10"
r2d2_sqlite = "0.22.0"
regex = "1.9.4"
reqwest = "0.11.20"
rocket = { version = "=0.5.0-rc.3", features = ["secrets", "json"] }
rocket_contrib = { version = "0.4.11", features = ["templates"] }
rocket_dyn_templates = { version = "0.1.0-rc.3", features = ["tera"] }
rusqlite = { version = "0.29.0", features = ["chrono"] }
serde = "1.0.188"
serde_json = "1.0.105"
serde_yaml = "0.9.25"
tokio = { version = "1.32.0", features = ["macros", "rt-multi-thread"] }

@ -0,0 +1,4 @@
[default]
template_dir = "templates"
sass_dir = "styles/sass"
css_dir = "styles/css"

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 118 KiB

@ -17,7 +17,6 @@ japanese:
- 霊: れい
- pos: particle
text: は
- pos: particle
- pos: verb
text:
- 踊: おど

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save