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 pinned posts functionality #424

Merged
merged 5 commits into from
Nov 13, 2024
Merged

✨ feat: add pinned posts functionality #424

merged 5 commits into from
Nov 13, 2024

Conversation

welpo
Copy link
Owner

@welpo welpo commented Nov 8, 2024

Summary

Add ability to pin posts to the top of the main page listing.

Posts marked with pinned = true in their front matter will appear first while maintaining their relative sort order within the section's sort_by.

Related issue

Idea from #406.

Changes

  • Add pinned posts detection and sorting in list_posts.html
  • Adds i18n string
  • Adds a bit of CSS
  • Sets Mastering tabi post as pinned

Accessibility

  • Uses aria-hidden="true" to decorative SVG icon
  • Pin status is conveyed through visible text in the user's language
  • Maintains semantic HTML structure using list elements

Screenshots

pinned post

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have updated theme.toml with a sane default for the feature
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

@welpo welpo added the enhancement New feature or request label Nov 8, 2024
@welpo welpo requested a review from TheAwiteb as a code owner November 8, 2024 00:15
Copy link

netlify bot commented Nov 8, 2024

Deploy Preview for tabi-demo ready!

Name Link
🔨 Latest commit 5d2678d
🔍 Latest deploy log https://app.netlify.com/sites/tabi-demo/deploys/6734c544666adb0008509eb2
😎 Deploy Preview https://deploy-preview-424--tabi-demo.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 site configuration.

@welpo
Copy link
Owner Author

welpo commented Nov 8, 2024

@TheAwiteb how's pinned = "مثبت"?

I used Twitter's "Pinned Tweet" phrasing as reference.

i18n/ar.toml Outdated Show resolved Hide resolved
@welpo welpo merged commit 36e53dc into main Nov 13, 2024
7 checks passed
@welpo welpo deleted the feat/pinned-posts branch November 13, 2024 17:07
welpo added a commit that referenced this pull request Nov 13, 2024
Additionally, it ensures pinned posts are only shown in root paths, not in blog/ or similar.

Should've probably be done in #424
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants