gmgauthier.com/layouts/shortcodes/pdflist.html

23 lines
573 B
HTML
Raw Permalink Normal View History

2021-11-27 14:09:56 +00:00
{{ $path := $.Page.Dir }}
{{ $filePath := printf "content/%s" ($path) }}
{{ $withCaptions := .Get "withCaptions"}}
{{ $gallery := .Get "id" }}
{{ range readDir ($filePath) }}
{{ $display := strings.HasSuffix .Name "pdf" }}
{{ $caption := substr .Name 0 128 }}
{{ if $display}}
<div class="file-list-item">
<a href="{{.Name}}">
<i class="fas fa-file-pdf"></i> {{ $caption}}
</a>
</div>
{{ end }}
{{ end }}
<style type="text/css">
.file-list-item {
word-break: break-all;
}
</style>