fix
This commit is contained in:
parent
e0d2a5876d
commit
d8ffb7cf75
5 changed files with 35 additions and 6 deletions
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
FROM rust:buster as builder
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
FROM debian:buster
|
||||||
|
|
||||||
|
RUN apt update && apt upgrade -y
|
||||||
|
|
||||||
|
COPY ./src/extract_metadata.py /extract_metadata.py
|
||||||
|
COPY --from=builder /app/target/release/umbrella /umbrella
|
||||||
|
|
||||||
|
WORKDIR /
|
||||||
|
|
||||||
|
CMD ["/umbrella"]
|
10
docker-compose.yml
Normal file
10
docker-compose.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
umbrella:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8000:8000"
|
||||||
|
volumes:
|
||||||
|
- ./config.yml:/config.yml
|
||||||
|
environment:
|
||||||
|
ROCKET_ADDRESS: 0.0.0.0
|
|
@ -44,7 +44,6 @@ impl Config {
|
||||||
impl Project {
|
impl Project {
|
||||||
pub fn build(&self, card_id: &str) -> maud::PreEscaped<String> {
|
pub fn build(&self, card_id: &str) -> maud::PreEscaped<String> {
|
||||||
let subcard_id = format!("{card_id}_sub");
|
let subcard_id = format!("{card_id}_sub");
|
||||||
// todo : info
|
|
||||||
|
|
||||||
maud::html!(
|
maud::html!(
|
||||||
div class="card" id=(card_id) {
|
div class="card" id=(card_id) {
|
||||||
|
@ -62,7 +61,9 @@ impl Project {
|
||||||
@if let Some(contact) = &self.contact {
|
@if let Some(contact) = &self.contact {
|
||||||
(contact.build())
|
(contact.build())
|
||||||
}
|
}
|
||||||
button class="expand-button" onclick=(format!("toggleSubcards('{subcard_id}')")) { "Expand" };
|
@if self.sub.as_ref().map(|x| !x.is_empty()).unwrap_or(false) {
|
||||||
|
button class="expand-button" onclick=(format!("toggleSubcards('{subcard_id}')")) { "Expand" };
|
||||||
|
}
|
||||||
div class="subcards" id=(subcard_id) {
|
div class="subcards" id=(subcard_id) {
|
||||||
@if let Some(sub) = &self.sub {
|
@if let Some(sub) = &self.sub {
|
||||||
@for (id, prj) in sub {
|
@for (id, prj) in sub {
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
use config::Config;
|
use config::Config;
|
||||||
|
use rocket::response::content::RawHtml;
|
||||||
use rocket::{get, launch, routes, State};
|
use rocket::{get, launch, routes, State};
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
mod site;
|
mod site;
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
pub fn main_page(c: &State<Config>) -> String {
|
pub fn main_page(c: &State<Config>) -> RawHtml<String> {
|
||||||
site::gen_site(c)
|
RawHtml(site::gen_site(c))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[launch]
|
#[launch]
|
||||||
|
|
|
@ -9,10 +9,10 @@ pub fn gen_site(c: &Config) -> String {
|
||||||
meta name="viewport" content="width=device-width, initial-scale=1.0";
|
meta name="viewport" content="width=device-width, initial-scale=1.0";
|
||||||
title { "Umbrella ☂️"};
|
title { "Umbrella ☂️"};
|
||||||
link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css";
|
link rel="stylesheet" href="https://unpkg.com/@picocss/pico@latest/css/pico.min.css";
|
||||||
style { (include_str!("style.css")) };
|
style { (maud::PreEscaped(include_str!("style.css"))) };
|
||||||
};
|
};
|
||||||
body {
|
body {
|
||||||
script { (include_str!("script.js")) };
|
script { (maud::PreEscaped(include_str!("script.js"))) };
|
||||||
main class="container" {
|
main class="container" {
|
||||||
h1 { "Umbrella ☂️" };
|
h1 { "Umbrella ☂️" };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue