Skip to content

Commit

Permalink
feat: Add University page with tagged articles shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 6, 2024
1 parent f53462f commit e158ace
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hugo-site/content/resources/university/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "University"
date: 2024-06-11T00:00:00Z
draft: false
---

# Freenet University

Deep dives into Freenet's technical concepts and architecture. These articles explain the theory and implementation details behind Freenet's core technologies.

{{< tagged-articles tag="university" >}}
6 changes: 6 additions & 0 deletions hugo-site/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ theme = "freenet"
weight = 8
parent = "Resources"

[[menu.main]]
name = "University"
url = "/resources/university/"
weight = 9
parent = "Resources"

[[menu.main]]
name = "FAQ"
url = "/faq/"
Expand Down
13 changes: 13 additions & 0 deletions hugo-site/themes/freenet/layouts/shortcodes/tagged-articles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ $tag := .Get "tag" }}
{{ $articles := where .Site.RegularPages "Params.tags" "intersect" (slice $tag) }}
{{ $sortedArticles := sort $articles "Date" "desc" }}

<ul>
{{ range $sortedArticles }}
<li>
<i class="fas fa-graduation-cap"></i>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<p class="article-description">{{ .Description }}</p>
</li>
{{ end }}
</ul>

0 comments on commit e158ace

Please sign in to comment.