diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b5bb7e835..2117c22af 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,98 +33,41 @@ jobs: # Create the site directory structure mkdir -p _site/feeds - # Copy index.html if it exists, otherwise create a basic one - if [ -f "index.html" ]; then - cp index.html _site/ - else - cat > _site/index.html << 'EOF' - - - - - - RSS Feeds - - - -
-

🎯 RSS Feed Collection

-
- -
-
RSS Feeds
-

RSS feed files will appear here when uploaded.

-
- -
- Last updated: $(date -u '+%Y-%m-%d %H:%M:%S UTC') -
- - - EOF - fi + # Copy static files + cp index.html styles.css _site/ - # Copy all XML/RSS feed files to the feeds directory - if ls feeds/*.xml 1> /dev/null 2>&1; then - cp feeds/*.xml _site/feeds/ - fi - - if ls feeds/*.rss 1> /dev/null 2>&1; then - cp feeds/*.rss _site/feeds/ + # Copy all feed files and count them in one pass + FEED_FILES=$(find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) 2>/dev/null || true) + if [ -n "$FEED_FILES" ]; then + echo "$FEED_FILES" | xargs -I {} cp {} _site/feeds/ + FEED_COUNT=$(echo "$FEED_FILES" | wc -l) + else + FEED_COUNT=0 fi - # Copy any other feed files that might exist - if [ -d "feeds" ]; then - find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) -exec cp {} _site/feeds/ \; - fi + # Update feed count in HTML using placeholder token + sed -i "s/{{FEED_COUNT}}/${FEED_COUNT}/g" _site/index.html # List what we're deploying echo "Site contents:" find _site -type f | sort + + - name: Minify CSS and HTML + run: | + # Install minification tools + npm install -g clean-css-cli html-minifier + + # Minify CSS and update HTML reference in one step + cleancss -o _site/styles.min.css _site/styles.css + sed -i 's|||g' _site/index.html + + # Minify HTML in place + html-minifier --collapse-whitespace --remove-comments --minify-css true --minify-js true -o _site/index.html _site/index.html + + # Clean up unminified CSS and show size savings + rm _site/styles.css + echo "Optimized file sizes:" + ls -lh _site/index.html _site/styles.min.css - name: Upload artifact uses: actions/upload-pages-artifact@v3 diff --git a/index.html b/index.html index ffea73da9..926e1c0a9 100644 --- a/index.html +++ b/index.html @@ -4,88 +4,13 @@ RSS Feeds - +

🎯 RSS Feed Collection

- 20 Active Feeds + {{FEED_COUNT}} Active Feeds
diff --git a/styles.css b/styles.css new file mode 100644 index 000000000..544a57db3 --- /dev/null +++ b/styles.css @@ -0,0 +1,68 @@ +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; + max-width: 900px; + margin: 0 auto; + padding: 20px; + line-height: 1.6; + background-color: #f8f9fa; +} +.header, .feed, .updated { + background: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + padding: 20px; +} +.header { + text-align: center; + margin-bottom: 40px; +} +.feed { + margin: 20px 0; + transition: transform 0.2s ease; +} +.feed:hover { + transform: translateY(-2px); + box-shadow: 0 4px 20px rgba(0,0,0,0.15); +} +.feed-title { + font-size: 1.3em; + font-weight: 600; + margin-bottom: 10px; + color: #2c3e50; +} +.feed-url { + margin: 10px 0; +} +.feed-url a { + color: #3498db; + text-decoration: none; + font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace; + font-size: 0.9em; + padding: 5px 10px; + background: #ecf0f1; + border-radius: 5px; + word-break: break-all; +} +.feed-url a:hover { + background: #d5dbdb; +} +.feed-description { + color: #7f8c8d; + font-style: italic; + margin-top: 10px; +} +.updated { + color: #95a5a6; + font-size: 0.9em; + text-align: center; + margin-top: 40px; +} +.feed-count { + background: #3498db; + color: white; + padding: 5px 15px; + border-radius: 20px; + font-size: 0.8em; + display: inline-block; + margin-bottom: 20px; +}