From e7cbe0330bb776691f2a6f52db5257148df6d9d4 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 14 Aug 2023 00:57:46 +0100 Subject: [PATCH] feat: add post metadata for social embed support --- OliverBooth/Pages/Shared/_Layout.cshtml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/OliverBooth/Pages/Shared/_Layout.cshtml b/OliverBooth/Pages/Shared/_Layout.cshtml index 423d3b4..dba5ca4 100644 --- a/OliverBooth/Pages/Shared/_Layout.cshtml +++ b/OliverBooth/Pages/Shared/_Layout.cshtml @@ -1,3 +1,10 @@ +@using OliverBooth.Data.Blog +@using OliverBooth.Services +@inject IBlogPostService BlogPostService +@{ + HttpRequest request = Context.Request; + var url = new Uri($"{request.Scheme}://{request.Host}{request.Path}{request.QueryString}"); +} @@ -13,6 +20,20 @@ { Oliver Booth } + @if (ViewData["Post"] is IBlogPost post) + { + string excerpt = BlogPostService.RenderExcerpt(post, out bool trimmed); + + + + + + + + + + + }