From e96e6dfdf76661ddd3269b46b2fa0eec94501008 Mon Sep 17 00:00:00 2001 From: Daniel Nitsikopoulos Date: Sun, 7 May 2023 12:24:23 +1000 Subject: [PATCH] Template cleanup and bookmark allowed tags --- app/templates/layouts/app.html.slim | 3 --- app/templates/places/index.html.slim | 1 + slices/admin/commands/bookmarks/cache.rb | 2 +- slices/admin/templates/layouts/app.html.slim | 24 ++------------------ 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/app/templates/layouts/app.html.slim b/app/templates/layouts/app.html.slim index e01d0e4..320a1be 100644 --- a/app/templates/layouts/app.html.slim +++ b/app/templates/layouts/app.html.slim @@ -30,9 +30,6 @@ html script src="https://unpkg.com/htmx.org@1.8.4" integrity="sha384-wg5Y/JwF7VxGk4zLsJEcAojRtlVp1FKKdGy1qN+OMtdq72WRvX/EdRdqg/LOhYeV" crossorigin="anonymous" script src="https://cdn.jsdelivr.net/npm/alpinejs@3.12.0/dist/cdn.min.js" defer="true" - script src="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js" - link href="https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css" rel="stylesheet" - - if Hanami.app.settings.micropub_pub_key link rel="pgpkey" href="/key" body class="bg-white dark:bg-black selection:bg-blue-100 selection:text-blue-900 dark:selection:bg-blue-600 dark:selection:text-blue-100" diff --git a/app/templates/places/index.html.slim b/app/templates/places/index.html.slim index 882b1f2..256f619 100644 --- a/app/templates/places/index.html.slim +++ b/app/templates/places/index.html.slim @@ -1,5 +1,6 @@ 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;' div class="mb-12 max-w-prose mx-auto" - places.each do |post| diff --git a/slices/admin/commands/bookmarks/cache.rb b/slices/admin/commands/bookmarks/cache.rb index 3e4e432..9518007 100644 --- a/slices/admin/commands/bookmarks/cache.rb +++ b/slices/admin/commands/bookmarks/cache.rb @@ -13,7 +13,7 @@ module Admin bookmark.url tempfile = Down.download(bookmark.url) - content = Readability::Document.new(tempfile.read, tags: %w[div section header p h1 h2 h3 h4 h5 h6 ol ul li table td tr thead tbody a]).content + content = Readability::Document.new(tempfile.read, tags: %w[div section header p h1 h2 h3 h4 h5 h6 ol ul li table td tr thead tbody a code pre]).content bookmark_repo.update(id: bookmark_id, cached_content: content) diff --git a/slices/admin/templates/layouts/app.html.slim b/slices/admin/templates/layouts/app.html.slim index 0c56574..f72dcbf 100644 --- a/slices/admin/templates/layouts/app.html.slim +++ b/slices/admin/templates/layouts/app.html.slim @@ -6,25 +6,11 @@ html meta name="theme-color" content="rgb(37, 99, 235)" - 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 - link rel="micropub" href="#{URI.join(Hanami.app.settings.micropub_site_url, "micropub")}" - - link rel="webmention" href=Hanami.app.settings.webmention_url - link rel="pingback" href=Hanami.app.settings.pingback_url - link rel="feed" type="text/html" href="/posts" - link rel="feed alternate" type="application/rss+xml" href="/feeds/rss" - link rel="feed alternate" type="application/rss+xml" href="/feeds/statuses_rss" - - link rel="me" href=Hanami.app.settings.mastodon_url - link rel="me" href=Hanami.app.settings.github_url + title Admin // Daniel Nitsikopoulos link rel="stylesheet" href="/assets/index.css" link rel="icon" type="image/x-icon" href="/assets/favicon.ico" - script data-domain="dnitza.com" src="https://stats.dnitza.com/js/script.js" defer="true" script src="/assets/index.js" script src="https://unpkg.com/htmx.org@1.9.2" integrity="sha384-L6OqL9pRWyyFU3+/bjdSri+iIphTN/bvYyM37tICVyOJkWZLpP2vGn6VUEXgzg6h" crossorigin="anonymous" @@ -49,10 +35,4 @@ html = "/" a class="p-1 rounded text-gray-400 hover:bg-red-100 hover:text-red-400 dark:hover:bg-red-200 #{link_active?('about') ? 'text-red-600 dark:text-red-400' : ''}" href="/admin/bookmarks" Bookmarks - == yield - div class="px-4 max-w-screen-md mx-auto pb-10" - p class="float-left text-gray-200 dark:text-gray-600" Β© 2023 Daniel Nitsikopoulos. All rights reserved. - p class="float-right text-gray-200 dark:text-gray-600" - a href="https://xn--sr8hvo.ws/%F0%9F%8D%93%E2%9E%97%F0%9F%8E%B0/previous" ← - a href="https://xn--sr8hvo.ws" πŸ•ΈπŸ’ - a href="https://xn--sr8hvo.ws/%F0%9F%8D%93%E2%9E%97%F0%9F%8E%B0/next"   → + == yield \ No newline at end of file