Skip to content

Commit

Permalink
Show top projects already on the project categories overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
awinterstein committed Dec 2, 2024
1 parent 8a7728a commit 39d174c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ theme = "project-portfolio" # The site theme to use.

Create the files `projects.md` and `skills.md` in your `content` directory that are used to show the "Projects" and "Skills" [taxonomies](https://www.getzola.org/documentation/content/taxonomies/). They both need a title and can optionally get a descriptive text that will be shown above the terms of the taxonomy. See the following `projects.md` file as an example:

```markdown
```toml
+++
title = "Projects"
+++
Expand All @@ -67,7 +67,7 @@ The `skills.md` file can be created the same way. The corresponding page will ju

Finally, create the first project page in the `content` directory:

```markdown
```toml
+++
title = "Project Title"
description = "Here is a short description of the project."
Expand All @@ -76,6 +76,7 @@ date = 2022-05-31 # The date when the project finished
[extra]
date_start = 2021-01-01 # Optional date when the project was started
image = "water.jpg" # Optional filename to an image in the `static/images` directory
top_project = true # Optional parameter to show the project on the projects overview page as well

[taxonomies]
projects=["Consumer"] # The category of the project (could be industry, type etc.)
Expand Down
19 changes: 17 additions & 2 deletions templates/projects/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,27 @@
{% extends "layout.html" %}

{% block content %}

{% set page = get_page(path="projects.md", lang=lang) %}

<div class="flex items-center flex-col mt-10 px-4">
<h1 class="text-2xl text-bold">{{ page.title }}</h1>

<div class="text-bold mt-4">{{ page.content | safe }}</div>

{{ macros::terms_list_projects(terms=terms) }}

<!-- List the top projects -->
<div class="flex flex-col gap-y-6 w-full sm:w-2/3 mt-10">
{% set categories = get_taxonomy(kind="projects") %}
{% for project_type in categories.items %}
{% for project_page in project_type.pages %}
{%if project_page.extra.top_project%}
{{ macros::project_tile(page=project_page) }}
{%endif%}
{% endfor %}
{% endfor %}
</div>

</div>
{% endblock content %}

{% endblock content %}

0 comments on commit 39d174c

Please sign in to comment.