Skip to content

Conversation

Devansh422
Copy link
Contributor

@Devansh422 Devansh422 commented Oct 1, 2025

Description

This PR fixes #2355

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Copy link

welcome bot commented Oct 1, 2025

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Newcomers' Guide and sure to join the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for mesheryio-preview ready!

Name Link
🔨 Latest commit 65f38fa
🔍 Latest deploy log https://app.netlify.com/projects/mesheryio-preview/deploys/68ee0c0b6a87290008e3fc54
😎 Deploy Preview https://deploy-preview-2356--mesheryio-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Summary of Changes

Hello @Devansh422, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new 'Browse by date' feature to the blog's sidebar, significantly enhancing navigation for users. It implements a structured, collapsible archive that organizes blog posts hierarchically by year and month. The changes encompass both the Liquid templating logic required for dynamic content generation and the necessary CSS to ensure proper presentation and user interaction for this new feature.

Highlights

  • New 'Browse by date' Feature: A new section has been added to the blog sidebar, allowing users to browse posts chronologically.
  • Dynamic Archive Generation: Blog posts are now dynamically organized into collapsible sections by year and then by month using Liquid templating.
  • Styling for Archive Index: Dedicated CSS rules have been added to style the new date-based archive navigation, ensuring a clean and interactive user experience.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a 'Browse by date' feature to the blog sidebar, allowing users to navigate posts grouped by year and month. The implementation has some critical issues with HTML validity and uses a complex logic for grouping. I've provided a detailed comment with a suggested refactoring that uses Jekyll's built-in filters to simplify the code, ensure correctness, and improve maintainability. The accompanying CSS changes look good.

Comment on lines 44 to 71
<div class="sidebar-section">
<h3 style="font-size:1.5rem;text-align: center;margin:auto;">Browse by date</h3>
<ul class="archive-index">
{% assign prev_year = '' %}
{% assign prev_month = '' %}
{% for post in site.posts %}
{% assign year = post.date | date: '%Y' %}
{% assign month = post.date | date: '%B' %}

{% if year != prev_year %}
{% if prev_year != '' %}
</ul></details>
</ul></details>
{% endif %}
<details class="archive-year" {% if forloop.first %}open{% endif %}>
<summary>{{ year }}</summary>
<ul class="archive-months">
{% assign prev_month = '' %}
{% endif %}

{% if month != prev_month %}
{% if prev_month != '' %}
</ul></details>
{% endif %}
<details class="archive-month">
<summary>{{ month }}</summary>
<ul class="archive-posts">
{% endif %}

<li><a href="{{ post.url | relative_url }}">{{ post.title }}</a></li>

{% assign prev_year = year %}
{% assign prev_month = month %}

{% if forloop.last %}
</ul></details>
</ul></details>
{% endif %}
{% endfor %}
</ul>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The current implementation for generating the archive list has a couple of issues that lead to invalid HTML and is overly complex, making it hard to maintain.

  1. Invalid HTML Structure: The <details> elements for years and months are placed as direct children of <ul> elements (archive-index and archive-months). According to HTML standards, <ul> elements should only contain <li> elements as direct children. This can cause rendering issues in some browsers.
  2. Complex and Fragile Logic: The logic relies on manually tracking year and month changes (prev_year, prev_month) and manually opening/closing HTML tags. This is error-prone and difficult to read and debug.

A much cleaner, more robust, and idiomatic way to achieve this in Jekyll is to use the group_by_exp filter. This simplifies the logic immensely by handling the grouping for you, resulting in more readable and maintainable code that produces valid HTML.

Here is a suggested replacement for the entire block which addresses these issues.

      <div class="sidebar-section">
        <h3 style="font-size:1.5rem;text-align: center;margin:auto;">Browse by date</h3>
        <ul class="archive-index">
          {% assign posts_by_year = site.posts | group_by_exp: "post", "post.date | date: '%Y'" | sort: 'name' | reverse %}
          {% for year_group in posts_by_year %}
            <li>
              <details class="archive-year" {% if forloop.first %}open{% endif %}>
                <summary>{{ year_group.name }}</summary>
                <ul class="archive-months">
                  {% assign posts_by_month = year_group.items | group_by_exp: "post", "post.date | date: '%m'" | sort: 'name' | reverse %}
                  {% for month_group in posts_by_month %}
                    <li>
                      <details class="archive-month">
                        <summary>{{ month_group.items.first.date | date: '%B' }}</summary>
                        <ul class="archive-posts">
                          {% for post in month_group.items %}
                            <li><a href="{{ post.url | relative_url }}">{{ post.title }}</a></li>
                          {% endfor %}
                        </ul>
                      </details>
                    </li>
                  {% endfor %}
                </ul>
              </details>
            </li>
          {% endfor %}
        </ul>
      </div>

