diff options
author | Adam T. Carpenter <atc@53hor.net> | 2025-05-18 10:44:04 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2025-05-18 10:44:04 -0400 |
commit | 37b6c927620cb68e01345d29daca960faeb80cb9 (patch) | |
tree | b2740d9a88fb238ea6aae44fb73481265b009e1d | |
parent | d6a495165b4f36b8bf3137deac46f7bcfb1d7bf1 (diff) | |
download | carpentertutoring-37b6c927620cb68e01345d29daca960faeb80cb9.tar.xz carpentertutoring-37b6c927620cb68e01345d29daca960faeb80cb9.zip |
chore: rename jinja templates
Also wrap style block so auto formatter doesn't pick it up and wreck
CSS.
-rw-r--r-- | .vscode/launch.json | 3 | ||||
-rw-r--r-- | src/views/about.rs | 2 | ||||
-rw-r--r-- | src/views/brochure.rs | 2 | ||||
-rw-r--r-- | src/views/index.rs | 2 | ||||
-rw-r--r-- | src/views/k12.rs | 2 | ||||
-rw-r--r-- | src/views/policies.rs | 2 | ||||
-rw-r--r-- | src/views/post.rs | 2 | ||||
-rw-r--r-- | src/views/posts.rs | 2 | ||||
-rw-r--r-- | templates/about/blurb.html.j2 (renamed from templates/about/blurb.html) | 0 | ||||
-rw-r--r-- | templates/about/figure.html.j2 (renamed from templates/about/figure.html) | 0 | ||||
-rw-r--r-- | templates/about/index.html.j2 (renamed from templates/about/index.html) | 4 | ||||
-rw-r--r-- | templates/about/team.html | 11 | ||||
-rw-r--r-- | templates/about/team.html.j2 | 11 | ||||
-rw-r--r-- | templates/base.html.j2 (renamed from templates/base.html) | 24 | ||||
-rw-r--r-- | templates/brochure/brochure.html.j2 (renamed from templates/brochure/brochure.html) | 0 | ||||
-rw-r--r-- | templates/brochure/index.html.j2 (renamed from templates/brochure/index.html) | 4 | ||||
-rw-r--r-- | templates/card.html.j2 (renamed from templates/card.html) | 0 | ||||
-rw-r--r-- | templates/contact-buttons.html.j2 (renamed from templates/contact-buttons.html) | 0 | ||||
-rw-r--r-- | templates/index.html.j2 (renamed from templates/index.html) | 2 | ||||
-rw-r--r-- | templates/k12.html.j2 (renamed from templates/k12.html) | 2 | ||||
-rw-r--r-- | templates/policies.html.j2 (renamed from templates/policies.html) | 2 | ||||
-rw-r--r-- | templates/post.html.j2 (renamed from templates/post.html) | 2 | ||||
-rw-r--r-- | templates/posts.html.j2 (renamed from templates/posts.html) | 2 | ||||
-rw-r--r-- | templates/stylewrap.html.j2 | 5 |
24 files changed, 45 insertions, 41 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index d2d9ffe..9149f75 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -17,7 +17,8 @@ } }, "args": [], - "cwd": "${workspaceFolder}" + "cwd": "${workspaceFolder}", + "preLaunchTask": "rust: cargo build" }, { "type": "lldb", diff --git a/src/views/about.rs b/src/views/about.rs index 349c9de..d2e0958 100644 --- a/src/views/about.rs +++ b/src/views/about.rs @@ -3,7 +3,7 @@ use crate::tutors::abstractions::tutor::Tutor; use askama::Template; #[derive(Template)] -#[template(path = "about/index.html")] +#[template(path = "about/index.html.j2")] pub struct AboutView<T: Tutor> { tutors: Vec<T>, } diff --git a/src/views/brochure.rs b/src/views/brochure.rs index 0d2f8fc..fedf827 100644 --- a/src/views/brochure.rs +++ b/src/views/brochure.rs @@ -2,5 +2,5 @@ use crate::helpers::*; use askama::Template; #[derive(Template)] -#[template(path = "brochure/index.html")] +#[template(path = "brochure/index.html.j2")] pub struct BrochureTemplate; diff --git a/src/views/index.rs b/src/views/index.rs index 3ced24d..720749a 100644 --- a/src/views/index.rs +++ b/src/views/index.rs @@ -2,5 +2,5 @@ use crate::helpers::*; use askama::Template; #[derive(Template)] -#[template(path = "index.html")] +#[template(path = "index.html.j2")] pub struct IndexTemplate; diff --git a/src/views/k12.rs b/src/views/k12.rs index eb9725f..c7dc019 100644 --- a/src/views/k12.rs +++ b/src/views/k12.rs @@ -2,5 +2,5 @@ use crate::helpers::*; use askama::Template; #[derive(Template)] -#[template(path = "k12.html")] +#[template(path = "k12.html.j2")] pub struct K12Template; diff --git a/src/views/policies.rs b/src/views/policies.rs index 3d9787d..4253e6c 100644 --- a/src/views/policies.rs +++ b/src/views/policies.rs @@ -2,5 +2,5 @@ use crate::helpers::*; use askama::Template; #[derive(Template)] -#[template(path = "policies.html")] +#[template(path = "policies.html.j2")] pub struct PoliciesTemplate; diff --git a/src/views/post.rs b/src/views/post.rs index 4f0554b..03e5ef2 100644 --- a/src/views/post.rs +++ b/src/views/post.rs @@ -3,7 +3,7 @@ use crate::posts::abstractions::post::Post; use askama::Template; #[derive(Template)] -#[template(path = "post.html")] +#[template(path = "post.html.j2")] pub struct PostView<P: Post> { post: P, } diff --git a/src/views/posts.rs b/src/views/posts.rs index 82b5996..5091059 100644 --- a/src/views/posts.rs +++ b/src/views/posts.rs @@ -3,7 +3,7 @@ use crate::posts::abstractions::post::Post; use askama::Template; #[derive(Template)] -#[template(path = "posts.html")] +#[template(path = "posts.html.j2")] pub struct PostsView<P: Post> { posts: Vec<P>, } diff --git a/templates/about/blurb.html b/templates/about/blurb.html.j2 index 4389d47..4389d47 100644 --- a/templates/about/blurb.html +++ b/templates/about/blurb.html.j2 diff --git a/templates/about/figure.html b/templates/about/figure.html.j2 index 168aa4e..168aa4e 100644 --- a/templates/about/figure.html +++ b/templates/about/figure.html.j2 diff --git a/templates/about/index.html b/templates/about/index.html.j2 index fcbc286..71891ee 100644 --- a/templates/about/index.html +++ b/templates/about/index.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block main %} <section class="banner"> @@ -64,6 +64,6 @@ </section> -{% include "team.html" %} +{% include "team.html.j2" %} {% endblock %}
\ No newline at end of file diff --git a/templates/about/team.html b/templates/about/team.html deleted file mode 100644 index c2b4498..0000000 --- a/templates/about/team.html +++ /dev/null @@ -1,11 +0,0 @@ -{% for tutor in tutors %} -<sectionclass=" flexible"> - {% if loop.index0 % 2 == 0 %} - {% include "blurb.html" %} - {% include "figure.html" %} - {% else %} - {% include "figure.html" %} - {% include "blurb.html" %} - {% endif %} - </section> - {% endfor %}
\ No newline at end of file diff --git a/templates/about/team.html.j2 b/templates/about/team.html.j2 new file mode 100644 index 0000000..05bb2f8 --- /dev/null +++ b/templates/about/team.html.j2 @@ -0,0 +1,11 @@ +{% for tutor in tutors %} +<sectionclass=" flexible"> + {% if loop.index0 % 2 == 0 %} + {% include "blurb.html.j2" %} + {% include "figure.html.j2" %} + {% else %} + {% include "figure.html.j2" %} + {% include "blurb.html.j2" %} + {% endif %} + </section> + {% endfor %}
\ No newline at end of file diff --git a/templates/base.html b/templates/base.html.j2 index 49d8c40..ad99896 100644 --- a/templates/base.html +++ b/templates/base.html.j2 @@ -7,11 +7,7 @@ Tutoring Excellence Online and in Suffolk, VA - Carpenter Tutoring, LLC {% endblock %} </title> - <style> - {% block style %} - {% include "styles.css" %} - {% endblock %} - </style> + {% include "stylewrap.html.j2" %} <link rel="preconnect" href="https://fonts.gstatic.com" /> <link rel="stylesheet" href="/desktop.css" /> <link rel="stylesheet" href="/widescreen.css" /> @@ -33,11 +29,11 @@ <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-RZLJ3ZBKZL"></script> <script> - window.dataLayer = window.dataLayer || []; - function gtag(){dataLayer.push(arguments);} - gtag('js', new Date()); + window.dataLayer = window.dataLayer || []; + function gtag() { dataLayer.push(arguments); } + gtag('js', new Date()); - gtag('config', 'G-RZLJ3ZBKZL'); + gtag('config', 'G-RZLJ3ZBKZL'); </script> @@ -71,11 +67,11 @@ </figure> <div id="contact" class="buttons centered"> - {% include "contact-buttons.html" %} + {% include "contact-buttons.html.j2" %} </div> <p> - © 2019-{{ self::current_year() }} Carpenter Tutoring, LLC. All rights reserved. + © 2019-{{ self::current_year() }} Carpenter Tutoring, LLC. All rights reserved. </p> <p> <a href="https://g.page/carpenter-tutoring?share">Visit me on Google</a> @@ -89,7 +85,9 @@ </footer> <script src="/nav.js"></script> - <link href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Indie+Flower&family=PT+Sans&display=swap" rel="stylesheet" /> + <link + href="https://fonts.googleapis.com/css2?family=Architects+Daughter&family=Indie+Flower&family=PT+Sans&display=swap" + rel="stylesheet" /> </body> -</html> +</html>
\ No newline at end of file diff --git a/templates/brochure/brochure.html b/templates/brochure/brochure.html.j2 index b5a3cd3..b5a3cd3 100644 --- a/templates/brochure/brochure.html +++ b/templates/brochure/brochure.html.j2 diff --git a/templates/brochure/index.html b/templates/brochure/index.html.j2 index 6304887..547f9d7 100644 --- a/templates/brochure/index.html +++ b/templates/brochure/index.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block style %} {% include "../styles.css" %} @@ -21,7 +21,7 @@ desktop screen. </p> - {% include "brochure.html" %} + {% include "brochure.html.j2" %} </section> diff --git a/templates/card.html b/templates/card.html.j2 index 1397bc8..1397bc8 100644 --- a/templates/card.html +++ b/templates/card.html.j2 diff --git a/templates/contact-buttons.html b/templates/contact-buttons.html.j2 index bae7460..bae7460 100644 --- a/templates/contact-buttons.html +++ b/templates/contact-buttons.html.j2 diff --git a/templates/index.html b/templates/index.html.j2 index b5f4bd6..24c9369 100644 --- a/templates/index.html +++ b/templates/index.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block main %} <!--banner--> diff --git a/templates/k12.html b/templates/k12.html.j2 index 6467d55..bfa9527 100644 --- a/templates/k12.html +++ b/templates/k12.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block main %} diff --git a/templates/policies.html b/templates/policies.html.j2 index 6a5754a..5580ce9 100644 --- a/templates/policies.html +++ b/templates/policies.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block main %} diff --git a/templates/post.html b/templates/post.html.j2 index 9eb3444..e1c447a 100644 --- a/templates/post.html +++ b/templates/post.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block title %} {{ post.get_title() }} - Carpenter Tutoring, LLC diff --git a/templates/posts.html b/templates/posts.html.j2 index 2f1df6b..e9efdfb 100644 --- a/templates/posts.html +++ b/templates/posts.html.j2 @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "base.html.j2" %} {% block main %} <section class="banner"> diff --git a/templates/stylewrap.html.j2 b/templates/stylewrap.html.j2 new file mode 100644 index 0000000..a68f592 --- /dev/null +++ b/templates/stylewrap.html.j2 @@ -0,0 +1,5 @@ +<style> + {% block style %} + {% include "styles.css" %} + {% endblock %} +</style>
\ No newline at end of file |