diff --git a/Rocket.toml b/Rocket.toml new file mode 100644 index 0000000..c9962e5 --- /dev/null +++ b/Rocket.toml @@ -0,0 +1,2 @@ +[debug] +static_route = "http://localhost:8001" diff --git a/data/cv/ovlach.yaml b/data/cv/ovlach.yaml new file mode 100644 index 0000000..790968e --- /dev/null +++ b/data/cv/ovlach.yaml @@ -0,0 +1,33 @@ +person: + name: Ondrej + surname: Vlach + +education: + - from: 2022 + to: 2023 + school: blabla + + +jobs: + - jobtype: FREELANCE + from: 20/12/1986 + to: 21/12/1986 + company: blabla + title: blabla + description: blabla + languages: + - PHP + - HTML + - CSS + - JavaScript + - MySQL + - Wordpress + - Bootstrap + +technologies: + - name: PHP + techtype: LANGUAGE + - name: HTML + techtype: LANGUAGE + - name: CSS + techtype: LANGUAGE \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index f5a0a93..34a3043 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,40 @@ -use rocket::*; -use rocket_dyn_templates::Template; +use std::collections::HashMap; + +use rocket::{*, fairing::AdHoc}; +use rocket_dyn_templates::{Template, tera::Value}; +use ::serde::Deserialize; pub mod routes; -pub fn rocket_builder() -> Rocket { - rocket::build().attach( - Template::fairing() +#[derive(Deserialize)] +#[serde(crate = "rocket::serde")] +pub struct PresentationConfig { + static_route: String, +} + + +pub fn static_filter( + value: &Value, + args: &HashMap +) -> Result { + let host = args.get("static_host"); + return Ok(rocket_dyn_templates::tera::Value::String(format!("{}/{}", host.unwrap().as_str().unwrap(), value.as_str().unwrap()))); // TODO: fix-me here! +} + +pub fn rocket_builder() -> Rocket { + let rocket = rocket::build(); + //let figment = rocket.figment(); + // extract the entire config any `Deserialize` value + //let config: PresentationConfig = figment.extract().expect("config"); + + rocket.attach( + Template::try_custom(|engines| { + engines.tera.register_filter("static", static_filter); + Ok(()) + }) + ).attach( + AdHoc::config::() ).mount("/", routes![ routes::root::index ]) diff --git a/src/routes/root.rs b/src/routes/root.rs index d234346..7245496 100644 --- a/src/routes/root.rs +++ b/src/routes/root.rs @@ -1,14 +1,18 @@ -use rocket::get; +use rocket::{get, State, config}; use rocket_dyn_templates::Template; use serde::Serialize; -#[derive(Serialize, Debug)] -struct Test { +use crate::PresentationConfig; +#[derive(Serialize, Debug)] +struct RootPage { + static_host: String, } #[get("/")] -pub fn index() -> Template { - let context = Test {}; +pub fn index(config: &State) -> Template { + let context = RootPage { + static_host: config.static_route.clone(), + }; Template::render("default", &context) } diff --git a/templates/base.html.tera b/templates/base.html.tera new file mode 100644 index 0000000..167cfa7 --- /dev/null +++ b/templates/base.html.tera @@ -0,0 +1,85 @@ + + + + + + + Material Resume + + + + + + + + + + + +
+
+
+

Walter Patterson

+ +
+
+
+ {% block content %} {% endblock content %} + + + + + + \ No newline at end of file diff --git a/templates/default.html.tera b/templates/default.html.tera index cb937e3..2711e6b 100644 --- a/templates/default.html.tera +++ b/templates/default.html.tera @@ -1,361 +1,21 @@ - - - - - - - Material Resume - - - - - - - - - - - -
-
-
-

Walter Patterson

- -
-
-
-
-
+{% extends "base" %} + +{% block content %} +
+
-
-
-
-
-
-
-
-
-

Walter Patterson

-

Front-end Developer and Graphic Designer

-
-
- -
- -
+
+
+
+
+
+
+
+
+

Walter Patterson

+

Front-end Developer and Graphic Designer

-
-
-
-
-
-
-
-
-

About Me

-

Hello! I’m Walter Patterson. I am passionate about UI/UX design and Web Design. I am a skilled front-end developer and master of graphic design tools such as Photoshop and Sketch. I am a quick learner and a team worker that gets the job done.

-

I can easily capitalize on low hanging fruits and quickly maximize timely deliverables for real-time schemas.

-
-
-
-

Bio

-
-
Age
-
-
-
28
-
-
-
Email
-
-
-
walter@company.com
-
-
-
Skype
-
-
-
username@skype.com
-
-
-
Phone
-
-
-
+0718-111-0011
-
-
-
Address
-
-
-
131 W, City Center, New York, U.S.A
-
-
-
-
-
-
-
-
-

Professional Skills

-
-
-
HTML -
-
Master
-
-
-
CSS -
-
Expert
-
-
-
JavaScript -
-
Advance
-
-
-
WordPress -
-
Advance
-
-
-
-
-
Adobe Photoshop -
-
Master
-
-
-
Adobe Illustrator -
-
Expert
-
-
-
Sketch -
-
Expert
-
-
-
Adobe XD -
-
Beginner
-
-
-
-
-
-
-
-
-

Work Experience

-
-
-
-
Frontend Developer at Creative Agency
-
-
-
May, 2015 - Present
-
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
-
-
-
-
-
Graphic Designer at Design Studio
-
-
-
June, 2013 - May, 2015
-
Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
-
-
-
-
-
Junior Web Developer at Indie Studio
-
-
-
Jan, 2011 - May, 2013
-
User generated content in real-time will have multiple touchpoints for offshoring. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
-
-
-
-
-
-
-
-

Education

-
-
-
-
Masters in Information Technology from International University
-
-
-
2011 - 2013
-
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
-
-
-
-
-
Bachelor of Computer Science from Regional College
-
-
-
2007 - 2011
-
Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
-
-
-
-
-
Science and Mathematics from Mt. High Scool
-
-
-
1995 - 2007
-
User generated content in real-time will have multiple touchpoints for offshoring. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
-
-
-
-
-
-
-
-

Portfolio

-
-
-
-
-

Frontend / HTML / CSS / JavaScript

-

Photo Agency Website

-

Built highly performant website front end for a Photography agency. Delivered codebase in HTML, CSS and modern JavaScript.

-
-
-
-
-
-
-

Graphic Design / Photoshop / Sketch

-

Restaurant Website Design

-

Web design for popular resturant chain involving complex layouts done in both Photoshop and Sketch. Collaborated with back-end and front-end team for finished product.

-
-
-
-
-
-
-
-
-

Frontend / HTML / CSS / JavaScript

-

E-Commerce Website

-

Built highly performant website for an E-commerce Portal. Worked with back-end team to timely deliver codebase in HTML, CSS and modern JavaScript.

-
-
-
-
-
-
-
-

References

-
-
-
-
-
-

Aiyana

-

CEO / Web Design Company

-
-
-
-

Walter displays exemplary professionalism and is able to take on challenges. He learns quickly and is an asset to any team.

-
-
-
-
-
-
-

Alexander

-

Front-end Developer / Web Design Company

-
-
-
-

Walter is a great co-worker and problem solver. He is quick to extend his helping hand and makes a good team player.

-
-
-
-
-
-
-
-

Contact

-
-
-
-
+0718-111-0011
-
walter@company.com
-
-
-
- - -
-
- - -
-
- - -
- -
-
-
-
-
-
-
-
-
- - - - - - \ No newline at end of file +
+
+
+
+
+
+
+
+

About Me

+

Hello! I’m Walter Patterson. I am passionate about UI/UX design and Web Design. I am a skilled front-end developer and master of graphic design tools such as Photoshop and Sketch. I am a quick learner and a team worker that gets the job done.

+

I can easily capitalize on low hanging fruits and quickly maximize timely deliverables for real-time schemas.

+
+
+
+

Bio

+
+
Age
+
+
+
28
+
+
+
Email
+
+
+
walter@company.com
+
+
+
Skype
+
+
+
username@skype.com
+
+
+
Phone
+
+
+
+0718-111-0011
+
+
+
Address
+
+
+
131 W, City Center, New York, U.S.A
+
+
+
+
+
+
+
+
+

Professional Skills

+
+
+
HTML +
+
Master
+
+
+
CSS +
+
Expert
+
+
+
JavaScript +
+
Advance
+
+
+
WordPress +
+
Advance
+
+
+
+
+
Adobe Photoshop +
+
Master
+
+
+
Adobe Illustrator +
+
Expert
+
+
+
Sketch +
+
Expert
+
+
+
Adobe XD +
+
Beginner
+
+
+
+
+
+
+
+
+

Work Experience

+
+
+
+
Frontend Developer at Creative Agency
+
+
+
May, 2015 - Present
+
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
+
+
+
+
+
Graphic Designer at Design Studio
+
+
+
June, 2013 - May, 2015
+
Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
+
+
+
+
+
Junior Web Developer at Indie Studio
+
+
+
Jan, 2011 - May, 2013
+
User generated content in real-time will have multiple touchpoints for offshoring. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
+
+
+
+
+
+
+
+

Education

+
+
+
+
Masters in Information Technology from International University
+
+
+
2011 - 2013
+
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
+
+
+
+
+
Bachelor of Computer Science from Regional College
+
+
+
2007 - 2011
+
Override the digital divide with additional clickthroughs from DevOps. Nanotechnology immersion along the information highway will close the loop on focusing solely on the bottom line.
+
+
+
+
+
Science and Mathematics from Mt. High Scool
+
+
+
1995 - 2007
+
User generated content in real-time will have multiple touchpoints for offshoring. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
+
+
+
+
+
+
+
+

Portfolio

+
+
+
+
+

Frontend / HTML / CSS / JavaScript

+

Photo Agency Website

+

Built highly performant website front end for a Photography agency. Delivered codebase in HTML, CSS and modern JavaScript.

+
+
+
+
+
+
+

Graphic Design / Photoshop / Sketch

+

Restaurant Website Design

+

Web design for popular resturant chain involving complex layouts done in both Photoshop and Sketch. Collaborated with back-end and front-end team for finished product.

+
+
+
+
+
+
+
+
+

Frontend / HTML / CSS / JavaScript

+

E-Commerce Website

+

Built highly performant website for an E-commerce Portal. Worked with back-end team to timely deliver codebase in HTML, CSS and modern JavaScript.

+
+
+
+
+
+
+
+

References

+
+
+
+
+
+

Aiyana

+

CEO / Web Design Company

+
+
+
+

Walter displays exemplary professionalism and is able to take on challenges. He learns quickly and is an asset to any team.

+
+
+
+
+
+
+

Alexander

+

Front-end Developer / Web Design Company

+
+
+
+

Walter is a great co-worker and problem solver. He is quick to extend his helping hand and makes a good team player.

+
+
+
+
+
+
+
+

Contact

+
+
+
+
+0718-111-0011
+
walter@company.com
+
+
+
+ + +
+
+ + +
+
+ + +
+ +
+
+
+
+
+
+
+
+
+{% endblock content %} \ No newline at end of file