From 6647cf0e2eb49396390f9a67b2c694ef3dfd24c2 Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Tue, 6 Apr 2021 11:50:59 -0400 Subject: [PATCH] fixing inline code style purging, fix some social icon target=_self, fix endpoint static asset serving --- assets/webpack.config.js | 2 +- lib/home73k_web/endpoint.ex | 2 +- lib/home73k_web/templates/home/index.html.eex | 2 +- .../templates/home/resume.html.eex | 2 +- lib/home73k_web/views/home_view.ex | 27 ++++++++++--------- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/assets/webpack.config.js b/assets/webpack.config.js index 22bd5b5..7627040 100644 --- a/assets/webpack.config.js +++ b/assets/webpack.config.js @@ -94,7 +94,7 @@ module.exports = (env, options) => { "./js/**/*.js", ]), safelist: { - greedy: [/phx/, /topbar/, /chroma/], + greedy: [/phx/, /topbar/, /chroma/, /inline/], }, }), ] diff --git a/lib/home73k_web/endpoint.ex b/lib/home73k_web/endpoint.ex index 18ce5a4..13c27e7 100644 --- a/lib/home73k_web/endpoint.ex +++ b/lib/home73k_web/endpoint.ex @@ -24,7 +24,7 @@ defmodule Home73kWeb.Endpoint do at: "/", from: :home73k, gzip: (Mix.env() not in [:dev, :test]), - only: ~w(css fonts images js favicon.ico robots.txt DF185CEE29A3D443_public_key.asc) + only: File.ls!("priv/static") # Code reloading can be explicitly enabled under the # :code_reloader configuration of your endpoint. diff --git a/lib/home73k_web/templates/home/index.html.eex b/lib/home73k_web/templates/home/index.html.eex index 5600183..e2c9b7a 100644 --- a/lib/home73k_web/templates/home/index.html.eex +++ b/lib/home73k_web/templates/home/index.html.eex @@ -21,7 +21,7 @@
<%= for s <- socials(@conn) do %> - <%= link to: s.url, target: "_blank", class: "fs-3 link-light text-decoration-none" do %> + <%= link to: s.url, target: s.target, class: "fs-3 link-light text-decoration-none" do %> <%= icon_div @conn, s.icon, [class: "icon baseline"] %> <% end %> <% end %> diff --git a/lib/home73k_web/templates/home/resume.html.eex b/lib/home73k_web/templates/home/resume.html.eex index 5725230..9fd8227 100644 --- a/lib/home73k_web/templates/home/resume.html.eex +++ b/lib/home73k_web/templates/home/resume.html.eex @@ -12,7 +12,7 @@
<%= for s <- socials_prof(@conn) do %> - <%= link to: s.url, target: "_blank", class: "fs-3 link-light text-decoration-none" do %> + <%= link to: s.url, target: s.target, class: "fs-3 link-light text-decoration-none" do %> <%= icon_div @conn, s.icon, [class: "icon baseline"] %> <% end %> <% end %> diff --git a/lib/home73k_web/views/home_view.ex b/lib/home73k_web/views/home_view.ex index 4f83f9b..b3942ed 100644 --- a/lib/home73k_web/views/home_view.ex +++ b/lib/home73k_web/views/home_view.ex @@ -5,43 +5,44 @@ defmodule Home73kWeb.HomeView do [ %{ icon: "mdi-typewriter", - url: "https://73k.us/blog/", - prof: false + url: Routes.blog_path(conn, :index), + prof: false, + target: "_self" }, - %{icon: "mdi-rss", url: "https://w.73k.us/feed/", prof: false}, + %{icon: "mdi-rss", url: "https://w.73k.us/feed/", prof: false, target: "_blank"}, %{ icon: "mdi-linkedin", url: "https://www.linkedin.com/in/adampiontek/", - prof: true + prof: true, target: "_blank" }, - %{icon: "mdi-github", url: "https://github.com/apiontek", prof: true}, - %{icon: "gitea", url: "https://73k.us/git/adam", prof: true}, + %{icon: "mdi-github", url: "https://github.com/apiontek", prof: true, target: "_blank"}, + %{icon: "gitea", url: "https://73k.us/git/adam", prof: true, target: "_blank"}, %{ icon: "mdi-key-variant", url: Routes.static_path(conn, "/DF185CEE29A3D443_public_key.asc"), - prof: true + prof: true, target: "_blank" }, %{ icon: "mdi-goodreads", url: "https://www.goodreads.com/user/show/2450014-adam-piontek", - prof: false + prof: false, target: "_blank" }, - %{icon: "mdi-twitter", url: "https://twitter.com/adampiontek", prof: false}, - %{icon: "mdi-facebook", url: "https://facebook.com/damek", prof: false}, + %{icon: "mdi-twitter", url: "https://twitter.com/adampiontek", prof: false, target: "_blank"}, + %{icon: "mdi-facebook", url: "https://facebook.com/damek", prof: false, target: "_blank"}, %{ icon: "mdi-instagram", url: "https://www.instagram.com/adampiontek/", - prof: false + prof: false, target: "_blank" }, %{ icon: "mdi-steam", url: "https://steamcommunity.com/id/apiontek/", - prof: false + prof: false, target: "_blank" }, %{ icon: "mdi-discord", url: "https://discordapp.com/users/328583977629646848", - prof: false + prof: false, target: "_blank" } ] end