From 01f7e3a425a22e7d19202c2cbe5e93675ffcea00 Mon Sep 17 00:00:00 2001 From: Xin Date: Sun, 24 Sep 2023 15:30:17 +0100 Subject: [PATCH] docs: add showcase page (#86) * docs: add showcase page * chore: update compiled CSS * chore: add showcase to navbar * chore: reorder show case on navbar * chore: update card image style * chore: update showcase images * chore: update showcase card image --- assets/css/compiled/main.css | 3 +++ exampleSite/content/showcase/index.md | 18 ++++++++++++++++++ exampleSite/hugo.yaml | 12 ++++++++---- exampleSite/hugo_stats.json | 1 + layouts/_default/wide.html | 12 ++++++++++++ layouts/shortcodes/card.html | 3 ++- 6 files changed, 44 insertions(+), 5 deletions(-) create mode 100644 exampleSite/content/showcase/index.md create mode 100644 layouts/_default/wide.html diff --git a/assets/css/compiled/main.css b/assets/css/compiled/main.css index 48c0bce..fad0478 100644 --- a/assets/css/compiled/main.css +++ b/assets/css/compiled/main.css @@ -1122,6 +1122,9 @@ video { .pr-\[calc\(env\(safe-area-inset-right\)-1\.5rem\)\] { padding-right: calc(env(safe-area-inset-right) - 1.5rem); } +.pr-\[max\(env\(safe-area-inset-left\)\2c 1\.5rem\)\] { + padding-right: max(env(safe-area-inset-left),1.5rem); +} .pr-\[max\(env\(safe-area-inset-right\)\2c 1\.5rem\)\] { padding-right: max(env(safe-area-inset-right),1.5rem); } diff --git a/exampleSite/content/showcase/index.md b/exampleSite/content/showcase/index.md new file mode 100644 index 0000000..6f33fc6 --- /dev/null +++ b/exampleSite/content/showcase/index.md @@ -0,0 +1,18 @@ +--- +title: Showcase +description: "Open source projects powered by Hextra." +toc: false +layout: wide +--- + +
+ +

+Open source projects powered by Hextra. +

+ +{{< cards >}} + {{< card link="https://getporter.org/" title="Porter" image="https://repository-images.githubusercontent.com/155893691/aa249c80-fcf3-11ea-93b0-30079e8d7de4" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} + {{< card link="https://lutheranconfessions.org/" title="LutheranConfessions" image="https://github.com/imfing/hextra/assets/5097752/ad6625e4-88cd-4cad-b102-5399997d0359" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} + {{< card link="/" title="Hextra Starter Template" image="https://user-images.githubusercontent.com/5097752/263551418-c403b9a9-a76c-47a6-8466-513d772ef0b7.jpg" imageStyle="object-fit:cover; aspect-ratio:16/9;" >}} +{{< /cards >}} diff --git a/exampleSite/hugo.yaml b/exampleSite/hugo.yaml index 6f66935..5614131 100644 --- a/exampleSite/hugo.yaml +++ b/exampleSite/hugo.yaml @@ -53,20 +53,24 @@ menu: name: Documentation pageRef: /docs weight: 1 + - identifier: showcase + name: Showcase + pageRef: /showcase + weight: 2 - identifier: blog name: Blog pageRef: /blog - weight: 2 + weight: 3 - identifier: about name: About pageRef: /about - weight: 3 - - name: Search weight: 4 + - name: Search + weight: 5 params: type: search - name: GitHub - weight: 5 + weight: 6 url: "https://github.com/imfing/hextra" params: icon: github diff --git a/exampleSite/hugo_stats.json b/exampleSite/hugo_stats.json index c5b31f1..a050296 100644 --- a/exampleSite/hugo_stats.json +++ b/exampleSite/hugo_stats.json @@ -441,6 +441,7 @@ "pointer-events-none", "pr-4", "pr-[calc(env(safe-area-inset-right)-1.5rem)]", + "pr-[max(env(safe-area-inset-left),1.5rem)]", "pr-[max(env(safe-area-inset-right),1.5rem)]", "print:bg-transparent", "print:hidden", diff --git a/layouts/_default/wide.html b/layouts/_default/wide.html new file mode 100644 index 0000000..79d8b7c --- /dev/null +++ b/layouts/_default/wide.html @@ -0,0 +1,12 @@ +{{ define "main" }} +
+ {{ partial "sidebar.html" (dict "context" . "disableSidebar" true "displayPlaceholder" false) }} +
+
+

{{ .Title }}

+
+ {{ .Content }} +
+
+
+{{ end }} diff --git a/layouts/shortcodes/card.html b/layouts/shortcodes/card.html index fae0f71..40f5913 100644 --- a/layouts/shortcodes/card.html +++ b/layouts/shortcodes/card.html @@ -6,6 +6,7 @@ {{- $image := .Get "image" -}} {{- $width := 0 -}} {{- $height := 0 -}} +{{- $imageStyle := .Get "imageStyle" -}} {{/* Image processing options */}} {{- $method := .Get "method" | default "Resize" | humanize -}} @@ -58,10 +59,10 @@ alt="{{ $title }}" loading="lazy" decoding="async" - style="color: transparent;" src="{{ $image | safeURL }}" {{ with $width }}width="{{ . }}"{{ end }} {{ with $height }}height="{{ . }}"{{ end }} + {{ with $imageStyle }}style="{{ . | safeCSS }}"{{ end }} /> {{- end -}}