diff --git a/.gitignore b/.gitignore index 6f9b8e5..e7d733d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ data fetch-and-convert.sh deploy.sh hugo.toml -content/playlists diff --git a/generate-playlist-pages.sh b/generate-playlist-pages.sh deleted file mode 100755 index affb3f1..0000000 --- a/generate-playlist-pages.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/bash - -# ============================================ -# Generate Hugo Playlist Pages from JSON -# ============================================ - -DATA_FILE="data/playlists/playlists.json" -CONTENT_DIR="content/playlists" - -# Check if data file exists -if [ ! -f "$DATA_FILE" ]; then - echo "❌ Error: $DATA_FILE not found. Run fetch-playlist.sh first." - exit 1 -fi - -# Create content directory -mkdir -p "$CONTENT_DIR" - -# Create _index.md if it doesn't exist -if [ ! -f "$CONTENT_DIR/_index.md" ]; then - cat > "$CONTENT_DIR/_index.md" << 'EOF' ---- -title: "Playlists" ---- -EOF -fi - -# Clear old playlist pages (keep _index.md) -find "$CONTENT_DIR" -maxdepth 1 -type f -name "*.md" ! -name "_index.md" -delete - -# Process each playlist -cat "$DATA_FILE" | jq -c '.playlists[]' | while read -r playlist; do - NAME=$(echo "$playlist" | jq -r '.name // "Untitled Playlist"') - SLUG=$(echo "$NAME" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]//g' | sed 's/--*/-/g' | sed 's/^-//;s/-$//') - - # If slug is empty, use the ID - if [ -z "$SLUG" ] || [ "$SLUG" = "untitled-playlist" ]; then - SLUG=$(echo "$playlist" | jq -r '.id' | head -c 12) - fi - - DESCRIPTION=$(echo "$playlist" | jq -r '.description // ""') - IMAGE=$(echo "$playlist" | jq -r '.image // ""') - TRACKS=$(echo "$playlist" | jq -c '.tracks') - PLAYLIST_ID=$(echo "$playlist" | jq -r '.id') - CREATED_AT=$(echo "$playlist" | jq -r '.created_at') - - # Convert created_at to date - CREATED_DATE=$(date -d "@$CREATED_AT" "+%Y-%m-%d" 2>/dev/null || echo $(date "+%Y-%m-%d")) - - cat > "$CONTENT_DIR/$SLUG.md" < { link.addEventListener('click', function(e) { - const href = this.getAttribute('href'); - // Only intercept if it's a # anchor link - if (href && href.startsWith('#')) { - e.preventDefault(); - const targetId = href; - const targetElement = document.querySelector(targetId); - if (targetElement) { - const navHeight = stickyNav.offsetHeight; - const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset - navHeight - 20; - window.scrollTo({ - top: targetPosition, - behavior: 'smooth' - }); - } + e.preventDefault(); + const targetId = this.getAttribute('href'); + const targetElement = document.querySelector(targetId); + if (targetElement) { + const navHeight = stickyNav.offsetHeight; + const targetPosition = targetElement.getBoundingClientRect().top + window.pageYOffset - navHeight - 20; + window.scrollTo({ + top: targetPosition, + behavior: 'smooth' + }); } - // If it's a regular link (like /playlists/), let it navigate normally }); }); diff --git a/themes/one-pager/layouts/_default/baseof.html b/themes/one-pager/layouts/_default/baseof.html deleted file mode 100644 index a5bf90d..0000000 --- a/themes/one-pager/layouts/_default/baseof.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - {{ partial "seo.html" . }} - - {{ $style := resources.Get "css/style.css" | resources.Minify | fingerprint }} - - - - - - - - {{ block "header" . }}{{ end }} - - -
- - {{ block "main" . }}{{ end }} - -
- - {{ partial "footer.html" . }} - - - - - {{ $js := resources.Get "js/scripts.js" | resources.Minify | fingerprint }} - - - - - diff --git a/themes/one-pager/layouts/_default/index.html b/themes/one-pager/layouts/index.html similarity index 74% rename from themes/one-pager/layouts/_default/index.html rename to themes/one-pager/layouts/index.html index 5930d41..e98fd97 100644 --- a/themes/one-pager/layouts/_default/index.html +++ b/themes/one-pager/layouts/index.html @@ -1,8 +1,28 @@ -{{ define "header" }} -{{ partial "header.html" . }} -{{ end }} + + + + + + + {{ partial "seo.html" . }} -{{ define "main" }} + + + + + + + + + {{ $style := resources.Get "css/style.css" | resources.Minify | fingerprint }} + + + + + + {{ partial "header.html" . }} + +
{{ partial "blog.html" . }} @@ -12,7 +32,11 @@ {{ partial "videos.html" . }} - +
+ + {{ partial "footer.html" . }} + +
@@ -72,4 +96,8 @@
-{{ end }} + + {{ $js := resources.Get "js/scripts.js" | resources.Minify | fingerprint }} + + + diff --git a/themes/one-pager/layouts/partials/header.html b/themes/one-pager/layouts/partials/header.html index c9c7db2..ef94269 100644 --- a/themes/one-pager/layouts/partials/header.html +++ b/themes/one-pager/layouts/partials/header.html @@ -45,7 +45,6 @@ diff --git a/themes/one-pager/layouts/partials/seo.html b/themes/one-pager/layouts/partials/seo.html index 37ba8ea..b20bcf0 100644 --- a/themes/one-pager/layouts/partials/seo.html +++ b/themes/one-pager/layouts/partials/seo.html @@ -88,7 +88,6 @@ - {{ if $picture }} diff --git a/themes/one-pager/layouts/playlists/list.html b/themes/one-pager/layouts/playlists/list.html deleted file mode 100644 index 5394a76..0000000 --- a/themes/one-pager/layouts/playlists/list.html +++ /dev/null @@ -1,37 +0,0 @@ -{{ define "main" }} -
-

