start working on main page category links, add categories to rentals page

This commit is contained in:
brooke 2024-06-08 21:01:38 -04:00
parent da4a05be0f
commit e84f7d9083
9 changed files with 214 additions and 200 deletions

View file

@ -1,38 +0,0 @@
name: Hugo
on:
push:
branches:
- main
jobs:
build:
runs-on: hugo-latest
steps:
- name: Temp fix to update hugo
run: wget "https://github.com/gohugoio/hugo/releases/download/v0.126.3/hugo_extended_0.126.3_Linux-64bit.tar.gz" && tar xf "hugo_extended_0.126.3_Linux-64bit.tar.gz" && mv ./hugo /usr/bin/hugo && rm -f hugo_extended_0.126.3_Linux-64bit.tar.gz LICENSE README.md
- name: Grab packages
run: apt install -y rsync openssh-client
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Run build task
run: hugo --minify
- name: Test static page
run: bash ${{ gitea.workspace }}/bin/test_static_page.sh
- name: Deploy to Server
uses: https://git.myco.systems/mirrors/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}
# - name: Running Page Speed Insights
# uses: https://github.com/JakePartusch/psi-action@v1.3
# id: drafting
# with:
# url: "https://gallowelding.com"
# threshold: 70
# strategy: desktop

View file

@ -0,0 +1,25 @@
name: Hugo
on:
push:
branches:
- main
jobs:
build:
runs-on: hugo-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: Run build task
run: hugo --minify
- name: Deploy to Server
uses: https://git.myco.systems/mirrors/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.RUNNER_SSH_PRIVATE_KEY }}
ARGS: "-rlgoDzvc -i --delete"
SOURCE: "public/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.REMOTE_TARGET }}

View file

