Implement fingerprinting site and page resources

This will keep browsers from caching files that have changed. I've also added
SRI information to the <script> and <link> elements for browsers to verify
resources.

Squashed commit of the following:

commit f3fcb16388
Author: Eryn Wells <eryn@erynwells.me>
Date:   Tue Nov 8 17:47:42 2022 -0800

    Remove static/styles/root.css

commit 53a30624a0
Author: Eryn Wells <eryn@erynwells.me>
Date:   Tue Nov 8 17:47:26 2022 -0800

    Add back the basic table styles that got ditched when root.css was moved to assets/styles

commit 294fa8343b
Author: Eryn Wells <eryn@erynwells.me>
Date:   Tue Nov 8 17:45:38 2022 -0800

    Get all the fingerprinting done!

    - Add partials in the resources folder for each of the major resources of my site
    - Consolidate .css and .js files via resources.Concat where possible

commit d0b223fa33
Author: Eryn Wells <eryn@erynwells.me>
Date:   Mon Nov 7 08:36:39 2022 -0800

    All the template updates for fingerprinting

commit 1751abadac
Author: Eryn Wells <eryn@erynwells.me>
Date:   Mon Nov 7 08:36:27 2022 -0800

    Add secure_asset.html template

commit 94ea8068c9
Author: Eryn Wells <eryn@erynwells.me>
Date:   Mon Nov 7 08:35:48 2022 -0800

    Move a bunch of scripts and CSS to assets so they can be processed with Hugo Pipes

    Use Pipes to fingerprint and add SLI information to <script> and <link> tags.
This commit is contained in:
Eryn Wells 2022-11-08 17:50:11 -08:00
parent f8174ab27c
commit 9601e1e283
24 changed files with 106327 additions and 55 deletions

View file

@ -1,82 +0,0 @@
:root {
--post-item-highlight-color: #efefef;
}
@media (prefers-color-scheme: dark) {
:root {
--post-item-highlight-color: #121212;
}
}
.blog > .highlight { margin-block-end: var(--body-item-spacing); }
.post-nav {
align-items: baseline;
display: flex;
margin-top: 3.5rem;
}
.post-nav .next {
margin-left: auto;
}
.post-single footer {
margin-block-start: var(--body-item-spacing);
}
.blog.list > ul {
list-style: none;
}
.blog.list > ul > li {
align-items: baseline;
border-radius: 6px;
display: grid;
gap: 1rem;
grid-template-columns: minmax(min-content, 10vh) minmax(min-content, 3vh) auto max-content;
margin-block-end: 0.25rem;
transition: background-color 0.25s;
}
.blog.list > ul > li:hover {
background-color: var(--post-item-highlight-color);
}
.blog.list > ul > li > a {
color: inherit;
}
.blog.list > ul > li > a:hover {
text-decoration: none;
}
.blog.list > ul > li > .draft {
align-self: center;
}
@supports (grid-template-columns: subgrid) {
.blog.list {
display: grid;
gap: 1rem;
grid-template-columns: minmax(min-content, 10vh) minmax(min-content, 3vh) auto max-content;
}
.blog.list > ul {
display: grid;
row-gap: 0.25rem;
grid-column: 1 / -1;
grid-template-columns: subgrid;
list-style: none;
}
.blog.list > ul > li {
display: grid;
grid-column: 1 / -1;
grid-template-columns: subgrid;
margin-block-end: 0;
}
.blog.list > h5 {
grid-column: 1 / -1;
margin-block: 1rem 0;
}
.blog.list > h5:first-child {
margin-block-start: 0;
}
}
.blog.list > ul > li > :first-child {
text-align: end;
}

View file

