Unstyle internal site links globally

This commit is contained in:
Gabriel Arazas 2022-10-24 13:31:41 +08:00
parent 1eb8a3b600
commit 8d6e0797b5
2 changed files with 18 additions and 3 deletions

View File

@ -0,0 +1,15 @@
{{/*
This is a site-specific styling that have to be generated.
*/}}
/* 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;
}

View File

@ -6,11 +6,11 @@
{{- $main := resources.Get "scss/main.scss" | resources.ToCSS }}
{{- /* Combine all of the custom schems in under one stylesheet */ -}}
{{ $scheme_template := resources.Get "templates/theme.scss" }}
{{- $themes := $scheme_template | resources.ExecuteAsTemplate "css/themes.css" . | resources.ToCSS }}
{{- $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 $main }}
{{ $stylesheets = $stylesheets | append $themes $main $siteSpecificTheme }}
{{ $style := $stylesheets | resources.Concat "css/main.css" }}