forge
Explore
Log in

Don't you dare go Hollow

🎨 frosty blue hour redesign

Browse files at this commit

4de8815161c4ca37b96eefdda78526c558ed4169Ahmet Kaan GümüşParent: 5d4b0e7
All checks have passed
Show checks
  • feat
    • 🎨 frosty blue hour redesign
Show full message
feat: 🎨 frosty blue hour redesign
assets/fonts/archivo-latin-ext-wdth.woff2deleted+0 -0

Binary file changed

assets/fonts/archivo-latin-wdth.woff2deleted+0 -0

Binary file changed

assets/main.cssmodified+88 -312
@@ -1,21 +1,3 @@
1-@font-face {
2- font-family: "Archivo";
3- src: url("/fonts/archivo-latin-wdth.woff2") format("woff2");
4- font-weight: 100 900;
5- font-stretch: 62% 125%;
6- font-display: swap;
7- unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
8-}
9-
10-@font-face {
11- font-family: "Archivo";
12- src: url("/fonts/archivo-latin-ext-wdth.woff2") format("woff2");
13- font-weight: 100 900;
14- font-stretch: 62% 125%;
15- font-display: swap;
16- unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
17-}
18-
19 @font-face {1 @font-face {
20 font-family: "Inter";2 font-family: "Inter";
21 src: url("/fonts/inter-latin-wght.woff2") format("woff2");3 src: url("/fonts/inter-latin-wght.woff2") format("woff2");
@@ -49,17 +31,14 @@
49 }31 }
50 32
51 :root {33 :root {
52- --bg: #F5F5F4;34+ --bg: #070b14;
53- --text: #18181B;35+ --text: #e2e2e7;
54- --body: #3F3F46;36+ --muted: #8c919a;
55- --muted: #63636B;37+ --line: rgba(164, 200, 255, 0.09);
56- --line: #E4E4E7;38+ --accent: #a4c8ff;
57- --strong: #D4D4D8;39+ --warm: #ffce9c;
58- --accent: #C2410C;40+ --gutter: 48px;
59- --spark: #FF6A13;
60- --gutter: 40px;
61 --font-sans: "Inter", system-ui, sans-serif;41 --font-sans: "Inter", system-ui, sans-serif;
62- --font-display: "Archivo", sans-serif;
63 --font-mono: "JetBrains Mono", monospace;42 --font-mono: "JetBrains Mono", monospace;
64 }43 }
65 44
@@ -67,16 +46,31 @@
67 box-sizing: border-box;46 box-sizing: border-box;
68 }47 }
69 48
49+html {
50+ background: var(--bg);
51+}
52+
70 body {53 body {
71 margin: 0;54 margin: 0;
72- background: var(--bg);55+ min-height: 100vh;
56+ padding: 72px 20px;
73 color: var(--text);57 color: var(--text);
74 font-family: var(--font-sans);58 font-family: var(--font-sans);
59+ line-height: 1.6;
60+ background:
61+ radial-gradient(4px 4px at 12% 10%, #ffd28a, transparent),
62+ radial-gradient(260px 180px at 12% 10%, rgba(255, 196, 110, 0.13), transparent),
63+ radial-gradient(3px 3px at 90% 18%, #ffd28a, transparent),
64+ radial-gradient(180px 130px at 90% 18%, rgba(255, 196, 110, 0.09), transparent),
65+ radial-gradient(120% 45% at 50% 105%, rgba(120, 160, 220, 0.28), transparent 70%),
66+ linear-gradient(#070b14, #0c1526 55%, #13213a);
67+ background-attachment: fixed;
75 }68 }
76 69
77 a {70 a {
78 color: inherit;71 color: inherit;
79 text-decoration: none;72 text-decoration: none;
73+ transition: color 0.15s;
80 }74 }
81 75
82 a:hover {76 a:hover {
@@ -87,62 +81,33 @@ h1, h2, p {
87 margin: 0;81 margin: 0;
88 }82 }
89 83
90-.wrap {84+.glass {
91- max-width: 1120px;85+ max-width: 720px;
92 margin: 0 auto;86 margin: 0 auto;
93- padding: 0 var(--gutter);87+ padding: 36px var(--gutter) 40px;
94-}88+ border-radius: 24px;
95-89+ background: rgba(17, 19, 23, 0.5);
96-.stack {90+ backdrop-filter: blur(24px) saturate(1.2);
97- display: flex;91+ border: 1px solid rgba(164, 200, 255, 0.13);
98- flex-direction: column;92+ box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
99- gap: 28px;
100-}
101-
102-.arrow {
103- color: var(--muted);
104-}
105-
106-.index,
107-.more,
108-.eyebrow,
109-.back,
110-.meta,
111-.post-date,
112-.project-index,
113-.project-row-summary,
114-.footer-inner,
115-.nav {
116- font-family: var(--font-mono);
117- font-size: 13px;
118 }93 }
119 94
120 .site-header {95 .site-header {
121- border-bottom: 1px solid var(--line);
122- padding: 0 var(--gutter);
123-}
124-
125-.header-inner {
126- min-height: 64px;
127 display: flex;96 display: flex;
128- align-items: center;
129 justify-content: space-between;97 justify-content: space-between;
98+ align-items: center;
130 gap: 16px;99 gap: 16px;
131 flex-wrap: wrap;100 flex-wrap: wrap;
132 }101 }
133 102
134 .wordmark {103 .wordmark {
135- font-family: var(--font-display);104+ font-weight: 500;
136- font-stretch: 112%;105+ color: var(--warm);
137- font-weight: 700;
138- font-size: 18px;
139- letter-spacing: -0.02em;
140 }106 }
141 107
142 .nav {108 .nav {
143 display: flex;109 display: flex;
144- gap: 28px;110+ gap: 22px;
145- flex-wrap: wrap;
146 color: var(--muted);111 color: var(--muted);
147 }112 }
148 113
@@ -150,311 +115,122 @@ h1, h2, p {
150 color: var(--text);115 color: var(--text);
151 }116 }
152 117
153-.hero {118+main {
154- padding: 128px 0;119+ padding: 80px 0 64px;
155- border-bottom: 1px solid var(--line);
156-}
157-
158-.eyebrow {
159- display: flex;
160- align-items: center;
161- gap: 10px;
162- color: var(--accent);
163-}
164-
165-.spark {
166- width: 8px;
167- height: 8px;
168- border-radius: 50%;
169- background: var(--spark);
170- box-shadow: 0 0 10px var(--spark);
171-}
172-
173-.hero h1,
174-.page-title {
175- font-family: var(--font-display);
176- font-stretch: 125%;
177- font-weight: 700;
178- letter-spacing: -0.04em;
179- line-height: 0.95;
180-}
181-
182-.hero h1 {
183- font-size: clamp(48px, 9vw, 104px);
184- line-height: 0.92;
185-}
186-
187-.page-title {
188- font-size: clamp(48px, 9vw, 80px);
189-}
190-
191-.lead {
192- font-size: 19px;
193- line-height: 1.6;
194- color: var(--body);
195- max-width: 540px;
196-}
197-
198-.buttons {
199- display: flex;
200- gap: 12px;
201- flex-wrap: wrap;
202- margin-top: 8px;
203-}
204-
205-.button {
206- border: 1px solid var(--strong);
207- border-radius: 6px;
208- padding: 12px 20px;
209- font-size: 15px;
210- font-weight: 500;
211-}
212-
213-.button.primary {
214- background: var(--text);
215- border-color: var(--text);
216- color: var(--bg);
217- font-weight: 600;
218- padding: 13px 20px;
219-}
220-
221-.button.primary:hover {
222- background: var(--accent);
223- border-color: var(--accent);
224- color: var(--bg);
225-}
226-
227-.section {
228- padding: 88px 0;
229- border-top: 1px solid var(--line);
230-}
231-
232-.section-head {
233- display: flex;
234- align-items: baseline;
235- gap: 16px;
236-}
237-
238-.index {
239- color: var(--accent);
240-}
241-
242-.section-head h2 {
243- font-family: var(--font-display);
244- font-stretch: 112%;
245- font-size: clamp(28px, 4vw, 36px);
246- font-weight: 600;
247- letter-spacing: -0.02em;
248-}
249-
250-.rule {
251- flex: 1;
252- height: 1px;
253- background: var(--line);
254-}
255-
256-.more {
257- color: var(--muted);
258-}
259-
260-.post-list {
261- display: flex;
262- flex-direction: column;
263-}
264-
265-.post-row {
266- display: grid;
267- grid-template-columns: 100px minmax(0, 1fr) 24px;
268- gap: 16px;
269- align-items: center;
270- padding: 20px 0;
271- border-bottom: 1px solid var(--line);
272 }120 }
273 121
274-.post-date {122+.hero {
275- color: var(--muted);123+ margin-bottom: 64px;
276 }124 }
277 125
278-.post-title {126+h1 {
279- font-size: 20px;127+ font-size: 30px;
280 font-weight: 500;128 font-weight: 500;
129+ letter-spacing: -0.01em;
130+ line-height: 1.25;
281 }131 }
282 132
283-.post-kind {133+.lead {
134+ margin-top: 12px;
284 color: var(--muted);135 color: var(--muted);
285- font-weight: 400;
286 }136 }
287 137
288-.project-grid {138+.about {
289- display: grid;139+ margin-top: 24px;
290- grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));140+ line-height: 1.7;
291- border-top: 1px solid var(--line);
292- border-left: 1px solid var(--line);
293 }141 }
294 142
295-.project-cell {143+.about p + p {
296- display: flex;144+ margin-top: 12px;
297- flex-direction: column;
298- justify-content: space-between;
299- gap: 16px;
300- min-height: 140px;
301- padding: 22px;
302- border-right: 1px solid var(--line);
303- border-bottom: 1px solid var(--line);
304 }145 }
305 146
306-.project-cell:hover .project-name {147+.section + .section {
307- color: var(--accent);148+ margin-top: 56px;
308 }149 }
309 150
310-.project-index {151+h2.label {
311- color: var(--muted);152+ margin-bottom: 12px;
312 font-size: 12px;153 font-size: 12px;
313-}154+ font-weight: 400;
314-155+ letter-spacing: 0.12em;
315-.project-text {156+ text-transform: uppercase;
316- display: flex;
317- flex-direction: column;
318- gap: 4px;
319-}
320-
321-.project-name {
322- font-size: 18px;
323- font-weight: 600;
324-}
325-
326-.project-summary {
327- font-size: 14px;
328 color: var(--muted);157 color: var(--muted);
329 }158 }
330 159
331-.quote {160+.row {
332- padding: 96px 0;
333- border-top: 1px solid var(--line);
334-}
335-
336-.quote-mark {
337- font-family: var(--font-display);
338- font-size: 96px;
339- font-weight: 800;
340- line-height: 0.6;
341- height: 48px;
342- color: var(--spark);
343-}
344-
345-.quote-text {
346- font-family: var(--font-display);
347- font-size: clamp(28px, 4vw, 40px);
348- font-weight: 500;
349- letter-spacing: -0.02em;
350- line-height: 1.2;
351- max-width: 860px;
352-}
353-
354-.page {
355- padding: 96px 0;
356-}
357-
358-.project-table {
359- overflow-x: auto;
360- border-top: 1px solid var(--text);
361-}
362-
363-.project-row {
364 display: grid;161 display: grid;
365- grid-template-columns: 56px minmax(200px, 1fr) minmax(220px, 1.4fr) 24px;162+ grid-template-columns: 176px minmax(0, 1fr);
366 gap: 16px;163 gap: 16px;
367 align-items: baseline;164 align-items: baseline;
368- min-width: 600px;165+ padding: 10px 0;
369- padding: 22px 0;166+ border-top: 1px solid var(--line);
370- border-bottom: 1px solid var(--line);
371 }167 }
372 168
373-.project-row-name {169+.row-key,
374- font-family: var(--font-display);170+.meta,
375- font-stretch: 112%;171+.back,
376- font-size: 24px;172+.more,
377- font-weight: 600;173+.site-footer {
378- letter-spacing: -0.02em;174+ font-family: var(--font-mono);
175+ font-size: 12px;
176+ color: var(--muted);
379 }177 }
380 178
381-.project-row-summary {179+.row-sub {
382- color: var(--body);180+ color: var(--muted);
383- font-size: 16px;
384- font-family: var(--font-sans);
385 }181 }
386 182
387 .article {183 .article {
388 display: flex;184 display: flex;
389 flex-direction: column;185 flex-direction: column;
390- gap: 40px;186+ gap: 28px;
391- max-width: 680px;
392- margin-inline: auto;
393- padding-inline: var(--gutter);
394- box-sizing: content-box;
395-}
396-
397-.back {
398- color: var(--accent);
399-}
400-
401-.meta {
402- color: var(--muted);
403 }187 }
404 188
405 .blocks {189 .blocks {
406 display: flex;190 display: flex;
407 flex-direction: column;191 flex-direction: column;
408- gap: 28px;192+ gap: 22px;
409- font-size: 19px;193+ font-size: 17px;
410 line-height: 1.8;194 line-height: 1.8;
411- color: var(--body);195+ color: #c2c6d1;
412 }196 }
413 197
414 .blocks h2 {198 .blocks h2 {
415- font-family: var(--font-display);199+ font-size: 20px;
416- font-stretch: 112%;200+ font-weight: 500;
417- font-size: 28px;
418- font-weight: 600;
419 color: var(--text);201 color: var(--text);
420 }202 }
421 203
422 .site-footer {204 .site-footer {
423- padding: 32px var(--gutter);
424- border-top: 1px solid var(--line);
425-}
426-
427-.footer-inner {
428 display: flex;205 display: flex;
429 justify-content: space-between;206 justify-content: space-between;
430 gap: 16px;207 gap: 16px;
431 flex-wrap: wrap;208 flex-wrap: wrap;
432- color: var(--muted);209+ padding-top: 20px;
210+ border-top: 1px solid var(--line);
433 }211 }
434 212
435 .footer-links {213 .footer-links {
436 display: flex;214 display: flex;
437- gap: 24px;215+ gap: 20px;
438 }216 }
439 217
440 @media (max-width: 640px) {218 @media (max-width: 640px) {
441 :root {219 :root {
442- --gutter: 20px;220+ --gutter: 22px;
443 }221 }
444 222
445- .hero {223+ body {
446- padding: 80px 0;224+ padding: 16px 10px;
447 }225 }
448 226
449- .section,227+ main {
450- .quote,228+ padding: 56px 0 48px;
451- .page {
452- padding-top: 56px;
453- padding-bottom: 56px;
454 }229 }
455 230
456- .post-row {231+ .row {
457- grid-template-columns: 84px minmax(0, 1fr) 20px;232+ grid-template-columns: 1fr;
233+ gap: 2px;
458 }234 }
459 }235 }
460 236
src/app.rsmodified+31 -83
@@ -10,7 +10,7 @@ use topcoat::{
10 view::{View, component, view},10 view::{View, component, view},
11 };11 };
12 12
13-use crate::content::{Block, posts::Post, projects::Project};13+use crate::content::{posts::Post, projects::Project};
14 14
15 pub struct Title(pub fn(&Cx) -> String);15 pub struct Title(pub fn(&Cx) -> String);
16 16
@@ -27,14 +27,12 @@ async fn site_header(cx: &Cx) -> Result<impl View> {
27 27
28 Ok(view! {28 Ok(view! {
29 <header class="site-header">29 <header class="site-header">
30- <div class="wrap header-inner">30+ <a class="wordmark" href=(href!(home))>"tahinli"</a>
31- <a class="wordmark" href=(href!(home))>"tahinli"</a>31+ <nav class="nav" aria-label="Main">
32- <nav class="nav" aria-label="Main">32+ <a href=(posts) aria-current=(posts_current.then_some("page"))>"posts"</a>
33- <a href=(posts) aria-current=(posts_current.then_some("page"))>"posts"</a>33+ <a href=(projects) aria-current=(projects_current.then_some("page"))>"projects"</a>
34- <a href=(projects) aria-current=(projects_current.then_some("page"))>"projects"</a>34+ <a href="https://git.tahinli.com/Tahinli">"forge"</a>
35- <a href="https://git.tahinli.com/Tahinli">"forge ↗"</a>35+ </nav>
36- </nav>
37- </div>
38 </header>36 </header>
39 })37 })
40 }38 }
@@ -43,29 +41,15 @@ async fn site_header(cx: &Cx) -> Result<impl View> {
43 async fn site_footer(cx: &Cx) -> Result<impl View> {41 async fn site_footer(cx: &Cx) -> Result<impl View> {
44 Ok(view! {42 Ok(view! {
45 <footer class="site-footer">43 <footer class="site-footer">
46- <div class="wrap footer-inner">44+ <span>"Don't you dare go Hollow"</span>
47- <span>"Don't you dare go Hollow"</span>45+ <span class="footer-links">
48- <span class="footer-links">46+ <a href="https://github.com/Tahinli">"github"</a>
49- <a href="https://git.tahinli.com/Tahinli">"forge"</a>47+ <a href="https://linkedin.com/in/ahmetkaangumus">"linkedin"</a>
50- <a href="https://github.com/Tahinli">"github"</a>48+ </span>
51- <a href="https://linkedin.com/in/ahmetkaangumus">"linkedin"</a>
52- </span>
53- </div>
54 </footer>49 </footer>
55 })50 })
56 }51 }
57 52
58-fn awaken_first_line() -> &'static str {
59- Post::Awaken
60- .body()
61- .iter()
62- .find_map(|block| match block {
63- Block::Lines(lines) => lines.first().copied(),
64- _ => None,
65- })
66- .unwrap_or_default()
67-}
68-
69 #[layout(with(Title(|_| "Ahmet Kaan Gümüş".to_owned())))]53 #[layout(with(Title(|_| "Ahmet Kaan Gümüş".to_owned())))]
70 async fn root_layout(cx: &Cx, slot: Slot<'_>) -> Result<impl View> {54 async fn root_layout(cx: &Cx, slot: Slot<'_>) -> Result<impl View> {
71 let Title(render) = context::<Title>(cx);55 let Title(render) = context::<Title>(cx);
@@ -83,9 +67,11 @@ async fn root_layout(cx: &Cx, slot: Slot<'_>) -> Result<impl View> {
83 <link rel="icon" href="/favicon.ico" type="image/x-icon">67 <link rel="icon" href="/favicon.ico" type="image/x-icon">
84 </head>68 </head>
85 <body>69 <body>
86- site_header()70+ <div class="glass">
87- <main>(slot)</main>71+ site_header()
88- site_footer()72+ <main>(slot)</main>
73+ site_footer()
74+ </div>
89 </body>75 </body>
90 </html>76 </html>
91 })77 })
@@ -93,67 +79,29 @@ async fn root_layout(cx: &Cx, slot: Slot<'_>) -> Result<impl View> {
93 79
94 #[page]80 #[page]
95 async fn home(cx: &Cx) -> Result<impl View> {81 async fn home(cx: &Cx) -> Result<impl View> {
96- let latest = Post::ALL[0];
97- let latest_label = format!("Latest {} →", latest.kind().label());
98- let quote = Post::Awaken;
99-
100 Ok(view! {82 Ok(view! {
101 <section class="hero">83 <section class="hero">
102- <div class="wrap stack">84+ <h1>"Ahmet Kaan Gümüş"</h1>
103- <span class="eyebrow"><span class="spark"></span>"software engineer · rust"</span>85+ <p class="lead">"Computer Scientist."</p>
104- <h1>"Ahmet Kaan" <br> "Gümüş"</h1>86+ <div class="about">
105- <p class="lead">"I write Rust, poems and open letters. Software that stands the test of time."</p>87+ <p>"I’m Ahmet Kaan. I’m Turkish and was born in 2001. I graduated with a degree in Computer Engineering from Erciyes University. I’m keen on understanding computers as deeply as possible and I love the open‑source philosophy and the KISS principle."</p>
106- <div class="buttons">88+ <p>"My passion is to create software that can stand the test of time. Developers should write versatile, bug‑free programs. It’s impossible to ignore the impact of software. Today’s world is led by it and will continue to be. As developers, we must consider as many possibilities as we can in order to build robust and secure applications."</p>
107- <a class="button primary" href=(posts::detail_url(cx, latest))>(latest_label)</a>89+ <p>"I hope to create free and open‑source software that is widely used, allowing people to benefit from it without having to worry about privacy or the reliability of the program."</p>
108- <a class="button" href=(href!(projects::index))>"Projects"</a>
109- </div>
110 </div>90 </div>
111 </section>91 </section>
112 92
113 <section class="section">93 <section class="section">
114- <div class="wrap stack">94+ <h2 class="label">"Writing"</h2>
115- <div class="section-head">95+ for post in Post::ALL {
116- <span class="index">"01"</span>96+ posts::post_row(post: post)
117- <h2>"Posts"</h2>97+ }
118- <span class="rule"></span>
119- <a class="more" href=(href!(posts::index))>"all →"</a>
120- </div>
121- <div class="post-list">
122- for post in Post::ALL {
123- posts::post_row(post: post)
124- }
125- </div>
126- </div>
127 </section>98 </section>
128 99
129 <section class="section">100 <section class="section">
130- <div class="wrap stack">101+ <h2 class="label">"Projects"</h2>
131- <div class="section-head">102+ for project in Project::ALL {
132- <span class="index">"02"</span>103+ projects::project_row(project: project)
133- <h2>"Projects"</h2>104+ }
134- <span class="rule"></span>
135- <a class="more" href=(href!(projects::index))>"all →"</a>
136- </div>
137- <div class="project-grid">
138- for (i, project) in Project::ALL.into_iter().take(8).enumerate() {
139- <a class="project-cell" href=(projects::detail_url(cx, project))>
140- <span class="project-index">(format!("{:02}", i + 1))</span>
141- <span class="project-text">
142- <span class="project-name">(project.name())</span>
143- <span class="project-summary">(project.summary())</span>
144- </span>
145- </a>
146- }
147- </div>
148- </div>
149- </section>
150-
151- <section class="quote">
152- <div class="wrap stack">
153- <span class="quote-mark" aria-hidden="true">"“"</span>
154- <p class="quote-text">(awaken_first_line())</p>
155- <a class="more" href=(posts::detail_url(cx, quote))>"— " (quote.title())</a>
156- </div>
157 </section>105 </section>
158 })106 })
159 }107 }
src/app/assets.rsmodified+0 -2
@@ -29,8 +29,6 @@ pub async fn nav(cx: &Cx) -> Result<http::Response<Body>> {
29 #[route(GET "/fonts/{file}")]29 #[route(GET "/fonts/{file}")]
30 pub async fn font(cx: &Cx) -> Result<http::Response<Body>> {30 pub async fn font(cx: &Cx) -> Result<http::Response<Body>> {
31 let bytes: &'static [u8] = match file(cx) {31 let bytes: &'static [u8] = match file(cx) {
32- "archivo-latin-wdth.woff2" => include_bytes!("../../assets/fonts/archivo-latin-wdth.woff2"),
33- "archivo-latin-ext-wdth.woff2" => include_bytes!("../../assets/fonts/archivo-latin-ext-wdth.woff2"),
34 "inter-latin-wght.woff2" => include_bytes!("../../assets/fonts/inter-latin-wght.woff2"),32 "inter-latin-wght.woff2" => include_bytes!("../../assets/fonts/inter-latin-wght.woff2"),
35 "inter-latin-ext-wght.woff2" => include_bytes!("../../assets/fonts/inter-latin-ext-wght.woff2"),33 "inter-latin-ext-wght.woff2" => include_bytes!("../../assets/fonts/inter-latin-ext-wght.woff2"),
36 "jetbrains-mono-latin-wght.woff2" => include_bytes!("../../assets/fonts/jetbrains-mono-latin-wght.woff2"),34 "jetbrains-mono-latin-wght.woff2" => include_bytes!("../../assets/fonts/jetbrains-mono-latin-wght.woff2"),
src/app/posts.rsmodified+7 -17
@@ -16,13 +16,9 @@ pub fn detail_url(cx: &Cx, post: Post) -> String {
16 #[component]16 #[component]
17 pub async fn post_row(cx: &Cx, post: Post) -> Result<impl View> {17 pub async fn post_row(cx: &Cx, post: Post) -> Result<impl View> {
18 Ok(view! {18 Ok(view! {
19- <a class="post-row" href=(detail_url(cx, post))>19+ <a class="row" href=(detail_url(cx, post))>
20- <span class="post-date">(post.date().unwrap_or("undated"))</span>20+ <span class="row-key">(post.date().unwrap_or(post.kind().label()))</span>
21- <span class="post-title">21+ <span>(post.title())</span>
22- (post.title())
23- <span class="post-kind">" · " (post.kind().label())</span>
24- </span>
25- <span class="arrow">"→"</span>
26 </a>22 </a>
27 })23 })
28 }24 }
@@ -30,15 +26,9 @@ pub async fn post_row(cx: &Cx, post: Post) -> Result<impl View> {
30 #[page(with(Title(|_| "Posts · tahinli".to_owned())))]26 #[page(with(Title(|_| "Posts · tahinli".to_owned())))]
31 pub async fn index(cx: &Cx) -> Result<impl View> {27 pub async fn index(cx: &Cx) -> Result<impl View> {
32 Ok(view! {28 Ok(view! {
33- <section class="page">29+ <h2 class="label">"Writing"</h2>
34- <div class="wrap stack">30+ for post in Post::ALL {
35- <h1 class="page-title">"Posts"</h1>31+ post_row(post: post)
36- <div class="post-list">32+ }
37- for post in Post::ALL {
38- post_row(post: post)
39- }
40- </div>
41- </div>
42- </section>
43 })33 })
44 }34 }
src/app/posts/slug.rsmodified+2 -2
@@ -28,9 +28,9 @@ pub async fn detail(cx: &Cx) -> Result<impl View> {
28 };28 };
29 29
30 Ok(view! {30 Ok(view! {
31- <article class="page article">31+ <article class="article">
32 <a class="back" href=(href!(super::index))>"← posts"</a>32 <a class="back" href=(href!(super::index))>"← posts"</a>
33- <h1 class="page-title">(post.title())</h1>33+ <h1>(post.title())</h1>
34 <span class="meta">(meta)</span>34 <span class="meta">(meta)</span>
35 blocks(items: post.body())35 blocks(items: post.body())
36 </article>36 </article>
src/app/projects.rsmodified+15 -16
@@ -4,7 +4,7 @@ use topcoat::{
4 Result,4 Result,
5 context::Cx,5 context::Cx,
6 router::{href, page},6 router::{href, page},
7- view::{View, view},7+ view::{View, component, view},
8 };8 };
9 9
10 use crate::{app::Title, content::projects::Project};10 use crate::{app::Title, content::projects::Project};
@@ -13,23 +13,22 @@ pub fn detail_url(cx: &Cx, project: Project) -> String {
13 href!(slug::detail, slug: project.slug()).resolve(cx)13 href!(slug::detail, slug: project.slug()).resolve(cx)
14 }14 }
15 15
16+#[component]
17+pub async fn project_row(cx: &Cx, project: Project) -> Result<impl View> {
18+ Ok(view! {
19+ <a class="row" href=(detail_url(cx, project))>
20+ <span class="row-key">(project.slug())</span>
21+ <span>(project.name()) <span class="row-sub">" · " (project.summary())</span></span>
22+ </a>
23+ })
24+}
25+
16 #[page(with(Title(|_| "Projects · tahinli".to_owned())))]26 #[page(with(Title(|_| "Projects · tahinli".to_owned())))]
17 pub async fn index(cx: &Cx) -> Result<impl View> {27 pub async fn index(cx: &Cx) -> Result<impl View> {
18 Ok(view! {28 Ok(view! {
19- <section class="page">29+ <h2 class="label">"Projects"</h2>
20- <div class="wrap stack">30+ for project in Project::ALL {
21- <h1 class="page-title">"Projects"</h1>31+ project_row(project: project)
22- <div class="project-table">32+ }
23- for (i, project) in Project::ALL.into_iter().enumerate() {
24- <a class="project-row" href=(detail_url(cx, project))>
25- <span class="project-index">(format!("{:02}", i + 1))</span>
26- <span class="project-row-name">(project.name())</span>
27- <span class="project-row-summary">(project.summary())</span>
28- <span class="arrow">"→"</span>
29- </a>
30- }
31- </div>
32- </div>
33- </section>
34 })33 })
35 }34 }
src/app/projects/slug.rsmodified+2 -2
@@ -24,9 +24,9 @@ pub async fn detail(cx: &Cx) -> Result<impl View> {
24 let project = Project::from_slug(slug(cx)).ok_or_not_found()?;24 let project = Project::from_slug(slug(cx)).ok_or_not_found()?;
25 25
26 Ok(view! {26 Ok(view! {
27- <article class="page article">27+ <article class="article">
28 <a class="back" href=(href!(super::index))>"← projects"</a>28 <a class="back" href=(href!(super::index))>"← projects"</a>
29- <h1 class="page-title">(project.name())</h1>29+ <h1>(project.name())</h1>
30 <p class="lead">(project.summary())</p>30 <p class="lead">(project.summary())</p>
31 <a class="more" href=(project.source())>"source ↗"</a>31 <a class="more" href=(project.source())>"source ↗"</a>
32 blocks(items: project.body())32 blocks(items: project.body())