Files
pages/generate.ps1
T
Odyssey ae00272ae4 Change title of webpage
Signed-off-by: Odyssey <hi@odyssey346.dev>
2023-04-02 11:50:47 +02:00

62 lines
2.4 KiB
PowerShell

Import-Module PSHTML
html {
head {
title "GotHub"
meta -charset "utf-8"
meta -name "viewport" -content "width=device-width, initial-scale=1"
link -rel "stylesheet" -href "css/site.css"
# TODO: SEO
}
body {
div -Class "header-container" {
div -Class "header-logo-and-text" {
img -src "imgs/logo.svg" -alt "GotHub logo" -width "48" -height "48"
h1 "GotHub"
}
p "An alternative front-end for GitHub, written in Go."
div -Class "header-buttons" {
a -href "https://codeberg.org/gothub/gothub" -Class "button" -Content "Source code"
a -href "https://matrix.to/#/#gothub:matrix.org" -Class "button" -Content "Matrix room"
}
}
div -Class "instances-header-container" {
p "GotHub instances are listed below. The list is updated every 24 hours."
}
$instances = Invoke-WebRequest https://codeberg.org/gothub/gothub-instances/raw/branch/master/instances.json | ConvertFrom-Json
div -class "main" {
div -Class "instance-container" {
$instances | ForEach-Object {
a -href $_.link -Class "instance-card" {
div -Class "instance-header" {
p $_.link
}
div -Class "instance-body" {
if ($_.cloudflare) {
p "Cloudflare: Yes "
} else {
p "Cloudflare: No "
}
p "Version: $($_.version)"
p "Branch: $($_.branch)"
p "Country: $($_.country)"
p "Hosting provider: $($_.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/pages" -Content "here"
p "Site made by $OdysseyLink. Updated every 24 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."
}
}
}