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

Load footer data from json #109

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions footer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"magazine": [
{
"name": "All topics",
"url": "/topics"
},
{
"name": "All authors",
"url": "/authors"
}
],
"more": [
{
"name": "About",
"url": "/about"
},
{
"name": "FAQ",
"url": "/faq"
},
{
"name": "Open Collective",
"url": "https://opencollective.com/rustmagazine"
},
{
"name": "How to contribute",
"url": "/contribution"
},
{
"name": "GitHub",
"url": "https://github.com/RustMagazine/rustmagazine"
},
{
"name": "Twitter",
"url": "https://twitter.com/rustmagazineorg"
},
{
"name": "Discord",
"url": "https://discord.gg/DdwgBuReJe"
}
]
}
2 changes: 1 addition & 1 deletion static/footer.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 14 additions & 21 deletions templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="bg-[#0f1125] p-10 pt-20 text-slate-100 translate-y-[-9rem]">
<div class="bg-[#0f1125] p-10 py-20 text-slate-100 translate-y-[-9rem]">
<div class="flex justify-center mb-28 top-16 font-bold">
<div class="text-sm md:text-2xl border-solid border-2 border-primary py-3">
<span class="bg-primary text-main p-4">Subscriber:</span>
Expand All @@ -20,30 +20,23 @@
<div class="pt-12 sm:pt-0">
<div class="bg-primary w-5 h-5 my-4"></div>
<div class="text-xl font-bold mb-4">Editors</div>
<a class="my-2 block hover:underline" href="/@folyd">@Folyd</a>
<a class="my-2 block hover:underline" href="/@lcrossman">@LCrossman</a>
<a class="my-2 block hover:underline" href="/@macko76">@macko76</a>
<a class="my-2 block hover:underline" href="/@handongzhang">@HandongZhang</a>
<a class="my-2 block hover:underline" href="/@pau1tuck">@pau1tuck</a>
<a class="my-2 block hover:underline" href="/@mfrw">@mfrw</a>
<a class="my-2 block hover:underline" href="/@malagant">@malagant</a>
{% set authors = get_entity("authors") -%}
{% for author in authors|sort(attribute="id") -%}
{% if author.editor -%}
<a class="my-2 block hover:underline" href="/@{{ author.id }}">@{{ author.name }}</a>
{% endif -%}
{% endfor -%}
</div>
{% set footer = load_json("footer.json") -%}
{% for column, items in footer | items -%}
<div class="pt-12 sm:pt-0">
<div class="bg-primary w-5 h-5 my-4"></div>
<div class="text-xl font-bold mb-4">Magazine</div>
<a class="my-2 block hover:underline" href="/topics">All topics</a>
<a class="my-2 block hover:underline" href="/authors">All authors</a>
</div>
<div class="pt-12 sm:pt-0">
<div class="bg-primary w-5 h-5 my-4"></div>
<div class="text-xl font-bold mb-4">More</div>
<a class="my-2 block hover:underline" href="/about">About</a>
<a class="my-2 block hover:underline" href="/faq">FAQ</a>
<a class="my-2 block hover:underline" href="https://opencollective.com/rustmagazine">Open Collective</a>
<a class="my-2 block hover:underline" href="/contribution">How to contribute</a>
<a class="my-2 block hover:underline" href="https://github.com/RustMagazine/rustmagazine">GitHub</a>
<a class="my-2 block hover:underline" href="https://discord.gg/DdwgBuReJe">Discord</a>
<div class="text-xl font-bold mb-4 capitalize">{{ column }}</div>
{% for item in items -%}
<a class="my-2 block hover:underline" href="{{ item.url }}">{{ item.name }}</a>
{% endfor -%}
</div>
{% endfor -%}
</div>
</div>
</div>
Expand Down