@Devansh422
Copy link
Contributor Author

@leecalcote
please Review out the changes made in the PR

@leecalcote
Copy link
Member

@Rajesh-Nagarajan-11 👀

@Rajesh-Nagarajan-11
Copy link
Contributor

@Devansh422 Hey Kindly sign off your commits
DCO Failed ⚠️

To add your Signed-off-by line to every commit in this branch:

  1. Ensure you have a local copy of your branch by checking out the pull request locally via command line.
  2. In your local branch, run: git rebase HEAD~2 --signoff
  3. Force push your changes to overwrite the branch: git push --force-with-lease origin feature-blog

Signed-off-by: Devansh422 <[email protected]>
@Devansh422
Copy link
Contributor Author

hey @Rajesh-Nagarajan-11

i followed the steps you guided

Signed-off-by: Devansh422 <[email protected]>
Signed-off-by: Devansh422 <[email protected]>
@Devansh422
Copy link
Contributor Author

@Rajesh-Nagarajan-11 @leecalcote @saurabhraghuvanshii

there was an UI issue in the side bar

Screenshot 2025-10-02 044450

I updated the css of blog page to resolve this
and looks like this now

image

Copy link
Contributor

@Rajesh-Nagarajan-11 Rajesh-Nagarajan-11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Give some spaces and date of the blog / index inside the month of each blog might helpful , please consider this feedback and help us , Thank you !

@Rajesh-Nagarajan-11
Copy link
Contributor

Rajesh-Nagarajan-11 commented Oct 2, 2025

And also consider Gemini's review to more optimize and instead of rebase your repo for every commits use git commit -s -m "msg" ( flag -s) for sign your commits

@Devansh422
Copy link
Contributor Author

@Rajesh-Nagarajan-11 @leecalcote @saurabhraghuvanshii

i have fixed the ui of the listing of the list
Screenshot 2025-10-04 214817

@saurabhraghuvanshii
Copy link
Contributor

saurabhraghuvanshii commented Oct 4, 2025

Thanks @Devansh422 lgtm, did you check for other page if this changes working well on other blogs.

@Devansh422
Copy link
Contributor Author

Hey!, @saurabhraghuvanshii, i have checked the pages. its working well on all pages

@Devansh422
Copy link
Contributor Author

@Rajesh-Nagarajan-11
Please Review the changes

@Devansh422
Copy link
Contributor Author

@leecalcote Please check the PR and merge

@Devansh422
Copy link
Contributor Author

@Rajesh-Nagarajan-11 @saurabhraghuvanshii

what is the process of merging the PR
Please help me out to merge it to the main branch

@Namanv0509 Namanv0509 added the hacktoberfest-accepted Approved for Hacktoberfest. Happy hacking! label Oct 7, 2025
@Namanv0509
Copy link
Member

@Devansh422 can you look over this issue
image

The box is not correctly sizes also

image

The blogs should be seprated by a horizontal line or a box border to distinguish them

@Namanv0509
Copy link
Member

@Devansh422 Make sure to present them in websites call , thanks for taking up on this effort

@Namanv0509
Copy link
Member

@Devansh422 I dont think this is desired , the filter should work same as categories , a different section to filter with date. As we can check by year or month . with year having months as drop down , or they can check the year to get those filtered blog for that year .

@leecalcote
Copy link
Member

@Devansh422, almost there. This formatting needs to be addressed.
Screenshot 2025-10-09 at 4 04 43 PM

Is there a dedicated "Archives" page?

@leecalcote
Copy link
Member

In the future, offer a descriptive PR title, please, @Devansh422

@leecalcote
Copy link
Member

@Devansh422, will you be finalizing this PR?

@leecalcote
Copy link
Member

No movement from @Devansh422. @Namanv0509 please finish off this PR.

@leecalcote leecalcote changed the title added the feature [Blog] Feature: Post Archives Oct 13, 2025
@leecalcote leecalcote requested a review from Namanv0509 October 13, 2025 15:30
@Namanv0509 Namanv0509 merged commit 702ded4 into meshery:master Oct 14, 2025
7 checks passed
Copy link

welcome bot commented Oct 14, 2025

Thanks for your contribution to the Meshery community! 🎉

Meshery Logo
        ⭐ Please leave a star on the project. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/blog area/website hacktoberfest-accepted Approved for Hacktoberfest. Happy hacking!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Site] Allow visitors to navigate blog archives

5 participants