tangled
alpha
login
or
join now
ericwood.org
/
photos-site
1
fork
atom
A little app to serve my photography from my personal website
1
fork
atom
overview
issues
pulls
pipelines
lots of misc tweaks
ericwood.org
4 months ago
0b2ff2eb
bd8c773a
0/0
Waiting for spindle ...
+55
-7
6 changed files
expand all
collapse all
unified
split
assets
app.css
photos
index.css
show.css
src
routes
photos
index.rs
templates.rs
templates
layout.jinja
+21
-4
assets/app.css
···
20
20
width: 100%;
21
21
max-width: 3000px;
22
22
overflow: auto;
23
23
-
padding: 0 30px;
24
23
}
25
24
26
25
header {
26
26
+
display: flex;
27
27
+
align-items: center;
28
28
+
gap: 30px;
29
29
+
font-size: 16pt;
27
30
width: 100%;
28
28
-
padding: 30px 0;
31
31
+
border-bottom: solid black 3px;
29
32
}
30
33
31
31
-
h1 {
32
32
-
font-family: "Inter";
34
34
+
header h1 {
33
35
text-transform: uppercase;
34
36
font-weight: 900;
35
37
margin: 0;
36
38
letter-spacing: 3px;
39
39
+
padding: 10px 30px;
40
40
+
border-right: solid black 3px;
41
41
+
}
42
42
+
43
43
+
header nav ul {
44
44
+
display: flex;
45
45
+
gap: 30px;
46
46
+
list-style-type: none;
47
47
+
margin: 0;
48
48
+
padding: 0;
49
49
+
}
50
50
+
51
51
+
header nav ul a {
52
52
+
text-decoration: none;
53
53
+
color: black;
37
54
}
+2
assets/photos/index.css
···
1
1
.photos__layout {
2
2
display: flex;
3
3
gap: 20px;
4
4
+
padding-left: 30px;
5
5
+
padding-top: 30px;
4
6
}
5
7
6
8
.photos__container {
+8
-2
assets/photos/show.css
···
1
1
.photo__container {
2
2
display: flex;
3
3
-
gap: 20px;
3
3
+
gap: 30px;
4
4
width: 100%;
5
5
+
padding: 30px;
5
6
}
6
7
7
8
.photo__image {
···
98
99
}
99
100
}
100
101
101
101
-
@media (max-width: 500px) {
102
102
+
@media (max-width: 600px) {
103
103
+
.photo__container {
104
104
+
padding: 30px 0;
105
105
+
}
106
106
+
102
107
.photo__sidebar {
103
108
width: 100%;
109
109
+
padding: 0 20px;
104
110
}
105
111
}
+1
-1
src/routes/photos/index.rs
···
51
51
fn default() -> Self {
52
52
Self {
53
53
page: Some(1),
54
54
-
limit: Some(10),
54
54
+
limit: Some(30),
55
55
tags: Some(vec![]),
56
56
sort: Some(SortField::TakenAt),
57
57
dir: Some(SortDirection::Desc),
+15
src/templates.rs
···
3
3
use serde::Serialize;
4
4
use std::{env, fs::read_to_string, path::Path};
5
5
6
6
+
#[derive(Serialize)]
7
7
+
struct NavLink<'a> {
8
8
+
id: &'a str,
9
9
+
label: &'a str,
10
10
+
href: &'a str,
11
11
+
}
12
12
+
6
13
pub fn load_templates_dyn() -> AutoReloader {
7
14
AutoReloader::new(move |notifier| {
8
15
let mut env = Environment::new();
···
16
23
notifier.watch_path(template_path, true);
17
24
}
18
25
env.add_function("url_escape", url_escape);
26
26
+
//env.add_global(
27
27
+
// "nav_links",
28
28
+
// [NavLink {
29
29
+
// id: "photos",
30
30
+
// label: "Photos",
31
31
+
// href: "/photos",
32
32
+
// }],
33
33
+
//);
19
34
Ok(env)
20
35
})
21
36
}
+8
templates/layout.jinja
···
16
16
<div class="container">
17
17
<header>
18
18
<h1>Eric Wood</h1>
19
19
+
<nav>
20
20
+
<ul>
21
21
+
<li><a href="/photos">Photos</a></li>
22
22
+
<li><a href="">Music</a></li>
23
23
+
<li><a href="">Blog</a></li>
24
24
+
<li><a href="">Projects</a></li>
25
25
+
</ul>
26
26
+
</nav>
19
27
</header>
20
28
{% block body %}{% endblock %}
21
29
</div>