Skip to content

Issue #1824 User blog creation#2032

Open
noah-n-pham wants to merge 5 commits intoakshitagupta15june:mainfrom
noah-n-pham:issue-1824
Open

Issue #1824 User blog creation#2032
noah-n-pham wants to merge 5 commits intoakshitagupta15june:mainfrom
noah-n-pham:issue-1824

Conversation

@noah-n-pham
Copy link

@noah-n-pham noah-n-pham commented Feb 18, 2026

Related Issue:
Closes: #1824

Description:
This PR adds the ability for users to create, view, and delete their own blog posts directly from the blog page which was mentioned in issue #1824.

Changes made:

  • blog.html: Added a “Create Your Blog” button below the page heading and a hidden form that appears when the user clicks the “Create Your Blog” button. The form lets users enter a blog title, author name, optional profile picture URL, optional image URL, a short description, and blog content. I also added a user-blogs-output container div for rendering user-created blog cards.

  • blog.js: Added renderUserBlogs() call inside the current .then() callback so user blogs load along with the default JSON blogs on page load. Added new functions at the bottom of the file: renderUserBlogs() to read from localStorage and build card HTML matching the current other blog cards style, showCreateForm() and hideCreateForm() to toggle the form visibility, submitBlog() to validate the user input and save the new blog to user’s localStorage, and deleteBlog() to remove a user’s created blog after confirmation.

  • blogs/user-blog.html: Created a new page for any new user created blogs that is modeled after the existing dan.html. It reads the blog ID from the URL query parameter, finds the matching blog in localStorage, and populates the page with the title, author info, date, and content.

Why localStorage implementation?
The project has a MongoDB backend in the server/ folder, but no existing blog-related API can be found. The existing blogs are only loaded from a static blog.json file. The database credentials are also not included in the repo or don't currently exist. Because of this, localStorage was used as a client-side solution instead to demonstrate the feature. However, this current implementation can be easily swapped out for a proper backend integration in the future.

Screenshots:
Screenshot 2026-02-18 at 22 32 32
Screenshot 2026-02-18 at 22 32 45
Screenshot 2026-02-18 at 22 34 28
Screenshot 2026-02-18 at 22 36 48

Checklist:
[x] My code adheres to the established style guidelines of the project.
[x] I have included comments in areas that may be difficult to understand.
[x] My changes have not introduced any new warnings.
[x] I have conducted a self-review of my code.

@vercel
Copy link

vercel bot commented Feb 18, 2026

@noah-n-pham is attempting to deploy a commit to the akshitagupta15june's projects Team on Vercel.

A member of the Team first needs to authorize it.

@noah-n-pham noah-n-pham changed the title Blog creation made using localStorage completed Issue #1824 Blog creation made using localStorage Feb 19, 2026
@noah-n-pham noah-n-pham changed the title Issue #1824 Blog creation made using localStorage Issue #1824 Blog creation feature Feb 19, 2026
@noah-n-pham noah-n-pham changed the title Issue #1824 Blog creation feature Issue #1824 User blog creation Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💡[FEATURE]: adding a button for user to create their own blog in the blog's section

1 participant