From 37b96902e80f0f8d5f5dc48b63c8e7fcdb1ba5ee Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Mon, 27 Feb 2023 16:47:37 +0800 Subject: [PATCH] Remove external links styling That experiment for short long-term evaluation whether or not external link style is worth it or not is over. And I think it's too much considering that the target audience is for personal blogs which will not mind such things. Plus the amount of things to make it work properly is just too much (i.e., the font has to have the glyph). --- assets/templates/site.scss | 41 -------------------------------------- layouts/partials/head.html | 3 +-- 2 files changed, 1 insertion(+), 43 deletions(-) delete mode 100644 assets/templates/site.scss diff --git a/assets/templates/site.scss b/assets/templates/site.scss deleted file mode 100644 index 1d3ff9c..0000000 --- a/assets/templates/site.scss +++ /dev/null @@ -1,41 +0,0 @@ -{{/* - This is a site-specific styling that have to be generated. -*/}} - -article > main { - /* - Select all links that are external. - - In this case, we'll just exclude all links that are... - - - All internal anchors. - - All links that points to a relative path. - - All origin-relative URLs. - - Also, all links that are explicitly marked as external are obviously - considered. - */ - a[href]:not(:where( - a[href^="#"], - a[href^="./"], - a[href^="../"], - a[href^="/"]:not(a[href^="//"]), - ))::after, a[rel~="external"]::after { - color: var(--base05); - font-size: 0.50em; - content: " [🡕]"; - vertical-align: super; - } - - /* Internal links are not to be styled. */ - {{- $baseURL := urls.Parse $.Site.BaseURL }} - a[href]:where( - a[href^="http://{{- $baseURL.Host -}}"], - a[href^="https://{{- $baseURL.Host -}}"], - a[href$="{{- $baseURL.Host -}}"], - a[href$="{{- $baseURL.Host -}}/"], - a[href^="{{- $.Site.BaseURL -}}"], - )::after { - content: unset; - } -} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index e512d73..257e31f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -7,10 +7,9 @@ {{- /* Combine all of the custom schems in under one stylesheet */ -}} {{- $themes := resources.Get "templates/theme.scss" | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS }} -{{- $siteSpecificTheme := resources.Get "templates/site.scss" | resources.ExecuteAsTemplate "css/site.css" . | resources.ToCSS }} {{- /* Append the main stylesheet to be the last so the resulting stylesheet will make the custom colorschemes at the front. */ -}} -{{ $stylesheets = $stylesheets | append $themes $siteSpecificTheme $main }} +{{ $stylesheets = $stylesheets | append $themes $main }} {{ $style := $stylesheets | resources.Concat "css/main.css" }}