From 4bccc2ea5a5c7cca9c9cb4668220ff7f36d163a3 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Wed, 17 May 2023 20:12:07 +1000 Subject: [PATCH] Add page titles --- app/content/pages/about.md | 3 ++- app/templates/bookmarks/index.html.slim | 2 ++ app/templates/bookmarks/show.html.slim | 2 ++ app/templates/layouts/app.html.slim | 2 +- app/templates/movies/index.html.slim | 2 ++ app/templates/pages/show.html.slim | 2 ++ app/templates/photos/index.html.slim | 2 ++ app/templates/places/index.html.slim | 2 ++ app/templates/posts/index.html.slim | 2 ++ app/templates/posts/show.html.slim | 2 ++ app/templates/site/home.html.slim | 2 ++ app/templates/tags/index.html.slim | 2 ++ app/templates/tags/show.html.slim | 2 ++ app/templates/trips/index.html.slim | 2 ++ app/templates/trips/show.html.slim | 2 ++ app/templates/workouts/index.html.slim | 2 ++ app/views/bookmarks/show.rb | 2 +- lib/adamantium/context.rb | 2 ++ 18 files changed, 34 insertions(+), 3 deletions(-) diff --git a/app/content/pages/about.md b/app/content/pages/about.md index 6dc8111..ba397d1 100644 --- a/app/content/pages/about.md +++ b/app/content/pages/about.md @@ -14,6 +14,7 @@ Where possible, I will try and post as much as I can here, and then syndicate ou - [Apple Music](https://music.apple.com/profile/nitza) - [Email](mailto:hello@dnitza.com) +- [Discogs](https://www.discogs.com/user/dnitza) - [Github](https://github.com/dnitza) - [last.fm](https://www.last.fm/user/dNitza) - [Letterboxd](https://letterboxd.com/dnitza/) @@ -37,4 +38,4 @@ In my spare time I like to tinker on various Ruby projects (including the softwa - Add a way to syndicate after a post is published. - Add places visited to weekly posts. - Add weather history to weekly posts. -- Take a holiday overseas \ No newline at end of file +- Take a holiday overseas diff --git a/app/templates/bookmarks/index.html.slim b/app/templates/bookmarks/index.html.slim index e3e31a3..47dfe47 100644 --- a/app/templates/bookmarks/index.html.slim +++ b/app/templates/bookmarks/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Bookmarks | ") + div class="flex justify-between mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" div class="basis-1/5" h1 Bookmarks diff --git a/app/templates/bookmarks/show.html.slim b/app/templates/bookmarks/show.html.slim index 3bf16ea..ac04c66 100644 --- a/app/templates/bookmarks/show.html.slim +++ b/app/templates/bookmarks/show.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Bookmark | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 = bookmark.name diff --git a/app/templates/layouts/app.html.slim b/app/templates/layouts/app.html.slim index 9908bbc..ffea2b2 100644 --- a/app/templates/layouts/app.html.slim +++ b/app/templates/layouts/app.html.slim @@ -6,7 +6,7 @@ html meta name="theme-color" content="rgb(37, 99, 235)" - title Daniel Nitsikopoulos + title #{context.content_for(:title)} Daniel Nitsikopoulos link rel="authorization_endpoint" href=Hanami.app.settings.micropub_authorization_endpoint link rel="token_endpoint" href=Hanami.app.settings.micropub_token_endpoint diff --git a/app/templates/movies/index.html.slim b/app/templates/movies/index.html.slim index 8a75b32..dd5a2b5 100644 --- a/app/templates/movies/index.html.slim +++ b/app/templates/movies/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Movies | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Movies diff --git a/app/templates/pages/show.html.slim b/app/templates/pages/show.html.slim index deba018..73bf755 100644 --- a/app/templates/pages/show.html.slim +++ b/app/templates/pages/show.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "") + article class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200 prose-em:font-bold prose-em:not-italic prose-em:bg-blue-600 prose-em:px-1 prose-a:text-blue-600 prose-a:p-0.5 prose-a:rounded-sm prose-a:no-underline hover:prose-a:underline prose-em:text-blue-100" == page_content diff --git a/app/templates/photos/index.html.slim b/app/templates/photos/index.html.slim index ce192da..6ab66a0 100644 --- a/app/templates/photos/index.html.slim +++ b/app/templates/photos/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Photos | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Photos diff --git a/app/templates/places/index.html.slim b/app/templates/places/index.html.slim index 256f619..a89ce46 100644 --- a/app/templates/places/index.html.slim +++ b/app/templates/places/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Places | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Places / div id='map' data-markers="#{JSON.generate(places.map{|p| [p.lon,p.lat]})}" style='width: 400px; height: 300px;' diff --git a/app/templates/posts/index.html.slim b/app/templates/posts/index.html.slim index 8538539..dab1d77 100644 --- a/app/templates/posts/index.html.slim +++ b/app/templates/posts/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Writing | ") + div class="mb-4 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Writing diff --git a/app/templates/posts/show.html.slim b/app/templates/posts/show.html.slim index fc95b09..7f5cb29 100644 --- a/app/templates/posts/show.html.slim +++ b/app/templates/posts/show.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "#{post.display_title} | ") + article class="h-entry" template @img-modal.window="imgModal = true; imgModalSrc = $event.detail.imgModalSrc; imgModalDesc = $event.detail.imgModalDesc;" x-if="imgModal" div @mousedown.outside="imgModalSrc = ''" class="p-2 fixed w-full h-100 inset-0 z-50 overflow-hidden flex justify-center items-center bg-black bg-opacity-75" diff --git a/app/templates/site/home.html.slim b/app/templates/site/home.html.slim index ac7ec92..59cd273 100644 --- a/app/templates/site/home.html.slim +++ b/app/templates/site/home.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "") + div class="h-card prose dark:prose-invert mb-12 prose-a:decoration-wavy hover:prose-a:text-blue-400 max-w-prose mx-auto text-gray-800 dark:text-gray-200" p class="p-note" == home_content diff --git a/app/templates/tags/index.html.slim b/app/templates/tags/index.html.slim index 397d206..008a746 100644 --- a/app/templates/tags/index.html.slim +++ b/app/templates/tags/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Tags | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Tags diff --git a/app/templates/tags/show.html.slim b/app/templates/tags/show.html.slim index 7887749..888ce32 100644 --- a/app/templates/tags/show.html.slim +++ b/app/templates/tags/show.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Tag - #{tag.label} | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h2 = "#{posts.count} item(s) tagged \"#{tag.label}\"" diff --git a/app/templates/trips/index.html.slim b/app/templates/trips/index.html.slim index 90c9ff5..e2831d8 100644 --- a/app/templates/trips/index.html.slim +++ b/app/templates/trips/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Trips | ") + div class="mb-4 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Trips diff --git a/app/templates/trips/show.html.slim b/app/templates/trips/show.html.slim index e058a3d..eb27fbf 100644 --- a/app/templates/trips/show.html.slim +++ b/app/templates/trips/show.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "#{trip.name} | ") + div class="mb-4 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 class="mb-0" #{trip.name} / p class="mt-2" class="text-gray-600 dark:text-gray-200 text-sm" (#{trip.start_date} - #{trip.end_date}) diff --git a/app/templates/workouts/index.html.slim b/app/templates/workouts/index.html.slim index 6a75590..b9846a5 100644 --- a/app/templates/workouts/index.html.slim +++ b/app/templates/workouts/index.html.slim @@ -1,3 +1,5 @@ +- context.content_for(:title, "Hikes | ") + div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200" h1 Hikes diff --git a/app/views/bookmarks/show.rb b/app/views/bookmarks/show.rb index 7bdd4e6..382e10c 100644 --- a/app/views/bookmarks/show.rb +++ b/app/views/bookmarks/show.rb @@ -1,7 +1,7 @@ module Adamantium module Views module Bookmarks - class Show < Adamantium::View + class Show < View include Deps["repos.post_repo"] expose :bookmark do |slug:| diff --git a/lib/adamantium/context.rb b/lib/adamantium/context.rb index ba00433..00474eb 100644 --- a/lib/adamantium/context.rb +++ b/lib/adamantium/context.rb @@ -1,5 +1,7 @@ module Adamantium class Context < Hanami::View::Context + include Hanami::View::ContextHelpers::ContentHelpers + def initialize(**options) @options = options super(**options)