@ -1,26 +0,0 @@
#!/bin/bash
PORT=8080
python3 -m http.server $PORT --directory public/ &
SERVER_PID=$!
# Give it a moment to start
sleep 1
# Check if the server is running
if ! ps -p $SERVER_PID > /dev/null; then
echo "HTTP server failed to start."
exit 1
fi
# Check HTTP status
status_code=$(curl -o /dev/null -s -w "%{http_code}" http://localhost:$PORT)
# Kill the http server
kill $SERVER_PID
# Check if status code is 200
if [ "$status_code" -ne 200 ]; then
echo "Website returned a non-200 status code: $status_code"
exit 1
fi

View file

@ -12,6 +12,10 @@ params:
industries. With over a decade of experience, Ian Gallo specializes in industries. With over a decade of experience, Ian Gallo specializes in
hand-welded, durable structures at affordable prices while prioritizing hand-welded, durable structures at affordable prices while prioritizing
professionalism and inclusivity. professionalism and inclusivity.
catalogButtons:
home:
- categoryName: 'aslkjjdlk'
img: https://placehold.co/300x200/
social: social:
main: main:
- url: 'mailto:iangalloart@gmail.com' - url: 'mailto:iangalloart@gmail.com'

View file

@ -72,7 +72,7 @@
{ {
"item": "5ft Half Circle Arch ", "item": "5ft Half Circle Arch ",
"quant": "1", "quant": "1",
"dimensions": "60\" wide, custom height", "dimensions": "60\" wide, (custom height)",
"baseCost": "$350", "baseCost": "$350",
"deliveryPickup": "", "deliveryPickup": "",
"installBreakdown": "", "installBreakdown": "",

View file

@ -1,3 +1,4 @@
{{ define "main" }} {{ define "main" }}
{{ partial "header.html" . }} {{ partial "header.html" . }}
{{ partial "categories.html" . }}
{{ end }} {{ end }}

View file

@ -0,0 +1,5 @@
{{ range .Site.Params.catalogButtons.home }}
<a target="_blank" href="/catalog/#{{ .categoryName }}">
<img src="{{ .img }}">
</a>
{{ end }}

View file

@ -1,147 +1,190 @@
<div class="mt-8 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-4"> <div
{{ range .Params.catalog }} class="mt-8 grid grid-cols-1 sm:grid-cols-2 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-3 gap-4"
{{ if ne .item "" }} >
<div class="flex flex-col bg-white rounded-lg border p-4 relative"> {{ range .Params.catalog }} {{ if ne .item "" }}
<img src="https://placehold.co/300x200/" alt="Placeholder Image" class="w-full h-48 rounded-md object-cover" /> <div class="flex flex-col bg-white rounded-lg border p-4 relative">
<div class="px-1 pt-4"> <img
<div class="font-bold text-xl mb-2">{{ .item }}</div> src="https://placehold.co/300x200/"
<div class="text-gray-800 text-base"> alt="Placeholder Image"
{{ if ne .quant "" }} class="w-full h-48 rounded-md object-cover"
<div class="flex flex-row justify-between"> />
<strong>Quantity:</strong> <div class="px-1 pt-4">
<span>{{ .quant }}</span> <div class="flex flex-row gap-2 justify-between font-bold text-xl mb-2">
</div> {{ .item }} {{ if ne .cat "" }}
{{ end }} <div>
{{ if ne .dimensions "" }} <span
<div class="text-right flex flex-row justify-between"> class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded-full dark:bg-blue-900 dark:text-blue-300"
<strong>Dimensions:</strong> >{{ .cat }}</span
<span>{{ .dimensions }}</span> >
</div> </div>
{{ end }} {{ end }}
{{ if ne .baseCost "" }} </div>
<div class="flex flex-row justify-between"> <div class="text-gray-800 text-base">
<strong>Base Cost:</strong> {{ if ne .quant "" }}
<span>{{ .baseCost }}</span> <div class="flex flex-row justify-between">
</div> <strong>Quantity:</strong>
{{ end }} <span>{{ .quant }}</span>
{{ if ne .deliveryPickup "" }} </div>
<div class="flex flex-row justify-between"> {{ end }} {{ if ne .dimensions "" }}
<strong>+ Delivery/Pickup:</strong> <div class="text-right flex flex-row justify-between">
<span>{{ .deliveryPickup }}</span> <strong>Dimensions:</strong>
</div> <span>{{ .dimensions }}</span>
{{ end }} </div>
{{ if ne .installBreakdown "" }} {{ end }} {{ if ne .baseCost "" }}
<div class="flex flex-row justify-between"> <div class="flex flex-row justify-between">
<strong>+ Install/Breakdown:</strong> <strong>Base Cost:</strong>
<span>{{ .installBreakdown }}</span> <span>{{ .baseCost }}</span>
</div> </div>
{{ end }} {{ end }} {{ if ne .deliveryPickup "" }}
{{ if ne .purchaseCost "" }} <div class="flex flex-row justify-between">
<div class="flex flex-row justify-between"> <strong>+ Delivery/Pickup:</strong>
<strong>Purchase Cost:</strong> <span>{{ .deliveryPickup }}</span>
<span>{{ .purchaseCost }}</span> </div>
</div> {{ end }} {{ if ne .installBreakdown "" }}
{{ end }} <div class="flex flex-row justify-between">
</div> <strong>+ Install/Breakdown:</strong>
</div> <span>{{ .installBreakdown }}</span>
<div class="h-full grid grid-cols-1 place-items-end"> </div>
<a class="w-full" href="#modal-{{ .item | urlize }}"> {{ end }} {{ if ne .purchaseCost "" }}
<button type="button" class="w-full px-3 py-2 text-xs font-medium text-center text-white bg-black rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none transition-all duration-200"> <div class="flex flex-row justify-between">
Expand <strong>Purchase Cost:</strong>
</button> <span>{{ .purchaseCost }}</span>
</a> </div>
</div> {{ end }}
<div id="modal-{{ .item | urlize }}" class="fixed z-10 inset-0 overflow-y-auto hidden" aria-labelledby="modal-title" role="dialog" aria-modal="true"> </div>
<div class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"> </div>
<div class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity" aria-hidden="true"></div> <div class="h-full grid grid-cols-1 place-items-end pt-5">
<span class="hidden sm:inline-block sm:align-middle sm:h-screen" aria-hidden="true">&#8203;</span> <a class="w-full" href="#modal-{{ .item | urlize }}">
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"> <button
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> type="button"
<div class="sm:flex sm:items-start"> class="w-full px-3 py-2 text-xs font-medium text-center text-white bg-black rounded-lg hover:bg-gray-800 focus:ring-4 focus:outline-none transition-all duration-200"
<div class="w-full mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-black sm:mx-0 sm:h-10 sm:w-10"> >
<svg class="h-6 w-6 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> Expand
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /> </button>
</svg> </a>
</div>
<div
id="modal-{{ .item | urlize }}"
class="fixed z-10 inset-0 overflow-y-auto hidden bg-gray-500 bg-opacity-75 transition-opacity"
aria-labelledby="modal-title"
role="dialog"
aria-modal="true"
>
<div
class="flex items-end justify-center min-h-screen p-4 text-center sm:block sm:p-0"
>
<div class="fixed inset-0" aria-hidden="true"></div>
<span
class="hidden sm:inline-block sm:align-middle sm:h-screen"
aria-hidden="true"
>&#8203;</span
>
<div
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle self-center sm:max-w-lg w-full"
>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div
class="w-full mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-black sm:mx-0 sm:h-10 sm:w-10"
>
<svg
class="h-6 w-6 text-white"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
aria-hidden="true"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</div>
<div class="w-full mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-xl mb-2" id="modal-title">
<strong>{{ .item }}</strong>
</h3>
<div class="px-1 pt-4 w-full">
<div class="text-gray-800 text-base">
{{ if ne .quant "" }}
<div class="flex flex-row justify-between">
<strong>Quantity:</strong>
<span>{{ .quant }}</span>
</div> </div>
<div class="w-full mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"> {{ end }} {{ if ne .dimensions "" }}
<h3 class="text-xl mb-2" id="modal-title"><strong>{{ .item }}</strong> details</h3> <div class="flex flex-row justify-between">
<div class="px-1 pt-4 w-full"> <strong>Dimensions:</strong>
<div class="text-gray-800 text-base"> <span>{{ .dimensions }}</span>
{{ if ne .quant "" }}
<div class="flex flex-row justify-between">
<strong>Quantity:</strong>
<span>{{ .quant }}</span>
</div>
{{ end }}
{{ if ne .dimensions "" }}
<div class="flex flex-row justify-between">
<strong>Dimensions:</strong>
<span>{{ .dimensions }}</span>
</div>
{{ end }}
{{ if ne .baseCost "" }}
<div class="flex flex-row justify-between">
<strong>Base Cost:</strong>
<span>{{ .baseCost }}</span>
</div>
{{ end }}
{{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between">
<strong>Delivery/Pickup:</strong>
<span>{{ .deliveryPickup }}</span>
</div>
{{ end }}
{{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between">
<strong>Install/Breakdown:</strong>
<span>{{ .installBreakdown }}</span>
</div>
{{ end }}
{{ if ne .purchaseCost "" }}
<div class="flex flex-row justify-between">
<strong>Purchase Cost:</strong>
<span>{{ .purchaseCost }}</span>
</div>
{{ end }}
{{ if ne .cat "" }}
<div class="flex flex-row justify-between">
<strong>Category:</strong>
<span>{{ .cat }}</span>
</div>
{{ end }}
</div>
</div>
</div> </div>
{{ end }} {{ if ne .baseCost "" }}
<div class="flex flex-row justify-between">
<strong>Base Cost:</strong>
<span>{{ .baseCost }}</span>
</div>
{{ end }} {{ if ne .deliveryPickup "" }}
<div class="flex flex-row justify-between">
<strong>Delivery/Pickup:</strong>
<span>{{ .deliveryPickup }}</span>
</div>
{{ end }} {{ if ne .installBreakdown "" }}
<div class="flex flex-row justify-between">
<strong>Install/Breakdown:</strong>
<span>{{ .installBreakdown }}</span>
</div>
{{ end }} {{ if ne .purchaseCost "" }}
<div class="flex flex-row justify-between">
<strong>Purchase Cost:</strong>
<span>{{ .purchaseCost }}</span>
</div>
{{ end }} {{ if ne .cat "" }}
<div class="flex flex-row justify-between">
<strong>Category:</strong>
<span>{{ .cat }}</span>
</div>
{{ end }}
</div> </div>
</div> </div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button type="button" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-black text-base font-medium text-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black sm:ml-3 sm:w-auto sm:text-sm" @click="open = false">
Close
</button>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button
id="close-modal"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-black text-base font-medium text-white hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-black sm:ml-3 sm:w-auto sm:text-sm"
@click="open = false"
>
Close
</button>
</div>
</div> </div>
{{ end }} </div>
{{ end }} </div>
</div> </div>
{{ end }} {{ end }}
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const modalButtons = document.querySelectorAll(".grid-cols-1 a");
const closeButtons = document.querySelectorAll("#close-modal");
const modals = document.querySelectorAll(".fixed");
<script> modalButtons.forEach((button) => {
const buttons = document.querySelectorAll('button[type="button"]'); button.addEventListener("click", function (e) {
buttons.forEach(button => { e.preventDefault();
button.addEventListener('click', event => { const modalId = this.getAttribute("href").substring(1);
const modalId = event.target.parentElement.getAttribute('href'); const modal = document.getElementById(modalId);
const modal = document.querySelector(modalId); modal.classList.remove("hidden");
modal.classList.remove('hidden');
}); });
}); });
const closeButtons = document.querySelectorAll('button[type="button"].close-modal'); closeButtons.forEach((button) => {
closeButtons.forEach(button => { button.addEventListener("click", function (e) {
button.addEventListener('click', event => { e.preventDefault();
const modal = event.target.closest('.modal'); modals.forEach((modal) => modal.classList.add("hidden"));
modal.classList.add('hidden');
}); });
}); });
</script> });
</script>

File diff suppressed because one or more lines are too long