A little app to serve my photography from my personal website

favicon, manifest, and some script reorganization

ericwood.org e4650766 c7cba5fb

Waiting for spindle ...
+48 -16
.DS_Store

This is a binary file and will not be displayed.

assets/android-chrome-192x192.png

This is a binary file and will not be displayed.

assets/android-chrome-512x512.png

This is a binary file and will not be displayed.

-14
assets/app.js
··· 16 16 }) 17 17 }; 18 18 19 - const initSort = () => { 20 - const select = document.getElementById("sort"); 21 - if (!select) { 22 - return; 23 - } 24 - 25 - select.addEventListener("change", (event) => { 26 - const url = new URL(window.location); 27 - url.searchParams.set('sort', event.target.value); 28 - window.location = url.search; 29 - }); 30 - } 31 - 32 19 document.addEventListener("DOMContentLoaded", () => { 33 20 initTimestamps(); 34 - initSort(); 35 21 });
assets/apple-touch-icon.png

This is a binary file and will not be displayed.

assets/favicon-16x16.png

This is a binary file and will not be displayed.

assets/favicon-32x32.png

This is a binary file and will not be displayed.

assets/favicon.ico

This is a binary file and will not be displayed.

+19
assets/site.webmanifest
··· 1 + { 2 + "name": "Eric Wood Dot Org", 3 + "short_name": "Eric", 4 + "icons": [ 5 + { 6 + "src": "/android-chrome-192x192.png", 7 + "sizes": "192x192", 8 + "type": "image/png" 9 + }, 10 + { 11 + "src": "/android-chrome-512x512.png", 12 + "sizes": "512x512", 13 + "type": "image/png" 14 + } 15 + ], 16 + "theme_color": "#ffffff", 17 + "background_color": "#ffffff", 18 + "display": "standalone" 19 + }
+5
src/templates.rs
··· 37 37 env.add_function("inline_script", inline_script); 38 38 env.add_function("photo_thumbnail_url", photo_thumbnail_url); 39 39 env.add_function("photo_url", photo_url); 40 + env.add_function("assets_path", assets_path); 40 41 env.add_global( 41 42 "nav_links", 42 43 Value::from_serialize([ ··· 121 122 fn photo_url(filename: String) -> String { 122 123 format!("/photos/images/{filename}") 123 124 } 125 + 126 + fn assets_path(path: String) -> String { 127 + format!("/photos/assets/{path}") 128 + }
+17
src/views/photos/index/script.js
··· 79 79 document.querySelector(".photos__nav").classList.toggle("open"); 80 80 }); 81 81 }); 82 + 83 + const initSort = () => { 84 + const select = document.getElementById("sort"); 85 + if (!select) { 86 + return; 87 + } 88 + 89 + select.addEventListener("change", (event) => { 90 + const url = new URL(window.location); 91 + url.searchParams.set('sort', event.target.value); 92 + window.location = url.search; 93 + }); 94 + } 95 + 96 + document.addEventListener("DOMContentLoaded", () => { 97 + initSort(); 98 + });
+7 -2
templates/layout.jinja
··· 3 3 <head> 4 4 <meta charset="utf-8"> 5 5 <meta name="viewport" content="width=device-width,initial-scale=1.0"> 6 + <link rel="apple-touch-icon" sizes="180x180" href="{{ assets_path("apple-touch-icon.png") }}"> 7 + <link rel="icon" type="image/png" sizes="32x32" href="{{ assets_path("favicon-32x32.png") }}"> 8 + <link rel="icon" type="image/png" sizes="16x16" href="{{ assets_path("favicon-16x16.png") }}"> 9 + <link rel="manifest" href="{{ assets_path("site.webmanifest") }}"> 6 10 <meta name="description" content="{{ meta_description|default("Eric, online") }}"> 7 11 {% if meta_image is defined %} 8 12 <meta property="og:image" content="{{ meta_image }}"> ··· 11 15 <meta property="og:image:height" content="500"> 12 16 {% endif %} 13 17 <meta property="og:type" content="website"> 14 - <link rel="stylesheet" href="/photos/assets/fonts/inter/inter.css"> 18 + <link rel="stylesheet" href="{{ assets_path("fonts/inter/inter.css") }}"> 15 19 <style type="text/css"> 16 20 :root { font-family: 'Inter', serif; } 17 21 @supports (font-variation-settings: normal) { ··· 117 121 </header> 118 122 {% block body %}{% endblock %} 119 123 </div> 120 - <script src="/photos/assets/app.js" type="text/javascript"></script> 124 + 125 + {{ inline_script("assets/app.js") }} 121 126 </body> 122 127 </html>