slice things up in partials for modularity
This commit is contained in:
parent
c9a800d5fa
commit
b702ce6cda
6 changed files with 135 additions and 127 deletions
24
themes/one-pager/layouts/partials/videos.html
Normal file
24
themes/one-pager/layouts/partials/videos.html
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<!-- VIDEO SECTION -->
|
||||
<section id="videos" class="section">
|
||||
<h2>Vidz</h2>
|
||||
<div style="text-align: right; margin-bottom: 1rem;">
|
||||
<button onclick="refreshVideos()" class="refresh-button">
|
||||
<span>🎲 Randomize</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="video-grid" id="videoGrid">
|
||||
{{ $allVideos := slice }}
|
||||
{{ range $path, $entries := hugo.Data.videos }}
|
||||
{{ range $entries }}
|
||||
{{ $allVideos = $allVideos | append . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- Store all videos data in a JSON array -->
|
||||
{{ $videosData := jsonify $allVideos }}
|
||||
<script>
|
||||
window.allVideosData = {{ $videosData | safeJS }};
|
||||
</script>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
Loading…
Add table
Add a link
Reference in a new issue