diff --git a/themes/one-pager/layouts/index.html b/themes/one-pager/layouts/index.html index 27f4a9a..6d27d91 100644 --- a/themes/one-pager/layouts/index.html +++ b/themes/one-pager/layouts/index.html @@ -23,140 +23,17 @@ {{ partial "header.html" . }} - - - Now Log - - {{ $blogPosts := slice }} - {{ range $path, $entries := hugo.Data.longform }} - {{ range $entries }} - {{ $blogPosts = $blogPosts | append . }} - {{ end }} - {{ end }} - - {{ $sortedPosts := sort $blogPosts "created_at" "desc" }} - {{ range first 2 $sortedPosts }} - {{ $title := "" }} - {{ $summary := "" }} - {{ $image := "" }} - {{ $tags := slice }} - {{ $d := "" }} - {{ $createdAt := int .created_at }} - - {{ range .tags }} - {{ if eq (index . 0) "title" }} - {{ $title = index . 1 }} - {{ else if eq (index . 0) "summary" }} - {{ $summary = index . 1 }} - {{ else if eq (index . 0) "image" }} - {{ $image = index . 1 }} - {{ else if eq (index . 0) "t" }} - {{ $tags = $tags | append (index . 1) }} - {{ else if eq (index . 0) "d" }} - {{ $d = index . 1 }} - {{ end }} - {{ end }} - - - {{ if $image }} - - {{ end }} - - {{ $title }} - - {{ dateFormat "January 2, 2006" (time (int .created_at)) }} - - {{ if $summary }} - {{ $summary }} - {{ end }} - - {{ range $tags }} - {{ . }} - {{ end }} - - Read More - - {{ .content | markdownify }} - - - - {{ end }} - - - - - Music Traxxx - - - 🎲 Randomize - - - - {{ $allMusic := slice }} - {{ range $path, $entries := hugo.Data.music }} - {{ range $entries }} - {{ $allMusic = $allMusic | append . }} - {{ end }} - {{ end }} + {{ partial "blog.html" . }} - {{ $musicData := jsonify $allMusic }} - - - + {{ partial "music.html" . }} - - - Pix & Doodles - - - 🎲 Randomize - - - - {{ $allPictures := slice }} - {{ range $path, $entries := hugo.Data.pictures }} - {{ range $entries }} - {{ $allPictures = $allPictures | append . }} - {{ end }} - {{ end }} + {{ partial "pictures.html" . }} - - {{ $picturesData := jsonify $allPictures }} - - - + {{ partial "videos.html" . }} - - - Vidz - - - 🎲 Randomize - - - - {{ $allVideos := slice }} - {{ range $path, $entries := hugo.Data.videos }} - {{ range $entries }} - {{ $allVideos = $allVideos | append . }} - {{ end }} - {{ end }} - - - {{ $videosData := jsonify $allVideos }} - - - - {{ partial "footer.html" . }} diff --git a/themes/one-pager/layouts/partials/blog.html b/themes/one-pager/layouts/partials/blog.html new file mode 100644 index 0000000..06cadd9 --- /dev/null +++ b/themes/one-pager/layouts/partials/blog.html @@ -0,0 +1,60 @@ + + + Now Log + + {{ $blogPosts := slice }} + {{ range $path, $entries := hugo.Data.longform }} + {{ range $entries }} + {{ $blogPosts = $blogPosts | append . }} + {{ end }} + {{ end }} + + {{ $sortedPosts := sort $blogPosts "created_at" "desc" }} + {{ range first 2 $sortedPosts }} + {{ $title := "" }} + {{ $summary := "" }} + {{ $image := "" }} + {{ $tags := slice }} + {{ $d := "" }} + {{ $createdAt := int .created_at }} + + {{ range .tags }} + {{ if eq (index . 0) "title" }} + {{ $title = index . 1 }} + {{ else if eq (index . 0) "summary" }} + {{ $summary = index . 1 }} + {{ else if eq (index . 0) "image" }} + {{ $image = index . 1 }} + {{ else if eq (index . 0) "t" }} + {{ $tags = $tags | append (index . 1) }} + {{ else if eq (index . 0) "d" }} + {{ $d = index . 1 }} + {{ end }} + {{ end }} + + + {{ if $image }} + + {{ end }} + + {{ $title }} + + {{ dateFormat "January 2, 2006" (time (int .created_at)) }} + + {{ if $summary }} + {{ $summary }} + {{ end }} + + {{ range $tags }} + {{ . }} + {{ end }} + + Read More + + {{ .content | markdownify }} + + + + {{ end }} + + diff --git a/themes/one-pager/layouts/partials/footer.html b/themes/one-pager/layouts/partials/footer.html index 5335edb..958115f 100644 --- a/themes/one-pager/layouts/partials/footer.html +++ b/themes/one-pager/layouts/partials/footer.html @@ -1,3 +1,5 @@ + +
- {{ dateFormat "January 2, 2006" (time (int .created_at)) }} -
{{ $summary }}
+ {{ dateFormat "January 2, 2006" (time (int .created_at)) }} +