finish up translations and setup doc server stuff
This commit is contained in:
17
app/package-lock.json
generated
17
app/package-lock.json
generated
@ -1,16 +1,14 @@
|
||||
{
|
||||
"name": "website",
|
||||
"version": "5.0.0",
|
||||
"version": "6.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "website",
|
||||
"version": "5.0.0",
|
||||
"version": "6.0",
|
||||
"dependencies": {
|
||||
"@types/dompurify": "^3.2.0",
|
||||
"dompurify": "^3.2.3",
|
||||
"marked": "^15.0.4",
|
||||
"svelte-i18n": "^4.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
@ -1398,17 +1396,6 @@
|
||||
"@jridgewell/sourcemap-codec": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "15.0.4",
|
||||
"resolved": "https://registry.npmjs.org/marked/-/marked-15.0.4.tgz",
|
||||
"integrity": "sha512-TCHvDqmb3ZJ4PWG7VEGVgtefA5/euFmsIhxtD0XsBxI39gUSKL81mIRFdt0AiNQozUahd4ke98ZdirExd/vSEw==",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/memoizee": {
|
||||
"version": "0.4.17",
|
||||
"resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.17.tgz",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "6.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "VITE_BUG_REPORT_URL=https://github.com/ngn13/website/issues VITE_API_URL=http://127.0.0.1:7001 VITE_FRONTEND_URL=http://localhost:5173 vite dev",
|
||||
"dev": "vite --port 7002 dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview --host",
|
||||
"lint": "prettier --check .",
|
||||
@ -22,8 +22,6 @@
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@types/dompurify": "^3.2.0",
|
||||
"dompurify": "^3.2.3",
|
||||
"marked": "^15.0.4",
|
||||
"svelte-i18n": "^4.0.1"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { urljoin } from "$lib/util.js";
|
||||
|
||||
const version = "v1";
|
||||
const url = urljoin(import.meta.env.VITE_API_URL, version);
|
||||
const url = urljoin(import.meta.env.APP_API_URL, version);
|
||||
|
||||
function api_url(path = null, query = {}) {
|
||||
return urljoin(url, path, query);
|
||||
|
@ -15,7 +15,7 @@
|
||||
{error}
|
||||
{/if}
|
||||
</code>
|
||||
<Link link={import.meta.env.VITE_BUG_REPORT_URL}>
|
||||
<Link link={import.meta.env.APP_REPORT_URL}>
|
||||
{$_("error.report")}
|
||||
</Link>
|
||||
<img src="/profile/sad.png" alt="" />
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script>
|
||||
import { color, date_from_ts } from "$lib/util.js";
|
||||
import { urljoin, color, date_from_ts, language } from "$lib/util.js";
|
||||
import { get_metrics } from "$lib/api.js";
|
||||
import Link from "$lib/link.svelte";
|
||||
|
||||
@ -17,15 +17,21 @@
|
||||
<div class="info">
|
||||
<div class="links">
|
||||
<span>
|
||||
<Link href="/" bold={true}>{$_("footer.source")}</Link>
|
||||
<Link link={import.meta.env.APP_SOURCE_URL} bold={true}>{$_("footer.source")}</Link>
|
||||
</span>
|
||||
<span>/</span>
|
||||
<span>
|
||||
<Link href="/" bold={true}>{$_("footer.license")}</Link>
|
||||
<Link
|
||||
link={urljoin(import.meta.env.APP_DOC_URL, "license", { lang: $language })}
|
||||
bold={true}>{$_("footer.license")}</Link
|
||||
>
|
||||
</span>
|
||||
<span>/</span>
|
||||
<span>
|
||||
<Link href="/" bold={true}>{$_("footer.privacy")}</Link>
|
||||
<Link
|
||||
link={urljoin(import.meta.env.APP_DOC_URL, "privacy", { lang: $language })}
|
||||
bold={true}>{$_("footer.privacy")}</Link
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
<span>
|
||||
|
@ -2,20 +2,30 @@
|
||||
import { language, set_lang } from "$lib/util.js";
|
||||
import languages from "$lib/lang.js";
|
||||
|
||||
let icon = "",
|
||||
let icon = null,
|
||||
indx = 0,
|
||||
len = languages.length;
|
||||
|
||||
function next() {
|
||||
if (indx >= languages.length) indx = 0;
|
||||
function next_indx() {
|
||||
if (indx + 1 >= len) return 0;
|
||||
return indx + 1;
|
||||
}
|
||||
|
||||
icon = languages[indx].icon;
|
||||
set_lang(languages[indx++].code);
|
||||
function next_lang(inc) {
|
||||
let new_indx = next_indx();
|
||||
if (inc) indx = new_indx;
|
||||
return languages[new_indx];
|
||||
}
|
||||
|
||||
function next() {
|
||||
set_lang(next_lang(true).code);
|
||||
icon = next_lang(false).icon;
|
||||
}
|
||||
|
||||
for (indx = 0; indx < len; indx++) {
|
||||
if (languages[indx].code == $language) {
|
||||
icon = languages[indx++].icon;
|
||||
set_lang(languages[indx].code);
|
||||
icon = next_lang(false).icon;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -6,12 +6,9 @@
|
||||
import { _ } from "svelte-i18n";
|
||||
|
||||
export let service = {};
|
||||
let style = "";
|
||||
|
||||
if (service.check_res == 0) style = "opacity: 70%";
|
||||
</script>
|
||||
|
||||
<main {style}>
|
||||
<main>
|
||||
<div class="info">
|
||||
<div class="title">
|
||||
<h1>{service.name}</h1>
|
||||
@ -44,7 +41,7 @@
|
||||
{$_("services.status.up")}
|
||||
</span>
|
||||
{:else if service.check_res == 2}
|
||||
<span style="background: var(--white-2)">
|
||||
<span style="background: var(--{color()}); filter: brightness(50%);">
|
||||
{$_("services.status.slow")}
|
||||
</span>
|
||||
{/if}
|
||||
@ -70,6 +67,7 @@
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: var(--white-1);
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
main .info .title h1 {
|
||||
|
@ -49,13 +49,13 @@ function urljoin(url, path = null, query = {}) {
|
||||
else if (path[0] === "/") url = new URL(path.slice(1), url);
|
||||
else url = new URL(path, url);
|
||||
|
||||
for (let k in query) url.searchParams.append(query[k]);
|
||||
for (let k in query) url.searchParams.append(k, query[k]);
|
||||
|
||||
return url.href;
|
||||
}
|
||||
|
||||
function frontend_url(path = null, query = {}) {
|
||||
return urljoin(import.meta.env.VITE_FRONTEND_URL, path, query);
|
||||
return urljoin(import.meta.env.APP_URL, path, query);
|
||||
}
|
||||
|
||||
function color() {
|
||||
|
@ -2,7 +2,6 @@
|
||||
"navbar": {
|
||||
"home": "home",
|
||||
"services": "services",
|
||||
"news": "news",
|
||||
"donate": "donate"
|
||||
},
|
||||
"home": {
|
||||
@ -10,7 +9,7 @@
|
||||
"welcome": {
|
||||
"title": "about",
|
||||
"desc": "Welcome to my website, I'm ngn",
|
||||
"whoami": "I'm a privacy, security and freedom addvocate high-schooler from Turkey",
|
||||
"whoami": "I'm a security, privacy and freedom advocate high-schooler from Turkey",
|
||||
"interest": "I'm interested in system security and software development",
|
||||
"support": "I love and support Free/Libre and Open Source Software (FLOSS)"
|
||||
},
|
||||
@ -35,7 +34,7 @@
|
||||
"security": "All use SSL encrypted connection and they are all privacy-respecting",
|
||||
"privacy": "Accessible from clearnet, TOR and I2P, no region or network blocks",
|
||||
"bullshit": "No CDNs, no cloudflare, no CAPTCHA, no analytics, no bullshit",
|
||||
"link": "Check them out!"
|
||||
"link": "See all the services!"
|
||||
},
|
||||
"projects": {
|
||||
"title": "projects",
|
||||
@ -54,11 +53,11 @@
|
||||
}
|
||||
},
|
||||
"donate": {
|
||||
"title": "donate money!",
|
||||
"info": "I spend a lot of time working on different projects and maintaining different services.",
|
||||
"price": "I mostly pay for hosting and electricity. Which when added up costs around 550₺ per month, that is Turkish Lira, equals to ~$15 at time of writing (ik the economy is great).",
|
||||
"details": "So even a small donation would be highly appreciated and it would help me keep everything up and running.",
|
||||
"thanks": "Also huge thanks to all of you who has donated so far, as I said, I highly appreciate it. Thank you!",
|
||||
"title": "Donate Money!",
|
||||
"info": "I spend a lot of time and money on different projects and maintaining different services.",
|
||||
"price": "I mostly pay for hosting and electricity. Which when added up costs around 550₺ per month (~$15 at the time of writing).",
|
||||
"details": "So even a small donation would be useful. And it would help me keep everything up and running.",
|
||||
"thanks": "Also huge thanks to all of you who have donated so far!",
|
||||
"table": {
|
||||
"platform": "Platform",
|
||||
"address": "Adress/Link"
|
||||
@ -66,7 +65,7 @@
|
||||
},
|
||||
"error": {
|
||||
"title": "Something went wrong!",
|
||||
"report": "report this issue"
|
||||
"report": "Report this issue"
|
||||
},
|
||||
"footer": {
|
||||
"source": "Source",
|
||||
|
@ -1,19 +1,21 @@
|
||||
{
|
||||
"navbar": {
|
||||
"home": "anasayfa",
|
||||
"news": "haberler",
|
||||
"services": "servisler",
|
||||
"language": "dil"
|
||||
"donate": "bağış"
|
||||
},
|
||||
"home": {
|
||||
"title": "Merhaba Dünya!",
|
||||
"welcome": {
|
||||
"title": "Websiteme hoşgeldiniz, ben ngn",
|
||||
"title": "hakkımda",
|
||||
"desc": "Websiteme hoşgeldiniz, ben ngn",
|
||||
"whoami": "Türkiye'den, güvenlik, gizlik ve özgürlük savunucusu bir liseliyim",
|
||||
"interest": "Sistem güvenliği ve yazılım geliştirmek ile ilgileniyorum",
|
||||
"support": "Özgür/Libre ve Açık Kaynaklı Yazılımı (FLOSS) seviyorum ve destekliyorum"
|
||||
},
|
||||
"work": {
|
||||
"title": "Zamanım çoğunlukla şunlar ile geçiyor...",
|
||||
"title": "iş",
|
||||
"desc": "Şuan bir işim yok, o yüzden zamanımın çoğunu şunlarla geçiriyorum:",
|
||||
"build": "salak şeyler inşa etmek",
|
||||
"fix": "salak şeyleri düzeltmek",
|
||||
"ctf": "CTF challenge'ları çözmek",
|
||||
@ -21,24 +23,56 @@
|
||||
"wiki": "wikimi genişletmek"
|
||||
},
|
||||
"links": {
|
||||
"title": "Eğer benim ile iletişime geçmek istiyorsanız, işte bazı faydalı linkler",
|
||||
"prefer": "tercihim"
|
||||
"title": "iletişim",
|
||||
"desc": "Eğer benim ile iletişime geçmek istiyorsanız, işte bazı faydalı linkler",
|
||||
"prefer": "Email'i fazlasıyla tercih ediyorum, PGP anahtarım ile şifreli email'ler gönderebilirsiniz"
|
||||
},
|
||||
"info": {
|
||||
"title": "Salak şeyler inşa etmenin yanı sıra, herkes için kullanıma açık özgür ve ücretsiz servisler host ediyorum",
|
||||
"services": {
|
||||
"title": "servisler",
|
||||
"desc": "Salak şeyler inşa etmenin yanı sıra, herkes için kullanıma açık özgür ve ücretsiz servisler host ediyorum",
|
||||
"speed": "Tüm servisler 600 Mbit/s ağ arayüzü üzerinden erişilebilir",
|
||||
"security": "Hepsi SSL şifreli bağlantı kullanıyor ve hepsi gizliğinize saygı gösteriyor",
|
||||
"privacy": "Accessible from clearnet, TOR and I2P, no region or network blocks",
|
||||
"privacy": "Açık ağdan, TOR ve I2P'den erişilebilirler, bölge ya da ağ blokları yok",
|
||||
"bullshit": "CDN yok, cloudflare yok, CAPTCHA yok, analitikler yok, boktan saçmalıklar yok",
|
||||
"link": "tüm servisleri incele"
|
||||
"link": "Tüm servisleri incele!"
|
||||
},
|
||||
"projects": {
|
||||
"title": "projeler",
|
||||
"desc": "Çoğunlukla özgür yazılım projeleri üzerinde çalışıyorum, işte ilginç bulabileceğiniz bazı projelerim"
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"title": "Servis Durumu",
|
||||
"search": "Bir servisi ara",
|
||||
"feed": "Yenilikler ve güncellemeler",
|
||||
"last": "Son kontrol zamanı {time}",
|
||||
"status": {
|
||||
"up": "Çalışıyor",
|
||||
"down": "Kapalı",
|
||||
"slow": "Yavaş"
|
||||
}
|
||||
},
|
||||
"donate": {
|
||||
"title": "Para Bağışla!",
|
||||
"info": "Farklı projeler ve farklı servisleri yönetmek için oldukça zaman ve para harcıyorum.",
|
||||
"price": "Çoğunlukla hosting ve elektrik için ödeme yapıyorum. Bunlar eklendiği zaman aylık 550₺ civarı bir miktar oluyor (yazdığım sırada ~15$).",
|
||||
"details": "Bu sebepten küçük bir bağış bile oldukça faydalı olacaktır. Ve herşeyi açık ve çalışmakta tutmama yardımcı olacaktır.",
|
||||
"thanks": "Ayrıca şuana kadar bağışta bulunan herkese çok teşekkür ederim!",
|
||||
"table": {
|
||||
"platform": "Platform",
|
||||
"address": "Adres/Bağlantı"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"title": "Birşeyler yanlış gitti!",
|
||||
"report": "Bu sorunu raporlayın"
|
||||
},
|
||||
"footer": {
|
||||
"source": "Kaynak",
|
||||
"license": "Lisans",
|
||||
"privacy": "Gizlilik",
|
||||
"powered": "Svelte, Go, SQLite ve yemek param tarafından destekleniyor",
|
||||
"powered": "Svelte, Go, SQLite ve bağışlar tarafından destekleniyor",
|
||||
"number": "{since} tarihinden beri {number}. ziyaretçisiniz",
|
||||
"congrat": "tebrikler!!",
|
||||
"version": "Kullan API versiyonu {api_version}, arayüz versiyonu {frontend_version}"
|
||||
|
@ -54,7 +54,7 @@
|
||||
</Card>
|
||||
<Card title={$_("home.services.title")}>
|
||||
<span>
|
||||
{$_("home.services.desc")}
|
||||
{$_("home.services.desc")}:
|
||||
</span>
|
||||
<ul>
|
||||
<li>
|
||||
@ -81,7 +81,9 @@
|
||||
{$_("home.projects.desc")}:
|
||||
</span>
|
||||
<ul>
|
||||
{#each projects as project}
|
||||
{#each projects.filter((p) => {
|
||||
return p.desc[$language] !== "" && p.desc[$language] !== null && p.desc[$language] !== undefined;
|
||||
}) as project}
|
||||
<li>
|
||||
<Link active={true} link={project.url}>{project.name}</Link>:
|
||||
{project.desc[$language]}
|
||||
|
@ -38,7 +38,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="services">
|
||||
{#each services as service}
|
||||
{#each services.filter((s) => {
|
||||
return s.desc[$language] !== "" && s.desc[$language] !== null && s.desc[$language] !== undefined;
|
||||
}) as service}
|
||||
<Service {service} />
|
||||
{/each}
|
||||
</div>
|
||||
|
@ -3,12 +3,25 @@ import { defineConfig } from "vite";
|
||||
import { fileURLToPath } from "url";
|
||||
import { readFileSync } from "fs";
|
||||
|
||||
const default_env = {
|
||||
REPORT_URL: "https://github.com/ngn13/website/issues",
|
||||
SOURCE_URL: "https://github.com/ngn13/website",
|
||||
API_URL: "http://localhost:7001",
|
||||
URL: "http://localhost:7002",
|
||||
DOC_URL: "http://localhost:7003",
|
||||
};
|
||||
|
||||
const file = fileURLToPath(new URL("package.json", import.meta.url));
|
||||
const json = readFileSync(file, "utf8");
|
||||
const pkg = JSON.parse(json);
|
||||
|
||||
for (let env in default_env) {
|
||||
if (process.env["APP_" + env] === undefined) process.env["APP_" + env] = default_env[env];
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()],
|
||||
envPrefix: "APP",
|
||||
define: {
|
||||
pkg: pkg,
|
||||
},
|
||||
|
Reference in New Issue
Block a user