@ -1,170 +0,0 @@
:root {
--animation-offset: 6px;
--font-size-max: 12px;
}
body {
display: flex;
flex-direction: column;
font-size: 2rem;
justify-content: center;
margin: auto;
}
h1 {
font-size: 5rem;
line-height: 1.3;
margin: 0;
padding: 0;
}
@media (max-width: 599px) {
h1 { font-size: 4.25rem; }
}
html {
font-size: clamp(var(--font-size-min), 2.5vw, var(--font-size-max));
}
main {
margin-block-start: 10vh;
width: inherit;
}
main .grid {
align-items: baseline;
display: grid;
gap: 0 2rem;
grid-template-columns: minmax(min-content, 1fr) minmax(min-content, 2fr);
grid-template-rows: repeat(2, max-content);
grid-template-areas:
"title blurb"
"title nav";
padding-inline: 1em;
width: min-content;
}
@media (max-width: 599px) {
main .grid {
gap: 1rem 0;
grid-template-columns: 1fr;
grid-template-rows: repeat(3, max-content);
grid-template-areas:
"title"
"blurb"
"nav";
text-align: center;
}
}
main h1 {
letter-spacing: 0.025em;
text-align: end;
}
@media (max-width: 599px) {
main h1 { text-align: center; }
}
nav {
align-items: baseline;
display: flex;
list-style: none;
text-transform: lowercase;
}
nav > li {
margin-inline-start: 0.5em;
}
nav > li:first-of-type {
margin-inline-start: 0;
}
p {
margin: 0;
}
h1 { grid-area: title; }
#content { grid-area: blurb }
nav { grid-area: nav }
h1, #content > p, nav { position: relative; }
h1 {
animation: left-fade-in var(--transition-duration) ease-in-out;
}
@media (max-width: 599px) {
h1 {
animation: top-fade-in var(--transition-duration) ease-in-out;
}
}
#content > p, nav {
animation: right-fade-in var(--transition-duration) ease-in-out;
}
@media (max-width: 599px) {
#content > p, nav {
animation: bottom-fade-in var(--transition-duration) ease-in-out;
}
}
@keyframes left-fade-in {
from {
opacity: 0%;
left: var(--animation-offset);
}
33% {
opacity: 0%;
left: var(--animation-offset);
}
to {
opacity: 100%;
left: 0;
}
}
@keyframes right-fade-in {
from {
opacity: 0%;
left: calc(-1 * var(--animation-offset));
}
33% {
opacity: 0%;
left: calc(-1 * var(--animation-offset));
}
to {
opacity: 100%;
left: 0;
}
}
@keyframes top-fade-in {
from {
opacity: 0%;
bottom: calc(-1 * var(--animation-offset));
}
33% {
opacity: 0%;
bottom: calc(-1 * var(--animation-offset));
}
to {
opacity: 100%;
bottom: 0;
}
}
@keyframes bottom-fade-in {
from {
opacity: 0%;
bottom: var(--animation-offset);
}
33% {
opacity: 0%;
bottom: var(--animation-offset);
}
to {
opacity: 100%;
bottom: 0;
}
}
.platter {
padding: 1.5rem 3rem;
}

View file

@ -1,166 +0,0 @@
:root {
--date-item-background-color: rgb(var(--lt-gray));
--photo-params-background-color: rgb(var(--lt-gray));
--photo-params-container-background-color: rgb(var(--super-lt-gray));
--photo-params-color: rgb(var(--sub-dk-gray));
--photo-params-border-color: rgb(var(--super-lt-gray));
}
@media (prefers-color-scheme: dark) {
:root {
--date-item-background-color: rgb(var(--dk-gray));
--photo-params-background-color: rgb(var(--dk-gray));
--photo-params-container-background-color: rgb(var(--sub-dk-gray));
--photo-params-color: rgb(var(--super-lt-gray));
--photo-params-border-color: rgb(var(--sub-dk-gray));
}
}
.photos.list {
box-sizing: border-box;
max-width: none;
padding: 0 var(--body-item-spacing);
width: 100%;
}
.photos.list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 4px;
}
.photos.page > nav {
margin-block-end: var(--body-item-spacing);
}
.photos.list > a {
display: block;
line-height: 0;
}
.photos.list > a > img {
border-radius: 3px;
image-orientation: from-image;
}
.photos.list > div {
background-color: var(--date-item-background-color);
border-radius: 3px;
width: 100%;
height: 100%;
display: flex;
align-items: center;
}
.photos.list > div > h6 {
display: block;
font-size: 5rem;
margin: 0 auto;
letter-spacing: 0;
}
.photos.list > div > h6 > span {
text-align: end;
width: min-content;
position: relative;
display: inline-block;
padding-inline-end: 20px;
}
.photos.list > div > h6 > span::after {
top: 6px;
right: 0px;
position: absolute;
display: block;
content: "⏵︎";
font-size: 80%;
}
@media (max-width: calc(24px + 400px + 4px)) {
.photos.list > div > h6 > span {
width: max-content;
padding-block: calc(0.25 * var(--body-item-spacing));
}
.photos.list > div > h6 > span::after {
content: "";
}
}
.photo-params {
width: 100%;
}
.photo-params .container {
display: block;
background-color: var(--photo-params-container-background-color);
border-radius: 10px;
margin: var(--body-item-spacing) auto;
padding: calc(var(--body-item-spacing) / 2);
width: 66%;
}
.photo-params table {
background-color: var(--photo-params-background-color);
color: var(--photo-params-color);
border-collapse: collapse;
border-radius: 6px;
table-layout: fixed;
text-align: center;
width: 100%;
}
.photo-params thead td {
border-bottom: 1px solid var(--photo-params-border-color);
font-size: 80%;
font-weight: bold;
}
.photo-params tr.exposure-attributes td {
border-top: 1px solid var(--photo-params-border-color);
border-left: 1px solid var(--photo-params-border-color);
}
.photo-params tr.exposure-attributes td:first-child {
border-left: none;
}
.photo-params td {
font-size: 75%;
padding: 1rem;
}
.photo-params td:last-child {
text-align: end;
}
.photo-params td:first-child {
text-align: start;
}
.photo-params .make-model {
font-weight: bold;
}
.photo-params .size {
border-left: 0;
}
.photo-params .location {
border-right: 0;
}
.photo-params.debug thead {
font-size: 2rem;
font-weight: bold;
border-bottom: 2px solid rgb(var(--dk-gray));
}
.photo-params.debug {
width: 100%;
}
.photo-params.debug td {
border: 1px solid var(--photo-params-border-color);
overflow: scroll;
vertical-align: top;
}