Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add archives page with configurable menu #386

Merged
merged 6 commits into from
Oct 14, 2024

Conversation

barnett617
Copy link
Contributor

This PR implements the archives menu with a SITE config to control whether to show it.

The new page "archives" groups the posts by its publish year then month and demonstrate all the posts archived like below

archives

close: #361

@barnett617
Copy link
Contributor Author

And it shows well on mobile devices
iPhone 14 Pro Max

@patrick-kot
Copy link

Sorry ifs not the right place to say this. I like this feature, but I see all the posts was showing, even the not published (draft true). Its ok, but the real problem is the draft posts are not created, cause are draft, not published.
So, they are listed, cover and link, but result in a 404 page.
I know is just make a filter, but I have technical debts to make this work.

@satnaing
Copy link
Owner

satnaing commented Oct 13, 2024

@patrick-kot
I see your concern, but draft posts can be filtered out during dev and prod modes.
I checked this out in my local and fixed that draft issue. Anyway, thanks for pointing this out.

@satnaing
Copy link
Owner

Love this PR. @barnett617
However, I noticed that the current layout has some issues.
If the site has a relatively long name, it breaks the layout.
This problem also persists in the existing AstroPaper implementation, though the shorter menu length helps minimize its impact.

To fix this, we could add a little icon menu like the ones we have for Search and Theme. That would make things look more minimal.

image

Another approach is to add an Archives link at the bottom. Something like this

image

@barnett617
Copy link
Contributor Author

Love this PR. @barnett617 However, I noticed that the current layout has some issues. If the site has a relatively long name, it breaks the layout. This problem also persists in the existing AstroPaper implementation, though the shorter menu length helps minimize its impact.

To fix this, we could add a little icon menu like the ones we have for Search and Theme. That would make things look more minimal.

image

Another approach is to add an Archives link at the bottom. Something like this

image

It looks good to me, this is also a feature related to the theme layout.
Just feel free to adjust it follows your favor and design.

@satnaing
Copy link
Owner

So, here's what I did.

  • filtered draft posts
  • updated menu layout
  • updated/archives to redirect to 404 page if SITE.showArchives is set to false
  • updated the docs
  • rebased from main to resolve conflicts

I'm gonna merge this now.
Again, thanks for your contributions.

@satnaing satnaing merged commit 7573617 into satnaing:main Oct 14, 2024
1 check passed
@barnett617 barnett617 deleted the feature/archive branch October 17, 2024 11:35
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.

Archives
3 participants