diff --git a/app/actions/feeds/statuses_rss.rb b/app/actions/feeds/statuses_rss.rb index b4d6b2e..6be6696 100644 --- a/app/actions/feeds/statuses_rss.rb +++ b/app/actions/feeds/statuses_rss.rb @@ -5,7 +5,7 @@ module Adamantium include Deps["views.feeds.statuses_rss"] def handle(req, res) - res.content_type = "application/rss+xml" + res.content_type = "text/xml; charset=utf-8" res.render statuses_rss, format: :xml end end diff --git a/app/templates/feeds/statuses_rss.xml.builder b/app/templates/feeds/statuses_rss.xml.builder index eda69bf..e17aa2a 100644 --- a/app/templates/feeds/statuses_rss.xml.builder +++ b/app/templates/feeds/statuses_rss.xml.builder @@ -1,18 +1,21 @@ -xml.instruct!(:xml, version: "2.0", encoding: "utf-8") +xml.instruct! "xml-stylesheet", {:href=>"/assets/style.xslt", :type=>"text/xsl"} xml.channel do |channel| channel.title "Daniel Nitsikopoulos" - channel.description "The RSS feed for https://dnitza.com" + channel.description "The personal blog of Daniel Nitsikopoulos, software engineer from Canberra, ACT" + channel.link "https://dnitza.com" + channel.name "dnitza.com" channel.lastBuildDate Time.now.rfc2822 channel.pubDate Time.now.rfc2822 channel.ttl 1800 posts.each do |post| channel.item do |item| - item.title post.display_title + item.title post.raw_content item.description do |desc| desc.cdata! post.feed_content end + item.link(post.permalink) item.guid(post.slug, isPermaLink: true) item.pubDate post.machine_published_at end diff --git a/app/templates/shared/_photo_post.html.slim b/app/templates/shared/_photo_post.html.slim index e4b278e..d05c70a 100644 --- a/app/templates/shared/_photo_post.html.slim +++ b/app/templates/shared/_photo_post.html.slim @@ -1,3 +1,3 @@ div class="rounded max-w-xs" a href="#{post.permalink}" - img class="rounded object-cover hover:opacity-80 h-48 w-48" src="#{post.photos[0]["value"]}" alt="#{post.photos[0]["alt"]}" + img class="rounded object-cover transition-transform transform-gpu ease-out hover:scale-105 h-48 w-48" src="#{post.photos[0]["value"]}" alt="#{post.photos[0]["alt"]}" diff --git a/slices/admin/templates/posts/show.html.slim b/slices/admin/templates/posts/show.html.slim index efbf6da..98312bc 100644 --- a/slices/admin/templates/posts/show.html.slim +++ b/slices/admin/templates/posts/show.html.slim @@ -9,4 +9,5 @@ div class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark: button hx-post="/admin/posts/#{post.id}/syndicate/day_one" Send to Day One article class="mb-12 prose dark:prose-invert max-w-prose mx-auto text-gray-800 dark:text-gray-200 prose-a:text-blue-600 prose-a:no-underline hover:prose-a:underline prose-img:rounded" h1= post.name - == post.content \ No newline at end of file + textarea class="w-full border-pink-200 border-2 rounded p-2" x-data="{ resize: () => { $el.style.height = '5px'; $el.style.height = $el.scrollHeight + 'px' } }" x-init="resize()" @input="resize()" + == markdown_body \ No newline at end of file diff --git a/slices/admin/views/posts/show.rb b/slices/admin/views/posts/show.rb index 5d8e3c1..bb0ae44 100644 --- a/slices/admin/views/posts/show.rb +++ b/slices/admin/views/posts/show.rb @@ -1,3 +1,5 @@ +require "reverse_markdown" + module Admin module Views module Posts @@ -7,6 +9,10 @@ module Admin expose :post do |id:| post_repo.find(id: id) end + + expose :markdown_body do |post| + ReverseMarkdown.convert(post.content, unknown_tags: :pass_through, github_flavored: true).to_s + end end end end