Skip to content

Fix #2 empty top month#36

Open
mehgellan wants to merge 1 commit intosf-wdi-30:masterfrom
mehgellan:fix_empty_month2
Open

Fix #2 empty top month#36
mehgellan wants to merge 1 commit intosf-wdi-30:masterfrom
mehgellan:fix_empty_month2

Conversation

@mehgellan
Copy link
Copy Markdown

In lib/archives_sidebar/app/views/archives_sidebar/_content.html.erb --> removed +1 from articles_by_month_path to fix the off by one bug in the month links on the sidebar.
From:
<%= link_to"#{month[:name]} #{counter}".html_safe, articles_by_month_path( month[:year], "%02i" % (month[:month]+1) ) %>
To:
<%= link_to"#{month[:name]} #{counter}".html_safe, articles_by_month_path( month[:year], "%02i" % (month[:month]) ) %>

However, the routes are now off by one so that when I click on September, the url says /2016/08...

<h3 class="sidebar_title"><%= sidebar.title %></h3>
<div class="sidebar_body">
<h3 class="sidebar-title"><%= sidebar.title %></h3>
<div class="sidebar-body">
Copy link
Copy Markdown

@nathanallen nathanallen Sep 2, 2016

Choose a reason for hiding this comment

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

Are these changes relevant to the top month being empty?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants