From 1e2ff502147ea709f7e61757b3d636d619ddd1f7 Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 26 Oct 2021 18:47:24 -0700 Subject: [PATCH] * breadcrumb navbar should make navigation easier now --- .gitlab-ci.yml | 53 ++++++++++++++++++----------------- api/src/page.rs | 7 +++-- api/templates/list.html.tera | 22 +++++++++++---- api/templates/video.html.tera | 14 +++++++-- 4 files changed, 58 insertions(+), 38 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cbff854..7daafd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,33 +1,34 @@ stages: - pages - - build +# Literally both of these fail 99% of the time so I'm forgoing them completely +# for now until I find something doesn't suck # Builds out the intended zip package -package: - image: rustlang/rust:nightly - stage: build - script: - - rustup default nightly-2021-09-18 - - mkdir -p build - - cp api/templates/ api/static/ build -r - - cargo --version - - cargo build --release - - cp target/release/api build/server - - cp ./scripts/generate-thumbnail.sh build/ - - cp readme.md build/ - - sh ./scripts/default-rocket-toml.sh - artifacts: - paths: - - build/ - -# Build the updated docker -build-docker-image: - stage: build - image: docker:stable - script: - - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin - - docker build -t registry.gitlab.com/shockrah/clippable . - - docker push registry.gitlab.com/shockrah/clippable +#package: +# image: rustlang/rust:nightly +# stage: build +# script: +# - rustup default nightly-2021-09-18 +# - mkdir -p build +# - cp api/templates/ api/static/ build -r +# - cargo --version +# - cargo build --release +# - cp target/release/api build/server +# - cp ./scripts/generate-thumbnail.sh build/ +# - cp readme.md build/ +# - sh ./scripts/default-rocket-toml.sh +# artifacts: +# paths: +# - build/ +# +## Build the updated docker +#build-docker-image: +# stage: build +# image: docker:stable +# script: +# - echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin +# - docker build -t registry.gitlab.com/shockrah/clippable . +# - docker push registry.gitlab.com/shockrah/clippable diff --git a/api/src/page.rs b/api/src/page.rs index a63296d..42761eb 100644 --- a/api/src/page.rs +++ b/api/src/page.rs @@ -83,11 +83,10 @@ pub fn video(cat: PathBuf, file_base: PathBuf) -> Template { let file = map_base_vfile(&cat, &file_base); let cat = cat.to_string_lossy(); - // First we have to try and find the file let mut file_pretty = file.to_string(); - for c in ["-", "_", ".mp4", ".mkv", ".webm"] { - file_pretty = file_pretty.replace(c, " "); + for c in [".mp4", ".mkv", ".webm"] { + file_pretty = file_pretty.replace(c, ""); } h.insert("title", &file_pretty); @@ -95,6 +94,8 @@ pub fn video(cat: PathBuf, file_base: PathBuf) -> Template { let url = format!("/clip/{}/{}", &cat, &file); h.insert("url", &url); h.insert("desc", &SITEDESC); + h.insert("category", &cat); + h.insert("filename", &file_pretty); let thumbnail = format!("/thumbnail/{}/{}", cat, file); h.insert("ogimg", &thumbnail); diff --git a/api/templates/list.html.tera b/api/templates/list.html.tera index 2f2d95c..fe71f79 100644 --- a/api/templates/list.html.tera +++ b/api/templates/list.html.tera @@ -33,14 +33,24 @@

{{title}}