staticms #3

Merged
brooke merged 18 commits from staticms into main 2024-06-10 21:54:36 -04:00
19 changed files with 221 additions and 122 deletions

View file

@ -3,7 +3,7 @@ name: Hugo
on: on:
push: push:
branches: branches:
- main - staticms
jobs: jobs:
build: build:
@ -14,6 +14,8 @@ jobs:
submodules: 'true' submodules: 'true'
- name: Run build task - name: Run build task
run: hugo --minify run: hugo --minify
- name: pre-compress
run: find ./public/* -type f \( -name '*.html' -o -name '*.js' -o -name '*.css' \) -exec gzip -v -k -f --best {} \;
- name: Deploy to Server - name: Deploy to Server
uses: https://git.myco.systems/mirrors/ssh-deploy@main uses: https://git.myco.systems/mirrors/ssh-deploy@main
env: env:

8
Makefile Normal file
View file

@ -0,0 +1,8 @@
.PHONY: setup dev
setup:
npm install
dev:
hugo server --disableFastRender & \
tailwindcss -i ./themes/gallo/src/input.css -o ./themes/gallo/static/css/tailwind.min.css --watch --minify

View file

@ -1,12 +1,11 @@
# gallowelds.com # gallowelds.com
0. Install dependancies this will install **tailwindcss**, **prettier**, and **prettier-plugin-go-template**
``` ```
git clone https://git.myco.systems/mycosystems/gallowelds.com.git make setup
``` ```
1. Start hugo server and tailwindcss cli
``` ```
git submodule update --init --recursive make dev
``` ```
For dependancies just run the below command, this will install **tailwindcss**, **prettier**, and **prettier-plugin-go-template** 2. Visit http://localhost:1313
```
npm install
```

View file

@ -31,16 +31,16 @@ params:
main: main:
- url: 'mailto:iangalloart@gmail.com' - url: 'mailto:iangalloart@gmail.com'
icon: > icon: >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24"
height="16" fill="none" stroke="currentColor" stroke-linecap="round" height="24" fill="none" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"> stroke-linejoin="round" stroke-width="2">
<circle cx="12" cy="12" r="4"></circle> <circle cx="12" cy="12" r="4"></circle>
<path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path> <path d="M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-3.92 7.94"></path>
</svg> </svg>
- url: 'https://www.instagram.com/gallowelding/' - url: 'https://www.instagram.com/gallowelding/'
icon: > icon: >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24"
height="16" fill="none" stroke="currentColor" stroke-linecap="round" height="24" fill="none" stroke="currentColor" stroke-linecap="round"
stroke-linejoin="round" stroke-width="2"> stroke-linejoin="round" stroke-width="2">
<rect height="20" rx="5" ry="5" width="20" x="2" y="2"></rect> <rect height="20" rx="5" ry="5" width="20" x="2" y="2"></rect>
<path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path> <path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path>

View file

@ -4,5 +4,4 @@ module.exports = {
theme: { theme: {
extend: {}, extend: {},
}, },
plugins: [],
}; };

View file

@ -1,9 +1,9 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
{{ partial "head.html" . }} {{ partial "head.html" . }}
<body class="bg-black text-white min-h-screen flex flex-col"> <body class="bg-black text-white min-h-screen flex flex-col">
{{ partial "nav.html" . }} {{ block "main" . {{ partial "nav.html" . }} {{ block "main" . }}{{ end }} {{ partial
}}{{ end }} {{ partial "footer.html" . }} "footer.html" . }}
</body> </body>
</html> </html>

View file

@ -6,8 +6,8 @@
<p class="text-lg">{{ .Params.subTitle }}</p> <p class="text-lg">{{ .Params.subTitle }}</p>
{{ partial "metadata.html" . }} {{ partial "metadata.html" . }}
<div class="mt-2 flex flex-col gap-4">{{ .Content }}</div> <div class="mt-2 flex flex-col gap-4">{{ .Content }}</div>
{{ partial "buttons.html" . }} {{ partial "buttons.html" . }} {{ if .Params.catalog }} {{ partial
{{ partial "rental-catalog.html" . }} "rental-catalog.html" . }} {{ end }}
</div> </div>
{{ partial "questions.html" . }} {{ partial "gallery.html" . }} {{ partial {{ partial "questions.html" . }} {{ partial "gallery.html" . }} {{ partial

View file

@ -4,7 +4,7 @@
<a href="{{ .url }}" <a href="{{ .url }}"
><button ><button
type="button" type="button"
class="px-3 py-2 text-xs font-medium text-center text-white bg-black rounded-lg focus:ring-4 focus:outline-none hover:bg-gray-800 transition-all duration-200" class="px-4 py-4 sm:py-2 sm:px-3 text-xs font-medium text-center text-white bg-black rounded-lg focus:ring-4 focus:outline-none hover:bg-gray-800 transition-all duration-200"
> >
{{ .text }} {{ .text }}
</button> </button>

View file

@ -1,28 +1,38 @@
<div class="flex flex-col bg-white font-bold"> <section class="bg-white text-gray-600 body-font">
<div class="flex py-8 justify-center"> <div class="container px-5 py-24 mx-auto">
<p class="border-gray-200 border rounded-xl w-full max-w-[1000px] mx-auto p-2 text-4xl text-center text-black"> <div class="flex flex-col w-full mb-20">
Rental Catalog <h1
</p> class="lg:w-2/3 mx-auto text-3xl mx-auto text-left font-medium title-font mb-4 text-gray-900"
>
Rental Catalog
</h1>
<p class="lg:w-2/3 text-gray-600 mx-auto leading-relaxed text-base">
Browse our extensive catalog of wedding structures to find the perfect
setting for your special day. Our structures are designed to provide a stunning
backdrop for your ceremony and reception, ensuring an unforgettable
experience for you and your guests.
</p>
</div>
<div class="pb-16 max-w-[1000px] grid grid-cols-1 gap-4 mx-auto md:grid-cols-2 lg:grid-cols-3">
{{ range .Site.Params.catalogButtons.home }}
<a
class="rounded-xl aspect-[3/2] overflow-hidden"
href="/catalog/#{{ .categoryName }}"
>
<div class="relative h-full max-w-full">
<p
class="text-black w-full z-10 text-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-2xl"
>
{{ .categoryName }}
</p>
<img
class="h-full max-w-full opacity-50"
src="{{ .img }}"
alt="Category {{ .categoryName }}"
/>
</div>
</a>
{{ end }}
</div>
</div> </div>
<div class="pb-16 max-w-[1000px] grid grid-cols-3 gap-3 mx-auto"> </section>
{{ range .Site.Params.catalogButtons.home }}
<a
class="rounded-xl aspect-[3/2] overflow-hidden"
href="/catalog/#{{ .categoryName }}"
>
<div class="relative h-full max-w-full">
<p
class="text-black w-full z-10 text-center absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 text-2xl"
>
{{ .categoryName }}
</p>
<img
class="h-full max-w-full opacity-50"
src="{{ .img }}"
alt="Category {{ .categoryName }}"
/>
</div>
</a>
{{ end }}
</div>
</div>

View file

@ -4,7 +4,7 @@
<div class="w-9/12 flex flex-row justify-between"> <div class="w-9/12 flex flex-row justify-between">
<div class="flex flex-row gap-8"> <div class="flex flex-row gap-8">
{{ range .Site.Menus.main }} {{ range .Site.Menus.main }}
<a class="text-white hover:text-gray-400" href="{{ .URL }}"> <a class="text-white hover:text-gray-400" href="{{ .URL | safeURL }}">
{{ $text := .Name | safeHTML }} {{ $text }} {{ $text := .Name | safeHTML }} {{ $text }}
</a> </a>
{{ end }} {{ end }}

View file

@ -1,9 +1,12 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta
<link rel="stylesheet" type="text/css" href="/css/tailwind.min.css"> name="viewport"
<link rel="stylesheet" type="text/css" href="/css/style.css"> content="width=device-width, initial-scale=1, shrink-to-fit=no"
{{ $title := print .Site.Title " | " .Title }} />
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }} <link rel="stylesheet" type="text/css" href="/css/tailwind.min.css" />
<title>{{ $title }}</title> <link rel="stylesheet" type="text/css" href="/css/style.css" />
</head> {{ $title := print .Site.Title " | " .Title }} {{ if .IsHome }}{{ $title =
.Site.Title }}{{ end }}
<title>{{ $title }}</title>
</head>

View file

@ -1,16 +1,13 @@
<div <section
style=" style="background-blend-mode: multiply; background: url({{ .Site.Params.headerImg }}) rgba(0, 0, 0, 0.75); background-position: center; background-size: cover;"
background-blend-mode: multiply; class="flex justify-start py-36 px-5"
background: url({{ .Site.Params.headerImg }}) rgba(0, 0, 0, 0.6);
background-position: center;
background-size: cover;
"
class="flex justify-start min-h-96"
> >
<div <div class="flex flex-col w-full mx-auto container">
class="flex flex-col ml-16 mb-8 place-self-center text-white max-w-4xl gap-4" <h1 class="lg:w-2/3 mx-auto text-3xl text-left font-bold title-font mb-4">
> {{ .Site.Params.headerTitle }}
<h1 class="text-3xl font-bold">{{ .Site.Params.headerTitle }}</h1> </h1>
<p class="text-md">{{ .Site.Params.headerDesc }}</p> <p class="lg:w-2/3 text-md mx-auto leading-relaxed text-base">
{{ .Site.Params.headerDesc }}
</p>
</div> </div>
</div> </section>

View file

@ -1,20 +1,13 @@
<div class="p-4 min-h-[40.27px] flex flex-row w-full justify-between bg-black"> <div class="p-4 min-h-[40.27px] flex flex-row w-full justify-between bg-black">
<a href="/"><img class="w-44 h-auto" src="{{ .Site.Params.logo }}" /></a> <a href="/"><img class="w-44 h-[40.2667px]" src="{{ .Site.Params.logo }}" /></a>
<nav class="place-self-center h-8 flex justify-end gap-2 text-white pr-6"> <nav class="place-self-center h-8 flex justify-end gap-2 text-white pr-6">
{{ range .Site.Menus.main }} {{ if $.IsMenuCurrent .Menu . }} {{ range .Site.Menus.main }}
<a
class="ml-2 underline underline-offset-0 decoration-2 decoration-transparent decoration-white underline-offset-2 place-self-center"
href="{{ .URL }}"
>
{{ $text := print .Name | safeHTML }} {{ $text }}
</a>
{{ else }}
<a <a
class="ml-2 underline underline-offset-0 decoration-2 decoration-transparent hover:decoration-white hover:underline-offset-2 ease-in-out duration-300 place-self-center" class="ml-2 underline underline-offset-0 decoration-2 decoration-transparent hover:decoration-white hover:underline-offset-2 ease-in-out duration-300 place-self-center"
href="{{ .URL }}" href="{{ .URL }}"
> >
{{ $text := print .Name | safeHTML }} {{ $text }} {{ $text := print .Name | safeHTML }} {{ $text }}
</a> </a>
{{ end }} {{ end }} {{ end }}
</nav> </nav>
</div> </div>

View file

@ -1,10 +1,19 @@
<div <div
class="mt-4 pb-2 flex flex-row gap-2 max-w-full overflow-x-auto whitespace-nowrap" class="mt-4 pb-2 flex flex-row gap-2 max-w-full overflow-x-auto whitespace-nowrap"
> >
<button
id="all"
class="flex gap-2 items-center px-4 border border-gray-200 rounded-lg focus:outline-none"
onclick="window.location.href = '/catalog'"
>
<span class="text-xs p-2 font-medium text-gray-900">All</span>
</button>
{{ $uniqueCategories := slice }} {{ range .Params.catalog }} {{ if not (in {{ $uniqueCategories := slice }} {{ range .Params.catalog }} {{ if not (in
$uniqueCategories .cat) }} {{ $uniqueCategories = $uniqueCategories | append $uniqueCategories .cat) }} {{ $uniqueCategories = $uniqueCategories | append
.cat }} .cat }}
<div class="flex gap-2 items-center px-4 border border-gray-200 rounded-lg"> <div
class="flex gap-2 items-center px-3 py-2 border border-gray-200 rounded-lg"
>
<input <input
id="radio-button-{{ .cat }}" id="radio-button-{{ .cat }}"
type="radio" type="radio"
@ -14,7 +23,7 @@
/> />
<label <label
for="radio-button-{{ .cat }}" for="radio-button-{{ .cat }}"
class="noselect text-sm p-2 font-medium text-gray-900" class="noselect text-xs p-1 sm:p-0 font-medium text-gray-900"
>{{ .cat }}</label >{{ .cat }}</label
> >
</div> </div>
@ -60,12 +69,12 @@
</div> </div>
{{ end }} {{ if ne .deliveryPickup "" }} {{ end }} {{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<strong>+ Delivery/Pickup:</strong> <strong>+ Pickup & Delivery:</strong>
<span>{{ .deliveryPickup }}</span> <span>{{ .deliveryPickup }}</span>
</div> </div>
{{ end }} {{ if ne .installBreakdown "" }} {{ end }} {{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<strong>+ Install/Breakdown:</strong> <strong>+ Setup & Breakdown:</strong>
<span>{{ .installBreakdown }}</span> <span>{{ .installBreakdown }}</span>
</div> </div>
{{ end }} {{ if ne .purchaseCost "" }} {{ end }} {{ if ne .purchaseCost "" }}
@ -131,19 +140,75 @@
<strong>{{ .item }}</strong> <strong>{{ .item }}</strong>
</h3> </h3>
{{ if .gallery }} {{ if .gallery }}
<div <div id="gallery" class="relative w-full" data-carousel="slide">
class="mt-8 columns-1 gap-2 sm:columns-2 sm:gap-4 md:columns-3 lg:columns-4 [&>img:not(:first-child)]:mt-4" <div class="relative h-56 overflow-hidden rounded-lg md:h-96">
> {{ range .gallery }}
{{ range .gallery }} <div
<img class="hidden duration-700 ease-in-out"
loading="lazy" data-carousel-item
class="rounded-lg hover:scale-110 ease-in-out duration-300 transition-all shadow-xl hover:shadow-2xl" >
src="{{ .image }}" <img
/> src="{{ .image }}"
{{ end }} class="absolute block rounded-lg w-full h-auto -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
alt=""
/>
</div>
{{ end }}
</div>
<button
type="button"
class="absolute top-0 start-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none"
data-carousel-prev
>
<span
class="inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
>
<svg
class="w-4 h-4 text-white dark:text-gray-800 rtl:rotate-180"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 6 10"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M5 1 1 5l4 4"
/>
</svg>
<span class="sr-only">Previous</span>
</span>
</button>
<button
type="button"
class="absolute top-0 end-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none"
data-carousel-next
>
<span
class="inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
>
<svg
class="w-4 h-4 text-white dark:text-gray-800 rtl:rotate-180"
aria-hidden="true"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 6 10"
>
<path
stroke="currentColor"
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="m1 9 4-4-4-4"
/>
</svg>
<span class="sr-only">Next</span>
</span>
</button>
</div> </div>
{{ end }} {{ end }}
<div class="px-1 pt-4 w-full"> <div class="px-1 pt-4 w-full">
<div class="text-gray-800 text-base"> <div class="text-gray-800 text-base">
{{ if ne .quant "" }} {{ if ne .quant "" }}
@ -163,12 +228,12 @@
</div> </div>
{{ end }} {{ if ne .deliveryPickup "" }} {{ end }} {{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<strong>Delivery/Pickup:</strong> <strong>Pickup & Delivery:</strong>
<span>{{ .deliveryPickup }}</span> <span>{{ .deliveryPickup }}</span>
</div> </div>
{{ end }} {{ if ne .installBreakdown "" }} {{ end }} {{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<strong>Install/Breakdown:</strong> <strong>Setup & Breakdown:</strong>
<span>{{ .installBreakdown }}</span> <span>{{ .installBreakdown }}</span>
</div> </div>
{{ end }} {{ if ne .purchaseCost "" }} {{ end }} {{ if ne .purchaseCost "" }}
@ -276,4 +341,30 @@
} }
} }
}); });
const gallery = document.getElementById("gallery");
const carouselItems = gallery.querySelectorAll("[data-carousel-item]");
const prevButton = gallery.querySelector("[data-carousel-prev]");
const nextButton = gallery.querySelector("[data-carousel-next]");
let currentItemIndex = 0;
function showItem() {
carouselItems.forEach((item, index) => {
item.classList.add("hidden");
if (index === currentItemIndex) {
item.classList.remove("hidden");
}
});
}
function prevItem() {
currentItemIndex =
(currentItemIndex - 1 + carouselItems.length) % carouselItems.length;
showItem();
}
function nextItem() {
currentItemIndex = (currentItemIndex + 1) % carouselItems.length;
showItem();
}
prevButton.addEventListener("click", prevItem);
nextButton.addEventListener("click", nextItem);
showItem();
</script> </script>

View file

@ -1,35 +1,29 @@
---
backend: backend:
name: gitea name: gitea
repo: mycosystems/gallowelds.com repo: mycosystems/gallowelds.com
branch: main
app_id: 8cf43676-cdba-4112-a981-9c1117b3d096 app_id: 8cf43676-cdba-4112-a981-9c1117b3d096
api_root: https://git.myco.systems/api/v1 api_root: https://git.myco.systems/api/v1
base_url: https://git.myco.systems base_url: https://git.myco.systems
auth_endpoint: https://git.myco.systems/login/oauth/authorize media_folder: themes/gallo/static/img
commit_messages:
create: Create {{collection}} {{slug}}
update: Update {{collection}} {{slug}}
delete: Delete {{collection}} {{slug}}
uploadMedia: Upload {{path}}
deleteMedia: Delete {{path}}
openAuthoring: "{{message}}"
# publish_mode: editorial_workflow
media_folder: "static/img"
site_url: https://gallo.demo.myco.systems site_url: https://gallo.demo.myco.systems
logo_url: https://gallo.demo.myco.systems/img/gallo_welding.svg logo_url: https://gallo.demo.myco.systems/img/gallo_welding_inverted.svg
locale: "en" locale: en
show_preview_links: false show_preview_links: false
search: false search: false
collections: collections:
- name: "about" - name: about
label: "About" label: About
folder: "content/about" folder: content/about
create: false create: false
slug: "index.md" slug: index.md
fields: fields:
- { label: "Title", name: "title", widget: "string" } - label: Title
- { label: "Date Last Edited", name: "date", widget: "datetime" } name: title
- { label: "Featured Image", name: "thumbnail", widget: "image" } widget: string
- { label: "Body", name: "body", widget: "markdown" } - label: Date Last Edited
- { label: "Gallery", name: "gallery", widget: "gallery" } name: date
widget: datetime
- label: Body
name: body
widget: markdown

View file

@ -3,10 +3,13 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" /> <link rel="stylesheet" href="https://unpkg.com/@staticcms/app@^4.0.0/dist/main.css" />
<title>Content Manager</title> <title>Content Manager</title>
</head> </head>
<body> <body>
<script src="https://unpkg.com/decap-cms@latest/dist/decap-cms.js"></script> <script src="https://unpkg.com/@staticcms/app@^4.0.0/dist/static-cms-app.js"></script>
<script>
window.CMS.init();
</script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 KiB