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(sitemap): add XML styling #221

Merged
merged 1 commit into from
Nov 14, 2023
Merged

✨ feat(sitemap): add XML styling #221

merged 1 commit into from
Nov 14, 2023

Conversation

welpo
Copy link
Owner

@welpo welpo commented Nov 14, 2023

Summary

Enhances the XML sitemap view for humans, showing a table with two columns: the URL and its last updated date. Loads a small JavaScript file to allow sorting of the columns.

Related issue

Closes #217

Changes

Loads main.css. As the sitemap template has access to very little information, it can't do internationalisation or read any config.toml variable like the site name.

Furthermore, it cannot read the skins variable, so the colour of the headers will be teal (default skin).

Accessibility

  • Semantic HTML: Structured HTML table with clear <thead> and <tbody> for screen reader navigation.
  • ARIA Attributes: Utilised aria-live, aria-atomic, aria-hidden, and aria-sort for dynamic content accessibility.
  • Keyboard Navigation: Enabled for sorting headers via Enter and Space keys, facilitating keyboard-only users.
  • Screen Reader Compatibility: Off-screen text (.visually-hidden) describes sorting actions for screen reader users.
  • Dynamic Content Updates: Live region with aria-live announces changes in sorting to screen reader users.

Screenshots

Sitemap

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 made corresponding changes to the documentation:
    • Updated README.md

Note: the sorting and accessibility features are achieved through JS (impossible otherwise). The sitemap works fine with JS disabled and all the sorting-related code is not shown (e.g. the arrows indicating current sorting).

@welpo welpo added the enhancement New feature or request label Nov 14, 2023
@welpo welpo merged commit 1df3f7f into main Nov 14, 2023
1 check passed
@welpo welpo deleted the feat/style-sitemap branch November 14, 2023 22:26
@welpo welpo changed the title ✨ feat: apply XML styling ✨ feat(sitemap): add XML styling Nov 14, 2023
welpo added a commit that referenced this pull request Nov 14, 2023
welpo added a commit that referenced this pull request Nov 14, 2023
Smtbook pushed a commit to Smtbook/zola-theme-tabi that referenced this pull request Feb 29, 2024
Smtbook pushed a commit to Smtbook/zola-theme-tabi that referenced this pull request Feb 29, 2024
Smtbook pushed a commit to Smtbook/zola-theme-tabi that referenced this pull request Feb 29, 2024
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.

Apply XML styling to the sitemap
1 participant