get the devices page working

This commit is contained in:
Aaron Honeycutt 2024-12-02 16:44:01 -07:00
parent f205648475
commit 22eda90eec
3 changed files with 28 additions and 12 deletions

View file

@ -57,7 +57,7 @@ recent_more_text = "more »"
sections = [ sections = [
{ name = "posts", path = "/posts", is_external = false }, { name = "posts", path = "/posts", is_external = false },
{ name = "projects", path = "/projects", is_external = false }, { name = "projects", path = "/projects", is_external = false },
# { name = "devices", path = "/devices", is_external = false }, { name = "devices", path = "/devices", is_external = false },
# { name = "about", path = "/about", is_external = false }, # { name = "about", path = "/about", is_external = false },
# { name = "github", path = "https://github.com/<your-username>", is_external = true }, # { name = "github", path = "https://github.com/<your-username>", is_external = true },
] ]

View file

@ -1,7 +1,23 @@
[[device]] [[device]]
name = "Shepard" name = "Shepard"
desc = "Main Workstation at Home" desc = "System76 nebula49 custom desktop"
tags = [ "shepard", "workstation", "desktop" ] tags = [ "shepard", "workstation", "desktop" ]
links = [
{ name = "Case", url = "https://system76.com/components/nebula49-3/configure" },
{ name = "Mainboard", url = "https://www.gigabyte.com/Motherboard/X299-AORUS-Gaming-3-rev-10#kf" },
{ name = "CPU", url = "https://www.intel.com/content/www/us/en/products/sku/198012/intel-core-i910920x-xseries-processor-19-25m-cache-3-50-ghz/specifications.html" }
]
[[device]]
name = "Garrus"
desc = "System76 Galago Pro Laptop"
tags = [ "garrus", "portable", "laptop" ]
links = [
{ name = "Link", url = "https://system76.com/laptops/galago" }
]
[[device]]
name = "EDI"
desc = "Custom deskop running a homelab"
tags = [ "homelab", "homelab" ]
links = [ links = [
{ name = "Status", url = "https://status.ahoneybun.net" } { name = "Status", url = "https://status.ahoneybun.net" }
] ]

View file

@ -1,6 +1,6 @@
{% extends "_base.html" %} {% extends "_base.html" %}
{% block page %}devices{% endblock page%} {% block page %}projects{% endblock page %}
{% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %} {% block lang %}{% if section.extra.lang %}{{ section.extra.lang }}{% else %}{{ section.lang }}{% endif %}{% endblock lang %}
{% block title %}{{ section.title }}{% endblock title %} {% block title %}{{ section.title }}{% endblock title %}
{% block desc %} {% block desc %}
@ -12,17 +12,17 @@
<div id="wrapper"> <div id="wrapper">
<main> <main>
{% set data = load_data(path="content" ~ section.path ~ "data.toml", format="toml") %} {% set data = load_data(path="content" ~ section.path ~ "data.toml", format="toml") %}
{% for devices in data.device %} {% for device in data.device %}
<div class="proj"> <div class="proj">
<div class="meta"> <div class="meta">
<div class="name">{{ devices.name }}</div> <div class="name">{{ device.name }}</div>
<div class="tags"> <div class="tags">
{% for tag in devices.tags %} {% for tag in device.tags %}
<div><span>#</span>{{ tag }}</div> <div><span>#</span>{{ tag }}</div>
{% endfor %} {% endfor %}
</div> </div>
<div class="links"> <div class="links">
{% for link in devices.links -%} {% for link in device.links -%}
<a href="{{ link.url }}" target="_blank" rel='noreferrer noopener'> <a href="{{ link.url }}" target="_blank" rel='noreferrer noopener'>
<span>[</span>{{ link.name }}<span>]</span> <span>[</span>{{ link.name }}<span>]</span>
</a> </a>
@ -30,14 +30,14 @@
</div> </div>
</div> </div>
<div class="tags-narrow"> <div class="tags-narrow">
{% for tag in devices.tags %} {% for tag in device.tags %}
<div><span>#</span>{{ tag }}</div> <div><span>#</span>{{ tag }}</div>
{% endfor %} {% endfor %}
</div> </div>
<div class="content"> <div class="content">
<div class="desc">{{ devices.desc | trim | markdown | safe }}</div> <div class="desc">{{ device.desc | trim | markdown | safe }}</div>
{% if devices.img %} {% if device.img %}
<img src="{{ devices.img }}" alt="{{ devices.name }}" /> <img src="{{ device.img }}" alt="{{ device.name }}" />
{% endif %} {% endif %}
</div> </div>
</div> </div>