Playlists

-

Explore all my curated playlists from the Nostr network

- -
- {{ range .Pages }} - {{ $name := .Title }} - {{ $description := .Params.playlist_description | default "" }} - {{ $image := .Params.playlist_image | default "" }} - {{ $tracks := .Params.playlist_tracks | default slice }} - - - {{ end }} -
-
-{{ end }} \ No newline at end of file diff --git a/themes/one-pager/layouts/playlists/single.html b/themes/one-pager/layouts/playlists/single.html deleted file mode 100644 index 9c2a107..0000000 --- a/themes/one-pager/layouts/playlists/single.html +++ /dev/null @@ -1,137 +0,0 @@ -{{ define "main" }} -{{ $name := .Title }} -{{ $description := .Params.playlist_description | default "" }} -{{ $image := .Params.playlist_image | default "" }} -{{ $tracks := .Params.playlist_tracks | default slice }} -{{ $created_at := .Params.playlist_created_at | default 0 }} - -
-
-
- {{ if $image }} - {{ $name }} - {{ end }} -
-

{{ $name }}

- {{ if $description }} -

{{ $description }}

- {{ end }} -
- 🎵 {{ len $tracks }} tracks - {{ if $created_at }} - 📅 {{ dateFormat "January 2, 2006" (time $created_at) }} - {{ end }} -
-
-
-
- -
- {{ if $tracks }} - {{ range $index, $track := $tracks }} -
-
{{ add $index 1 }}
- {{ if $track.image }} - {{ $track.title }} - {{ end }} -
- {{ $track.title | default "Untitled" }} - {{ $track.artist | default "Unknown Artist" }} - {{ if $track.album }} - {{ $track.album }} - {{ end }} - {{ if $track.duration }} - {{ $track.duration }}s - {{ end }} - {{ if $track.tags }} -
- {{ range $track.tags }} - {{ . }} - {{ end }} -
- {{ end }} -
-
- {{ if $track.url }} - - {{ end }} - {{ if $track.id }} - - {{ end }} -
-
- {{ end }} - {{ else }} -

No tracks found for this playlist.

- {{ end }} -
- - {{ if $tracks }} -
- -
- {{ end }} - - -
- - -{{ end }} \ No newline at end of file