Skip to content

Commit 48cfdfd

Browse files
Copilotlazyparser
andauthored
fix: lock down legacy HTML handling
Co-authored-by: lazyparser <1802104+lazyparser@users.noreply.github.com>
1 parent aa77ab3 commit 48cfdfd

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

themes/osdt-tech/assets/css/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ a:hover { color: #b6f4ff; }
2828
position: fixed; inset: 0; pointer-events: none; opacity: .16;
2929
background-image: linear-gradient(rgba(110,231,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(110,231,255,.08) 1px, transparent 1px);
3030
background-size: 36px 36px;
31+
-webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 92%);
3132
mask-image: linear-gradient(to bottom, rgba(0,0,0,.65), transparent 92%);
3233
}
3334
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

themes/osdt-tech/layouts/_default/home.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{{ define "main" }}
22
{{ $pages := .Site.RegularPages }}
3-
{{ $readmeCategory := .Site.Params.readmeHistoryCategory }}
4-
{{ $eventCategory := .Site.Params.eventCategory }}
53
{{ $readmePages := where $pages "Type" "readme-history" }}
64
{{ $articlePages := where $pages "Type" "ne" "readme-history" }}
75
{{ $recent := first 6 (sort $articlePages "Date" "desc") }}
6+
{{ $events := slice }}
7+
{{ with .Site.Params.eventCategory }}
8+
{{ $events = where $articlePages "Params.categories" "intersect" (slice .) }}
9+
{{ end }}
810
{{ $updates := first 4 (sort $readmePages "Date" "desc") }}
9-
{{ $events := where $articlePages "Params.categories" "intersect" (slice $eventCategory) }}
1011
<section class="hero shell">
1112
<div class="hero-copy">
1213
<p class="eyebrow">Hugo · Tech Blog · Community Archive</p>

themes/osdt-tech/layouts/_default/list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1>{{ .Title }}</h1>
66
{{ with .Content }}<div class="page-copy">{{ . }}</div>{{ end }}
77
</header>
88
{{ $pages := .RegularPagesRecursive }}
9-
{{ if eq .RelPermalink "/posts/" }}
9+
{{ if eq .Section "posts" }}
1010
{{ $pages = where $pages "Type" "ne" "readme-history" }}
1111
{{ end }}
1212
{{ if gt (len $pages) 0 }}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
{{ .Inner | safeHTML }}
1+
{{- $html := trim .Inner "\n\r\t " -}}
2+
{{- $isIframe := gt (len (findRE `(?s)^<iframe[\s\S]*</iframe>$` $html)) 0 -}}
3+
{{- $isTable := gt (len (findRE `(?s)^<table[\s\S]*</table>$` $html)) 0 -}}
4+
{{- if or $isIframe $isTable -}}
5+
{{ $html | safeHTML }}
6+
{{- end -}}

0 commit comments

Comments
 (0)