users/foo-dogsquared: update custom homepage grid layout

This commit is contained in:
Gabriel Arazas 2024-09-09 12:44:39 +08:00
parent b04cedbc19
commit f6ac08e3dc
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
4 changed files with 12 additions and 16 deletions

View File

@ -14,24 +14,12 @@ body {
} }
#links { #links {
--width: 40ch; --width: 30ch;
display: grid; display: grid;
grid-auto-flow: column;
grid-auto-columns: var(--width);
grid-template-columns: repeat(auto-fill, minmax(var(--width), 1fr)); grid-template-columns: repeat(auto-fill, minmax(var(--width), 1fr));
grid-template-rows: max-content;
gap: 0.5em; gap: 0.5em;
// Place it at the very center.
position: absolute;
top: 30%;
margin-top: calc(var(--width) / 2);
margin-left: calc(0 - var(--width));
height: auto;
margin: 0 auto;
overflow-x: scroll;
section[id^="section-"] { section[id^="section-"] {
background: var(--foreground); background: var(--foreground);
color: var(--background); color: var(--background);

View File

@ -10,6 +10,7 @@ links = [
{ url = "https://login.tailscale.com", text = "Tailscale" }, { url = "https://login.tailscale.com", text = "Tailscale" },
{ url = "https://devdocs.io", text = "Devdocs" }, { url = "https://devdocs.io", text = "Devdocs" },
] ]
grid.row = 2
[applications] [applications]
name = "Applications" name = "Applications"
@ -35,6 +36,7 @@ links = [
{ url = "https://cloud.oracle.com", text = "Oracle Cloud" }, { url = "https://cloud.oracle.com", text = "Oracle Cloud" },
{ url = "https://cloud.hetzner.com", text = "Hetzner Cloud" }, { url = "https://cloud.hetzner.com", text = "Hetzner Cloud" },
] ]
grid.row = 2
[design] [design]
name = "Design" name = "Design"

View File

@ -9,7 +9,13 @@
<div id="links"> <div id="links">
{{ range $key, $value := sort (index $.Site.Data (slice "foodogsquared-homepage" "links")) "weight" }} {{ range $key, $value := sort (index $.Site.Data (slice "foodogsquared-homepage" "links")) "weight" }}
{{- $name := default $key $value.name -}} {{- $name := default $key $value.name -}}
<section id="section-{{ $name }}"> <section
id="section-{{ $name }}"
tabindex="1"
{{ with $value.grid }}
style="{{ with .column }}grid-column: span {{ . }};{{ end }}{{ with .row }}grid-row: span {{ . }};{{ end }}"
{{ end }}
>
<span class="nav-header">{{ $name }}</span> <span class="nav-header">{{ $name }}</span>
{{ with $value.flavorText }} {{ with $value.flavorText }}
<span class="flavor-text">{{ . }}</span> <span class="flavor-text">{{ . }}</span>

View File

@ -5,7 +5,7 @@
buildHugoSite { buildHugoSite {
pname = "foodogsquared-hm-startpage"; pname = "foodogsquared-hm-startpage";
version = "0.1.0"; version = "0.2.0";
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
vendorHash = "sha256-Mi61QK1yKWIneZ+i79fpJqP9ew5r5vnv7ptr9YGq0Uk="; vendorHash = "sha256-Mi61QK1yKWIneZ+i79fpJqP9ew5r5vnv7ptr9YGq0Uk=";