Added anchor to category sections (#2006)

Added anchor to categories so one could navigate to the category section
from the URL:

e.g.,

https://alshedivat.github.io/al-folio/projects#fun
This commit is contained in:
Fares Abawi 2024-01-23 15:50:58 +01:00 committed by GitHub
parent 25eac655ba
commit 10507a882b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,9 @@ horizontal: false
{% if site.enable_project_categories and page.display_categories %}
<!-- Display categorized projects -->
{% for category in page.display_categories %}
<h2 class="category">{{ category }}</h2>
<a id="{{ category }}" href=".#{{ category }}">
<h2 class="category">{{ category }}</h2>
</a>
{% assign categorized_projects = site.projects | where: "category", category %}
{% assign sorted_projects = categorized_projects | sort: "importance" %}
<!-- Generate cards for each project -->