From 54f9fdab1c5a5a057a5220855455391e4e534d7c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:43:14 +0000 Subject: [PATCH 1/5] Initial plan From 059386dfb880477e31272534b49abbb362788bf6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:46:55 +0000 Subject: [PATCH 2/5] Extract CSS to separate file and streamline workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Extract CSS from inline styles to external styles.css for better caching - Reduce HTML file size from 10,629 to 8,492 bytes (20% reduction) - Consolidate workflow file operations, removing redundant checks - Remove 84 lines of duplicate CSS from workflow (59% reduction: 142→58 lines) - Simplify feed file copying with single find operation Co-authored-by: monk-blade <1335766+monk-blade@users.noreply.github.com> --- .github/workflows/deploy.yml | 91 ++---------------------------------- index.html | 77 +----------------------------- styles.css | 74 +++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 163 deletions(-) create mode 100644 styles.css diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b5bb7e835..6c5c3ba66 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,94 +33,11 @@ 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/ - 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 + # Copy all feed files in one operation + [ -d "feeds" ] && find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) -exec cp {} _site/feeds/ \; || true # List what we're deploying echo "Site contents:" diff --git a/index.html b/index.html index ffea73da9..7dad1b2cd 100644 --- a/index.html +++ b/index.html @@ -4,82 +4,7 @@ RSS Feeds - +
diff --git a/styles.css b/styles.css new file mode 100644 index 000000000..80ebff3be --- /dev/null +++ b/styles.css @@ -0,0 +1,74 @@ +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 { + text-align: center; + margin-bottom: 40px; + padding: 20px; + background: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); +} +.feed { + margin: 20px 0; + padding: 20px; + background: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); + 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; + padding: 20px; + background: white; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0,0,0,0.1); +} +.feed-count { + background: #3498db; + color: white; + padding: 5px 15px; + border-radius: 20px; + font-size: 0.8em; + display: inline-block; + margin-bottom: 20px; +} From b6c2e80a7beb1ae56f1fbb6dfa1ae1da0e5a93f4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:48:41 +0000 Subject: [PATCH 3/5] Add minification and dynamic feed count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implement CSS minification (1.6K → 1.2K, 25% reduction) - Implement HTML minification (8.3K → 7.0K, 16% reduction) - Make feed count dynamic based on actual files in feeds directory - Auto-update feed count from hardcoded 20 to actual count (22) Co-authored-by: monk-blade <1335766+monk-blade@users.noreply.github.com> --- .github/workflows/deploy.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 6c5c3ba66..af3f60373 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,9 +39,33 @@ jobs: # Copy all feed files in one operation [ -d "feeds" ] && find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) -exec cp {} _site/feeds/ \; || true + # Count feeds dynamically and update index.html + FEED_COUNT=$(find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) | wc -l) + sed -i "s/20 Active Feeds/${FEED_COUNT} Active Feeds/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 + cleancss -o _site/styles.min.css _site/styles.css + rm _site/styles.css + + # Update HTML to reference minified CSS + sed -i 's/styles\.css/styles.min.css/g' _site/index.html + + # Minify HTML + html-minifier --collapse-whitespace --remove-comments --minify-css true --minify-js true -o _site/index.min.html _site/index.html + mv _site/index.min.html _site/index.html + + # Show size savings + echo "Optimized file sizes:" + ls -lh _site/index.html _site/styles.min.css - name: Upload artifact uses: actions/upload-pages-artifact@v3 From 413b4556acbec7965a00e94bb795c7f222ce21ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:50:06 +0000 Subject: [PATCH 4/5] Optimize CSS by consolidating duplicate styles - Consolidate common styles for .header, .feed, and .updated classes - Reduce CSS file size from 1,566 to 1,373 bytes (12% reduction) - Streamline workflow minification process (remove intermediate file) Co-authored-by: monk-blade <1335766+monk-blade@users.noreply.github.com> --- .github/workflows/deploy.yml | 13 +++++-------- styles.css | 18 ++++++------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index af3f60373..5e66972cf 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -52,18 +52,15 @@ jobs: # Install minification tools npm install -g clean-css-cli html-minifier - # Minify CSS + # Minify CSS and update HTML reference in one step cleancss -o _site/styles.min.css _site/styles.css - rm _site/styles.css - - # Update HTML to reference minified CSS sed -i 's/styles\.css/styles.min.css/g' _site/index.html - # Minify HTML - html-minifier --collapse-whitespace --remove-comments --minify-css true --minify-js true -o _site/index.min.html _site/index.html - mv _site/index.min.html _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 - # Show size savings + # 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 diff --git a/styles.css b/styles.css index 80ebff3be..544a57db3 100644 --- a/styles.css +++ b/styles.css @@ -6,20 +6,18 @@ body { line-height: 1.6; background-color: #f8f9fa; } -.header { - text-align: center; - margin-bottom: 40px; - padding: 20px; +.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; - padding: 20px; - background: white; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0,0,0,0.1); transition: transform 0.2s ease; } .feed:hover { @@ -58,10 +56,6 @@ body { font-size: 0.9em; text-align: center; margin-top: 40px; - padding: 20px; - background: white; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0,0,0,0.1); } .feed-count { background: #3498db; From 74c82ad9078adcf6d7508dea9aa23f3d77d5031f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:51:55 +0000 Subject: [PATCH 5/5] Address code review feedback - improve robustness - Use placeholder token {{FEED_COUNT}} instead of hardcoded text - Eliminate duplicate find operations (store results in variable) - Use more specific sed pattern for CSS link replacement - Handle edge case when no feed files exist (set count to 0) Co-authored-by: monk-blade <1335766+monk-blade@users.noreply.github.com> --- .github/workflows/deploy.yml | 17 +++++++++++------ index.html | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5e66972cf..2117c22af 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,12 +36,17 @@ jobs: # Copy static files cp index.html styles.css _site/ - # Copy all feed files in one operation - [ -d "feeds" ] && find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) -exec cp {} _site/feeds/ \; || true + # 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 - # Count feeds dynamically and update index.html - FEED_COUNT=$(find feeds -type f \( -name "*.xml" -o -name "*.rss" -o -name "*.atom" -o -name "*.json" \) | wc -l) - sed -i "s/20 Active Feeds/${FEED_COUNT} Active Feeds/g" _site/index.html + # 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:" @@ -54,7 +59,7 @@ jobs: # Minify CSS and update HTML reference in one step cleancss -o _site/styles.min.css _site/styles.css - sed -i 's/styles\.css/styles.min.css/g' _site/index.html + 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 diff --git a/index.html b/index.html index 7dad1b2cd..926e1c0a9 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@

🎯 RSS Feed Collection

- 20 Active Feeds + {{FEED_COUNT}} Active Feeds