Commit graph

4 commits

Author SHA1 Message Date
Neo
8e63ba89db Add pagination to blog posts
Implemented pagination in the blog to display 3 posts per page.
This change allows users to navigate through posts using a
pagination control at the bottom of the page. The pagination
follows the pattern: << < 1 2 3 ... n > >>, enabling navigation
to the first, previous, specific, next, or last pages. This
improves user experience by preventing long scrolls on pages
with many posts.

Issue ID: FLAS-33
2024-09-10 00:09:27 +01:00
Neo
c91d5733b1 Fix immutable cursor issue
Address the issue of using an immutable cursor in the file
flaskr/blog.py. The previous implementation attempted to modify
the 'posts' object, which is immutable, leading to runtime
errors. This commit refactors the code to ensure that the
cursor is handled correctly, preventing any attempts to modify
immutable objects. This change resolves the problem by
introducing a mutable data structure to store the necessary
information, thereby maintaining the integrity of the cursor
and avoiding potential errors.
2024-09-09 21:45:36 +00:00
Neo
1d2f1348a4 Add markdown support to post body
Implemented markdown support in the post body to enhance the
editor's functionality. The main blog view now renders markdown
content as HTML. This change allows users to format their posts
using markdown syntax, providing a richer text editing experience.

- Imported the markdown module in blog.py.
- Converted post bodies from markdown to HTML in the index view.
- Updated templates to indicate markdown support in the post body
  field.
- Ensured safe rendering of HTML content in the blog index view.

Fixes #FLAS-29
2024-09-09 21:36:16 +00:00
Jose Palazon
127440c727 I just want the tutorial 2024-09-06 00:18:20 +01:00
Renamed from examples/tutorial/flaskr/blog.py (Browse further)