1
0
dwelling-home/web/stuff.templ

178 lines
6.2 KiB
Plaintext
Raw Permalink Normal View History

package web
import "net/http"
import "github.com/invopop/ctxi18n/i18n"
import "git.arav.su/Arav/dwelling-home/pkg/util"
templ Stuff(r *http.Request) {
{{ gitSite := util.GetServiceByHost(r.Host, util.ServiceGit) }}
2024-09-15 16:15:57 +04:00
@base(i18n.T(ctx, "base.section.stuff"), i18n.T(ctx, "stuff.description"), "articles, programs, personal projects, own music", "/stuff", r, nil) {
<p class="center">{ i18n.T(ctx, "stuff.text") }</p>
<section id="articles">
2024-09-15 16:15:57 +04:00
<h2>{ i18n.T(ctx, "stuff.article.h") }</h2>
<table>
<tr>
2024-09-15 16:15:57 +04:00
<th>{ i18n.T(ctx, "stuff.article.tabh-lu") }</th>
<th>{ i18n.T(ctx, "stuff.article.tabh-nm") }</th>
</tr>
for _, entry := range Metadata {
<tr>
<td>
2024-09-15 16:15:57 +04:00
<time datetime={ entry.Date.Format("2006-01-02") }>{ entry.Date.Format("02.01.2006") }</time>
</td>
<td>
<a href={ templ.URL(entry.URL) }>{ entry.Title }</a>
</td>
</tr>
}
</table>
</section>
<section id="programs-scripts">
2024-09-15 16:15:57 +04:00
<h2>{ i18n.T(ctx, "stuff.progs") }</h2>
<table>
2024-09-15 17:05:27 +04:00
for _, prog := range programs {
<tr>
<td><b>{ prog.Name }</b></td>
<td>{ prog.Version }</td>
<td>{ prog.Lang }</td>
<td>{ prog.License }</td>
<td>
<a href={ templ.URL(gitSite + prog.SourceLink) }>source</a>
if prog.ReleasesLink != "" {
<a href={ templ.URL(gitSite + prog.ReleasesLink) }>releases</a>
}
</td>
</tr>
<tr>
<td colspan="5">
for _, line := range prog.Description[i18n.GetLocale(ctx).Code().String()] {
<p>@templ.Raw(line)</p>
}
</td>
</tr>
}
</table>
</section>
<section id="music">
2024-09-15 16:15:57 +04:00
<h2>{ i18n.T(ctx, "stuff.music.h") }</h2>
<p>{ i18n.T(ctx, "stuff.music.text-1") } <a href={ templ.URL(util.GetServiceByHost(r.Host, util.ServiceFiles) + "/music/My%20tracks,%20that%20survived/") }>{ i18n.T(ctx, "stuff.music.text-2") }</a>.</p>
</section>
}
}
2024-09-15 17:05:27 +04:00
type program struct {
Name string
Version string
Lang string
License string
SourceLink string
ReleasesLink string
Description map[string][]string
}
var programs []program = []program{
{
Name: "mccl",
Version: "0.1.2 (14.12.2023)",
Lang: "Go",
License: "GPLv3",
SourceLink: "/Arav/mccl",
ReleasesLink: "/Arav/mccl/releases",
Description: map[string][]string{
"en": {"A console Minecraft launcher. Take a look at README.md for explanation."},
"ru": {"Консольный лаунчер Minecraft. За подробностями в README.md."}},
},
{
Name: "httpr",
Version: "0.3.2 (20.09.2023)",
Lang: "Go",
License: "MIT",
SourceLink: "/Arav/httpr",
ReleasesLink: "/Arav/httpr/releases",
Description: map[string][]string{
"en": {
"A simple HTTP router that supports having both regular and parametrised path's parts at the same level, like <code>/assets/*filepath</code> and <code>/:a/:b</code> with the same HTTP method."},
"ru": {
"Простой HTTP роутер, который позволяет иметь на одном уровне и параметризованные и обычные пути, например, <code>/assets/*filepath</code> и <code>/:a/:b</code>."}},
},
{
Name: "justguestbook",
Version: "1.3.2 (22.05.2023)",
Lang: "Go",
License: "MIT",
SourceLink: "/Arav/justguestbook",
ReleasesLink: "",
Description: map[string][]string{
"en": {"A simple guestbook with owner's replies implementation made into a library."},
"ru": {"Простая гостевая книга в виде библиотеки с возможностью владельцу отвечать на посты."}},
},
{
Name: "justcaptcha",
Version: "2.1.0 (12.08.2023)",
Lang: "Go",
License: "MIT",
SourceLink: "/Arav/justcaptcha",
ReleasesLink: "",
Description: map[string][]string{
"en": {"A simple CAPTCHA implementation."},
"ru": {"Простая CAPTCHA."}},
},
{
Name: "kwh-cost",
Version: "1.1.3 (21.05.2024)",
Lang: "C",
License: "MIT+NIGGER",
SourceLink: "/Arav/kwh-cost",
ReleasesLink: "",
Description: map[string][]string{
"en": {"KWh cost calculator in C."},
"ru": {"Калькулятор стоимости кВтч на C."}},
},
{
Name: "httpprocprobed",
Version: "3.2.0 (7.07.2024)",
Lang: "Go",
License: "MIT+NIGGER",
SourceLink: "/Arav/httpprocprobed",
ReleasesLink: "",
Description: map[string][]string{
"en": {"It returns a list of processes and if they are running in a JSON format via HTTP GET request on <code>/processes</code> endpoint. Under the hood it searches in a /proc/ directory. It is being used on about page to show wether service's running or not."},
"ru": {"Возвращает JSON список процессов и запущены ли они. Процессы ищет считывая директорию <code>/proc/</code>. Использую на странице О... для показа статуса сервиса."}},
},
{
Name: "ScrapTheChan",
Version: "0.5.0 (3.05.2021)",
Lang: "Python",
License: "MIT",
SourceLink: "/Arav/ScrapTheChan",
ReleasesLink: "/Arav/ScrapTheChan/releases",
Description: map[string][]string{
"en": {"Imageboards file scraper using theirs JSON API. Currently supported: 4chan.org, lainchan.org, 2ch.hk and 8kun.top."},
"ru": {"Граббер файлов с имиджборд используя их JSON API. Работает с: 4chan.org, lainchan.org, 2ch.hk and 8kun.top."}},
},
{
Name: "OpenNIC active domains extraction script",
Version: "10.07.2020",
Lang: "Bash",
License: "MIT",
SourceLink: "/Arav/opennic-extract-domains",
ReleasesLink: "",
Description: map[string][]string{
"en": {"Bash script for BIND9 that extracts domains from zone files of OpenNIC and forms a list of domains that have an IP-address."},
"ru": {"Баш-скрипт для BIND9 извлекает домены OpenNIC у которых прописан IP-адрес."}},
},
{
Name: "PiggyBank",
Version: "1.0.0 (8.07.2020)",
Lang: "Python",
License: "MIT",
SourceLink: "/Arav/PiggyBank",
ReleasesLink: "/Arav/PiggyBank/releases",
Description: map[string][]string{
"en": {"A program to help you to keep track of your piggy bank. A simple script I once wrote that I rewrote and made into a package just to learn how to do it."},
"ru": {"Это просто копилка."}},
},
}