feat: impact-media page type with OG scraping and cache
All checks were successful
Deploy / Deploy to Production (push) Successful in 12s

- Add impact-media blueprint (entries field + linked investigation)
- Add minimal impact-media template
- Refactor card-open-graph snippet: accepts $url param, Kirby cache (6h TTL), decode HTML entities, empty alt on images
- Update impacts.yml to allow impact-media pages
- Render impact-media in investigation aside with dynamic count + details/summary
- Add OG cache config in config.php
- CSS formatting fixes (body, card-block-small, category)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-02-27 17:31:00 +01:00
parent b8352c81fa
commit f757906584
11 changed files with 505 additions and 452 deletions

View file

@ -1,74 +1,74 @@
* {
margin: 0;
padding: 0;
margin: 0;
padding: 0;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-font-smoothing: antialiased;
-o-font-smoothing: antialiased;
scroll-behavior: smooth;
scroll-behavior: smooth;
}
a {
color: currentColor;
color: currentColor;
}
button{
background: none;
outline: none;
border: none;
color: var(--color-txt);
button {
background: none;
outline: none;
border: none;
color: var(--color-txt);
}
iframe{
border: none;
iframe {
border: none;
}
body{
font-family: var(--font);
line-height: var(--leading-normal);
font-size: var(--fs-normal);
body {
font-family: var(--font);
line-height: var(--leading-normal);
font-size: var(--fs-normal);
color: var(--color-txt);
background-color: var(--color-bg);
color: var(--color-txt);
background-color: var(--color-bg);
}
img{
max-width: 100%;
img {
max-width: 100%;
}
.link-block{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
cursor: pointer;
// &:hover{
// background-color: rgba(255, 0, 0, 0.244);
// }
.link-block {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: block;
cursor: pointer;
// &:hover{
// background-color: rgba(255, 0, 0, 0.244);
// }
}
.swiper-button-next, .swiper-button-prev,
body, #site-header, #site-footer{
transition: background-color 0.3s ease, color 0.3s ease;
.swiper-button-next,
.swiper-button-prev,
body,
#site-header,
#site-footer {
transition: background-color 0.3s ease, color 0.3s ease;
}
@mixin grid-content(){
display: grid;
grid-gap: var(--padding-inner);
grid-template-columns: 2fr 3fr;
position: relative;
@mixin grid-content() {
display: grid;
grid-gap: var(--padding-inner);
grid-template-columns: 2fr 3fr;
position: relative;
}
@mixin hide-scroll(){
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
@mixin hide-scroll() {
scrollbar-width: none;
-ms-overflow-style: none;
&::-webkit-scrollbar {
display: none;
}
}
}
@mixin clamp($lines) {
@ -78,67 +78,60 @@ body, #site-header, #site-footer{
overflow: hidden;
}
@mixin hover-card-line(){
border-bottom: var(--border-light);
&:first-of-type{
border-top: var(--border-light);
}
position: relative;
&::before{
content: '';
width: 100%;
border-top: 1px solid transparent;
position: absolute;
top: -1px;
left: 0;
}
@mixin hover-card-line() {
border-bottom: var(--border-light);
&:first-of-type {
border-top: var(--border-light);
}
position: relative;
&::before {
content: "";
width: 100%;
border-top: 1px solid transparent;
position: absolute;
top: -1px;
left: 0;
}
&:hover{
background-color: var(--grey-950);
&:not([data-impact-type="media"]) {
&:hover {
background-color: var(--grey-950);
border-color: var(--color-txt);
&::before {
border-color: var(--color-txt);
&::before{
border-color: var(--color-txt);
}
}
}
}
}
@mixin pin(){
.pin{
z-index: 90;
width: 18px;
height: 18px;
transform: rotate(45deg);
transform-origin: center;
svg{
width: 100%;
height: 100%;
fill: var(--color-txt);
}
@mixin pin() {
.pin {
z-index: 90;
width: 18px;
height: 18px;
transform: rotate(45deg);
transform-origin: center;
svg {
width: 100%;
height: 100%;
fill: var(--color-txt);
}
}
}
@mixin icon($size){
.icon{
display: flex;
width: $size;
height: $size;
svg{
width: $size;
height: $size;
}
@mixin icon($size) {
.icon {
display: flex;
width: $size;
height: $size;
svg {
width: $size;
height: $size;
}
}
}
body.menu-open,
body.is-hidden{
overflow-y: hidden;
body.is-hidden {
overflow-y: hidden;
}

View file

@ -1,153 +1,141 @@
.card--block-small {
border-bottom: var(--border-light);
padding: var(--padding-inner) 0;
padding-bottom: calc(var(--spacing) * 0.75);
border-bottom: var(--border-light);
padding: var(--padding-inner) 0;
padding-bottom: calc(var(--spacing)*0.75);
&:first-of-type {
border-top: var(--border-light);
}
&:first-of-type {
border-top: var(--border-light);
}
@include grid-content();
@include hover-card-line();
@include grid-content();
@include hover-card-line();
.group-top {
position: relative;
// top: -5px;
}
.group-top {
position: relative;
// top: -5px;
}
@include btn--go-to();
@include btn--go-to();
.btn--go-to {
top: calc(var(--padding-inner) * 1);
bottom: auto;
}
.title {
grid-column: 2;
grid-row: 2;
font-size: var(--fs-normal);
line-height: var(--leading-title);
font-weight: 500;
text-transform: uppercase;
margin-right: 4ch;
}
.date {
font-size: var(--fs-small);
grid-column: 2;
grid-row: 1;
margin-top: 4px;
}
@media #{$small} {
display: block;
padding-bottom: calc(var(--spacing) * 0.5);
.btn--go-to {
top: calc(var(--padding-inner)*1);
bottom: auto;
top: auto;
bottom: calc(var(--padding-inner) * 1);
}
.group-top {
top: 0px;
margin-bottom: calc(var(--spacing) * 0.5);
}
.title {
grid-column: 2;
grid-row: 2;
font-size: var(--fs-normal);
line-height: var(--leading-title);
font-weight: 500;
text-transform: uppercase;
margin-right: 4ch;
margin-bottom: calc(var(--spacing) * 0.75);
margin-right: 1ch;
}
.date {
font-size: var(--fs-small);
grid-column: 2;
grid-row: 1;
margin-top: 4px;
margin-top: 0px;
}
@media #{$small} {
display: block;
padding-bottom: calc(var(--spacing)*0.5);
.btn--go-to{
top: auto;
bottom: calc(var(--padding-inner)*1);
}
.group-top {
top: 0px;
margin-bottom: calc(var(--spacing)*0.5);
}
.title{
margin-bottom: calc(var(--spacing)*0.75);
margin-right: 1ch;
}
.date{
margin-top:0px;
}
}
}
}
.card--block-small {
.card--open-graph {
grid-column: 2;
z-index: 10;
grid-column: 2;
z-index: 10;
}
.card--open-graph:not(:last-child) {
margin-bottom: 1rem;
}
.open-graph__details {
grid-column: 2;
summary,
.summary-inner {
display: flex;
align-items: center;
cursor: pointer;
gap: 0.5ch;
}
.open-graph__details {
grid-column: 2;
.arrow-details {
line-height: 0;
--size: 11px;
height: var(--size);
width: var(--size);
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
top: -2px;
svg {
transition: transform 0.2s ease-in;
width: 100%;
fill: var(--color-txt);
}
}
summary:hover {
color: var(--color-txt);
.arrow-details svg {
fill: var(--color-txt);
}
}
&[open] {
.arrow-details svg {
transform: rotate(90deg);
}
}
summary {
color: var(--color-txt-light);
.arrow-details svg {
fill: var(--color-txt-light);
}
}
@media #{$x-small} {
summary {
@include grid-content();
grid-row-gap: 0;
summary,
.summary-inner {
display: flex;
align-items: center;
cursor: pointer;
gap: 0.5ch;
grid-column: 2;
}
}
.arrow-details {
line-height: 0;
--size: 11px;
height: var(--size);
width: var(--size);
display: inline-flex;
align-items: center;
justify-content: center;
position: relative;
top: -2px;
svg {
transition: transform 0.2s ease-in;
width: 100%;
fill: var(--color-txt);
}
}
summary:hover {
color: var(--color-txt);
.arrow-details svg {
fill: var(--color-txt);
}
}
&[open] {
.arrow-details svg {
transform: rotate(90deg);
}
}
summary {
color: var(--color-txt-light);
.arrow-details svg {
fill: var(--color-txt-light);
}
}
@media #{$x-small} {
summary {
@include grid-content();
grid-row-gap: 0;
.summary-inner {
grid-column: 2;
}
}
grid-column: 1/3;
}
grid-column: 1/3;
}
}
}
}

View file

@ -1,112 +1,102 @@
.type{
height: calc(var(--h-block)*0.75);
// border-radius: calc(var(--h-block)*0.75/2);
border-radius: var(--radius-small);
.type {
height: calc(var(--h-block) * 0.75);
// border-radius: calc(var(--h-block)*0.75/2);
border-radius: var(--radius-small);
width: max-content;
display: inline-flex;
align-items: center;
justify-content: center;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1ch;
padding-top: 3px;
font-size: var(--fs-xsmall);
line-height: 1;
font-weight: 500;
background-color: var(--color-txt);
color: var(--color-bg);
overflow: hidden;
white-space: nowrap;
}
.category {
height: calc(var(--h-block) * 0.75);
border-radius: var(--radius-small);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1ch;
padding-top: 3px;
font-size: var(--fs-xsmall);
line-height: 1;
font-weight: 500;
border: var(--border-medium);
background-color: var(--color-bg);
color: var(--color-txt-light);
overflow: hidden;
white-space: nowrap;
}
.page__category {
height: calc(var(--h-block) * 1);
border-radius: var(--radius-small);
border: var(--border-medium);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1.5ch;
padding-top: 5px;
font-size: var(--fs-small);
background-color: var(--color-bg);
color: var(--color-txt-light);
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-transform: uppercase;
@media #{$small} {
height: calc(var(--h-block) * 0.75);
font-size: var(--fs-xsmall);
padding: 0 1ch;
padding-top: 3px;
font-size: var(--fs-xsmall);
line-height: 1;
font-weight: 500;
background-color: var(--color-txt);
color: var(--color-bg);
overflow: hidden;
white-space: nowrap;
}
}
.page__type {
height: calc(var(--h-block) * 1);
border-radius: var(--radius-small);
margin-left: calc(var(--padding-inner) * 0.25);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1.5ch;
padding-top: 5px;
.category{
height: calc(var(--h-block)*0.75);
border-radius: var(--radius-small);
font-size: var(--fs-small);
display: inline-flex;
align-items: center;
justify-content: center;
background-color: var(--color-txt);
color: var(--color-bg);
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-transform: uppercase;
@media #{$small} {
height: calc(var(--h-block) * 0.75);
font-size: var(--fs-xsmall);
padding: 0 1ch;
padding-top: 3px;
font-size: var(--fs-xsmall);
line-height: 1;
font-weight: 500;
border: var(--border-medium);
background-color: var(--color-bg);
color: var(--color-txt-light);
overflow: hidden;
white-space: nowrap;
}
}
.page__category{
height: calc(var(--h-block)*1);
border-radius: var(--radius-small);
border: var(--border-medium);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1.5ch;
padding-top: 5px;
font-size: var(--fs-small);
background-color: var(--color-bg);
color: var(--color-txt-light);
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-transform: uppercase;
@media #{$small} {
height: calc(var(--h-block)*0.75);
font-size: var(--fs-xsmall);
padding: 0 1ch;
padding-top: 3px;
}
}
.page__type{
height: calc(var(--h-block)*1);
border-radius: var(--radius-small);
margin-left: calc(var(--padding-inner)*0.25);
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 1.5ch;
padding-top: 5px;
font-size: var(--fs-small);
background-color: var(--color-txt);
color: var(--color-bg);
font-weight: 500;
overflow: hidden;
white-space: nowrap;
text-transform: uppercase;
@media #{$small} {
height: calc(var(--h-block)*0.75);
font-size: var(--fs-xsmall);
padding: 0 1ch;
padding-top: 3px;
}
}

View file

@ -138,8 +138,11 @@ img {
cursor: pointer;
}
.swiper-button-next, .swiper-button-prev,
body, #site-header, #site-footer {
.swiper-button-next,
.swiper-button-prev,
body,
#site-header,
#site-footer {
transition: background-color 0.3s ease, color 0.3s ease;
}
@ -741,6 +744,8 @@ button:disabled {
.type {
height: calc(var(--h-block) * 0.75);
border-radius: var(--radius-small);
width: -moz-max-content;
width: max-content;
display: inline-flex;
align-items: center;
justify-content: center;
@ -1951,13 +1956,13 @@ figcaption,
top: -1px;
left: 0;
}
.card--package:hover,
.card--article-small:hover {
.card--package:not([data-impact-type=media]):hover,
.card--article-small:not([data-impact-type=media]):hover {
background-color: var(--grey-950);
border-color: var(--color-txt);
}
.card--package:hover::before,
.card--article-small:hover::before {
.card--package:not([data-impact-type=media]):hover::before,
.card--article-small:not([data-impact-type=media]):hover::before {
border-color: var(--color-txt);
}
@media screen and (max-width: 1080px) {
@ -2025,11 +2030,11 @@ figcaption,
top: -1px;
left: 0;
}
.card--block:hover {
.card--block:not([data-impact-type=media]):hover {
background-color: var(--grey-950);
border-color: var(--color-txt);
}
.card--block:hover::before {
.card--block:not([data-impact-type=media]):hover::before {
border-color: var(--color-txt);
}
.card--block > figure {
@ -2156,11 +2161,11 @@ figcaption,
top: -1px;
left: 0;
}
.card--block-small:hover {
.card--block-small:not([data-impact-type=media]):hover {
background-color: var(--grey-950);
border-color: var(--color-txt);
}
.card--block-small:hover::before {
.card--block-small:not([data-impact-type=media]):hover::before {
border-color: var(--color-txt);
}
.card--block-small .group-top {
@ -2235,7 +2240,7 @@ figcaption,
margin-right: 1ch;
}
.card--block-small .date {
margin-top: 0px;
margin-top: 0px;
}
}
@ -2243,6 +2248,9 @@ figcaption,
grid-column: 2;
z-index: 10;
}
.card--block-small .card--open-graph:not(:last-child) {
margin-bottom: 1rem;
}
.card--block-small .open-graph__details {
grid-column: 2;
}

File diff suppressed because one or more lines are too long