1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 08:55:32 -04:00

*much* smarter way of setting page-specific CSS

via front matter instead of flaky shortcode/page scratch
This commit is contained in:
2020-04-09 13:59:49 -04:00
parent 51dd770094
commit 20c32eaeb3
6 changed files with 28 additions and 35 deletions

View File

@@ -9,21 +9,19 @@ tags:
- Public Health
- GitHub
image: "covid19dashboards.png"
draft: false
---
{{< page-css >}}
/* disable link underlines for octocats */
h2 a:last-child {
css: |
/* disable link underlines for octocats */
h2 a:last-child {
background-image: none !important;
padding-bottom: 0 !important;
margin-left: 8px;
}
/* align octocat with text */
h2 img {
}
/* align octocat with text */
h2 img {
vertical-align: text-bottom;
}
{{< /page-css >}}
}
draft: false
---
We're all quickly learning that worldwide pandemics can bring out both [the best](https://www.vox.com/culture/2020/3/13/21179293/coronavirus-italy-covid19-music-balconies-sing) and [the worst](https://twitter.com/9NewsAUS/status/1236088663093608448) of humanity. But one thing has become readily apparent to me — outside of the large teams of medical professionals risking their lives right this minute, the open source community stands alone in its ability to rapidly organize in the midst of chaos to give back to the world and, in this case, make it safer for all of us.

View File

@@ -9,17 +9,15 @@ tags:
- Internet of Things
- Dorking
image: "shodan.png"
draft: false
---
{{< page-css >}}
/* disable hover underlines for search links */
h3 a:last-child, h4 a:last-child {
css: |
/* disable hover underlines for search links */
h3 a:last-child, h4 a:last-child {
background-image: none !important;
padding-bottom: 0 !important;
margin-left: 6px;
}
{{< /page-css >}}
}
draft: false
---
{{< gh-buttons username="jakejarvis" repo="awesome-shodan-queries" >}}

View File

@@ -217,8 +217,8 @@
div.highlight span.gs { font-weight: bold; }
div.highlight span.lnt { color: #999999; user-select: none; }
{{/* Page-specific styles set via page-css shortcode */}}
{{- with .Page.Scratch.Get "css" }}
{{/* Page-specific styles set via front matter */}}
{{- with .Params.css }}
{{- . | safeCSS -}}
{{ end -}}
</style>

View File

@@ -3,7 +3,7 @@
{{ partial "head/open-graph" . -}}
{{ partialCached "head/mobile" . -}}
{{ partial "head/preload" . -}}
{{ partialCached "head/styles" . -}}
{{ partial "head/styles" . -}}
{{ partialCached "head/favicons" (dict "pngSizes" "192 48 32 16" "icoSizes" "16 32 48") -}}
<link rel="manifest" href="{{ "site.webmanifest" | absURL }}">
<link rel="canonical" href="{{ .Permalink }}">
@@ -19,10 +19,3 @@
{{ else }}
{{ partial "head/schema-person" . }}
{{ end -}}
{{/* Page-specific styles set via page-css shortcode */}}
{{- with .Page.Scratch.Get "css" }}
<style>
{{- . | safeCSS -}}
</style>
{{ end -}}

View File

@@ -1,2 +1,9 @@
{{ $style := resources.Get "sass/main.scss" | resources.ExecuteAsTemplate "sass/main.scss" . | resources.ToCSS (dict "targetPath" "style.css") | resources.PostCSS (dict "config" "postcss.config.js") }}
<link rel="stylesheet" href="{{ $style.Permalink }}">
{{/* Page-specific styles set via front matter */}}
{{ with .Params.css }}
<style>
{{ . | safeCSS }}
</style>
{{ end }}

View File

@@ -1,3 +0,0 @@
{{/* Allow page-specific CSS to be set from within its Markdown content and appear in <head> (see partials/head/head.html) */}}
{{- .Page.Scratch.Set "css" .Inner -}}