feat: add redaction
This commit is contained in:
parent
a35946ae92
commit
b2dba13746
8 changed files with 1373 additions and 103 deletions
|
@ -1,13 +0,0 @@
|
|||
<!--. is .c-->
|
||||
<!--$ is .g-->
|
||||
|
||||
{{ $scratch := .g.Scratch }}
|
||||
{{ if .c.Parent }}
|
||||
{{ if ne .c.Parent.Type "cv/organisations" }}
|
||||
{{ with .c.Parent }}
|
||||
{{ partial "cv/organisations/recursive-parents.html" (dict "c" . "g" $.g ) }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ $scratch.Set "top-level-parent" .c.Parent }}
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -9,30 +9,44 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Pages }}
|
||||
{{- range .Pages -}}
|
||||
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
|
||||
<tr>
|
||||
<td>
|
||||
{{- if .Params.featured_image -}}
|
||||
<img class="organisation-table__logo" loading="lazy" src="
|
||||
{{- if .Resources.GetMatch .Params.featured_image -}}
|
||||
{{- ( .Resources.GetMatch .Params.featured_image ).RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- .Params.featured_image -}}
|
||||
<td>
|
||||
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
|
||||
{{- if ( eq $.Site.Params.redact "black" ) -}}
|
||||
{{- partialCached "redact-black.html" . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Params.featured_image -}}
|
||||
<img class="organisation-table__logo" loading="lazy" src="
|
||||
{{- if .Resources.GetMatch .Params.featured_image -}}
|
||||
{{- ( .Resources.GetMatch .Params.featured_image ).RelPermalink -}}
|
||||
{{- else -}}
|
||||
{{- .Params.featured_image -}}
|
||||
{{- end -}}
|
||||
">
|
||||
{{- end -}}
|
||||
">
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- if .Params.TitleLang -}}<i lang="{{ .Params.TitleLang }}" title="{{ .Params.TitleTrans }}"}>{{- end -}}
|
||||
{{- with .Params.markup_title -}}{{- . | safeHTML -}}{{- else -}}{{- .Title | safeHTML -}}{{- end -}}
|
||||
{{- if .Params.TitleLang -}}</i>{{- end -}}
|
||||
</a>
|
||||
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
|
||||
{{- if ( eq $.Site.Params.redact "black" ) -}}
|
||||
{{- partialCached "redact-black.html" . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- if .Params.TitleLang -}}<i lang="{{ .Params.TitleLang }}" title="{{ .Params.TitleTrans }}"}>{{- end -}}
|
||||
{{- with .Params.markup_title -}}{{- . | safeHTML -}}{{- else -}}{{- .Title | safeHTML -}}{{- end -}}
|
||||
{{- if .Params.TitleLang -}}</i>{{- end -}}
|
||||
</a>
|
||||
{{- end -}}
|
||||
</td>
|
||||
<td>{{- if gt (len .Sections) 0 -}}✔{{- end -}}</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
|
|
@ -1,5 +1,22 @@
|
|||
<li class="hierarchy-item hierarchy-item--child"><a href="{{ .RelPermalink }}">{{ with .Params.markup_title }}{{ . | safeHTML }}{{ else }}{{ .Title | safeHTML }}{{ end }}</a>
|
||||
{{- range .Sections -}}<ul>
|
||||
{{- partialCached "cv/organisations/recursive-children.html" . .Title -}}
|
||||
</ul>{{- end -}}
|
||||
{{- if ( not ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) ) -}}
|
||||
<li class="hierarchy-item hierarchy-item--child">
|
||||
{{- if ( and ( .Params.redact ) ( ne $.Site.Params.redact "show" ) ) -}}
|
||||
{{- if ( eq $.Site.Params.redact "black" ) -}}
|
||||
{{- partialCached "redact-black.html" . -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{- with .Params.markup_title }}
|
||||
{{- . | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{- .Title | safeHTML -}}
|
||||
{{- end -}}
|
||||
</a>
|
||||
{{- range .Sections -}}
|
||||
<ul>
|
||||
{{- partialCached "cv/organisations/recursive-children.html" . .Title -}}
|
||||
</ul>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</li>
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue