From a996f3bd05fc480247fd112f23fa3e67f7d5d7b5 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 7 Dec 2024 15:54:39 -0500 Subject: Added support for liking blog posts via webmention --- app/views/blogs/_blog.html.haml | 2 +- app/views/blogs/show.html.haml | 1 + app/views/layouts/application.html.haml | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/blogs/_blog.html.haml b/app/views/blogs/_blog.html.haml index d0b81d1..878b1a2 100644 --- a/app/views/blogs/_blog.html.haml +++ b/app/views/blogs/_blog.html.haml @@ -19,7 +19,7 @@ %cite.bubble.blog-cite %span.p-author.h-card %strong.p-name= blog.user.login.capitalize - %data.u-url{ value: "/" } + %data.u-url{ value: root_url } on %time.dt-published{ datetime: blog.visible_date.strftime("%Y-%m-%dT%H:%M:%SZ%z") }= blog.visible_date.strftime("%B #{blog.visible_date.day.ordinalize}, %Y at %-I:%M:%S%P") .post-vote{ id: "blog-vote-section-#{blog.id}" } diff --git a/app/views/blogs/show.html.haml b/app/views/blogs/show.html.haml index 7558257..c849143 100644 --- a/app/views/blogs/show.html.haml +++ b/app/views/blogs/show.html.haml @@ -1,4 +1,5 @@ - title @blog.title +- content_for :webmention_endpoint, webmention_blog_url(@blog) - unless @prev.nil? .back-post= link_to "← #{@prev.title}", @prev - unless @next.nil? diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 69cd6ba..ec37f73 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -6,6 +6,8 @@ = stylesheet_link_tag 'main', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' = display_meta_tags og: { site_name: "Four Island" } + - if content_for?(:webmention_endpoint) + %link{rel: "webmention", href: yield(:webmention_endpoint)} %body#main-body - if flash[:alert] %div#flash.flash-alert= flash[:alert] -- cgit 1.4.1