Files
pages/generate.ps1
T
Odyssey c2caafd521 Initial commit
Signed-off-by: Odyssey <hi@odyssey346.dev>
2023-04-01 10:39:16 +02:00

58 lines
2.1 KiB
PowerShell

Import-Module PSHTML
html {
head {
title "GotHub instances"
meta -charset "utf-8"
meta -name "viewport" -content "width=device-width, initial-scale=1"
link -rel "stylesheet" -href "css/site.css"
}
body {
div -Class "header-container" {
h1 "GotHub instances"
$GotHubRepo = a -href "https://codeberg.org/gothub/gothub" -Content "the GotHub repository"
p "This page lists all the instances for GotHub. If you want to add your instance to this list, please create a PR on $GotHubRepo."
}
$instances = Invoke-WebRequest https://codeberg.org/gothub/gothub-instances/raw/branch/master/instances.json | ConvertFrom-Json
# Todo: don't use a table, instead use card design.
div -Class "table-container" {
table {
thead {
tr {
th "Link"
th "Cloudflare"
th "Version"
th "Branch"
th "Country"
th "Hosting provider"
}
}
tbody {
$instances | ForEach-Object {
tr {
td {
a -href $_.link -Content $_.link
}
td $_.cloudflare
td $_.version
td $_.branch
td $_.country
td $_.host
}
}
}
}
}
footer {
$OdysseyLink = a -href "https://odyssey346.dev" -Content "Odyssey346"
$PSHTMLLink = a -href "https://pshtml.readthedocs.io" -Content "PSHTML"
$SiteRepo = a -href "https://codeberg.org/gothub/gothub-instances" -Content "here"
p "Site made by $OdysseyLink. Updated every 12 hours. Last update: $(Get-Date -Format "dd/MM/yyyy HH:mm:ss")"
p "This site is made with $PSHTMLLink. Site source code is available $SiteRepo."
}
}
}