feat: add pagination support to feeds#173
Merged
WaylonWalker merged 26 commits intodevelopfrom Jan 22, 2026
Merged
Conversation
- Add feed pagination configuration (items_per_page, pagination_type) - Implement three pagination types: htmx, manual, js - Add pagination templates for different UX patterns - Include HTMX infinite scroll with partial loading - Add JavaScript-based infinite scroll fallback - Support manual page navigation - Improve feed name sanitization with Python identifier conversion
Deploying markata with
|
| Latest commit: |
89f316c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c15a1803.markata.pages.dev |
| Branch Preview URL: | https://feeds-are-too-big.markata.pages.dev |
- Add SHA-256 integrity verification for HTMX downloads with timeout - Remove unsafe CDN fallback, fail securely on download errors - Sanitize config data in templates to prevent XSS injection - Implement path traversal protection for feed slugs - Fix duplicate resource injection in _ensure_head_links() - Eliminate unsafe state mutation in pagination - Add comprehensive security test suite Addresses all critical issues from PR173-Security-Review.md
Security fixes: - Add SHA-256 integrity verification for HTMX downloads with timeout - Remove unsafe CDN fallback, fail securely on download errors - Sanitize config data in templates to prevent XSS injection - Implement path traversal protection for feed slugs - Fix duplicate resource injection in _ensure_head_links() - Eliminate unsafe state mutation in pagination - Add comprehensive security test suite Template refactoring: - Extract 115-line pagination-js.js module with infinite scroll logic - Generate pagination-config.js only when JS pagination is needed - Replace 277-line template with 85-line clean template (70% reduction) - Move CSS to existing pagination.css file - Fix template variable conflicts (config vs pagination_context) - Remove orphaned pagination.js file, keep pagination-js.js Addresses all critical security issues and eliminates template bloat while maintaining functionality.
- Rename pagination-js.js to pagination.js to simplify naming - Update all plugin references from pagination-js.js to pagination.js - Update template script src reference to use pagination.js - Maintains functionality with cleaner file naming
- Update pagination implementation guide to reference correct plugins - Remove unneeded temporary files (paginated_feeds.py, pagination.py, partial/, etc.) - Correct documentation to focus on feeds.py with integrated pagination - Remove references to non-existent pagination plugin hooks - Provide accurate examples for current implementation Documentation now accurately reflects the actual codebase structure with pagination integrated into feeds plugin.
- Add from __future__ import annotations for PEP 563 deferred evaluation - Move SilentUndefined and MarkataFilterError outside TYPE_CHECKING block - Clean up duplicate imports and consolidate rich imports - Add per_page validation to prevent division by zero - Handle empty feeds gracefully (create one empty page) - Add XSS protection with |tojson filter in feed_partial.html template - Add response.ok check in pagination.js fetch handling - Add retry limit (maxRetries=3) for infinite scroll to prevent loops - Add showError method to display error message after max retries - Add destroy method and beforeunload cleanup to prevent memory leaks - Add container null check before DOM manipulation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add pagination support to feeds with three pagination types and comprehensive security hardening.
Features
items_per_page,pagination_type,enabled)htmx,manual,jsSecurity
|tojsonfilterOther Changes
feed_partial.html,feed_items_partial.html,pagination_controls.html)