multi lang CV with link
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / Rebuild Signaller (push) Has been cancelled
Some checks failed
Rebuild signaller for deprived.dev to rebuild site / Rebuild Signaller (push) Has been cancelled
This commit is contained in:
parent
ad138b5de5
commit
ed2c8a4657
3 changed files with 39 additions and 17 deletions
|
|
@ -31,11 +31,16 @@
|
||||||
// Check if the query parameter exists in the URL
|
// Check if the query parameter exists in the URL
|
||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
const hideOnPrintParam = urlParams.get("hideOnPrint");
|
const hideOnPrintParam = urlParams.get("hideOnPrint");
|
||||||
|
const locale = urlParams.get("locale");
|
||||||
|
|
||||||
// If the query parameter is not detected, reload the page with the parameter added
|
// If the query parameter is not detected, reload the page with the parameter added
|
||||||
if (!hideOnPrintParam) {
|
if (!hideOnPrintParam) {
|
||||||
window.location.href = `${window.location.href}${window.location.href.indexOf("?") > 0 ? "&" : "?"}hideOnPrint=1`;
|
window.location.href = `${window.location.href}${window.location.href.indexOf("?") > 0 ? "&" : "?"}hideOnPrint=1`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (locale && locale != getLocale()) {
|
||||||
|
setLocale(locale);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function getFormattedDate(): string {
|
function getFormattedDate(): string {
|
||||||
|
|
@ -49,7 +54,9 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<title>{$re?.name ?? "Alex"}'s CV {getFormattedDate()}</title>
|
<title
|
||||||
|
>{$re?.name ?? "Alex"}'s {getLocale().toUpperCase()} CV {getFormattedDate()}</title
|
||||||
|
>
|
||||||
<meta content="{$re?.name ?? 'Alex'}'s CV" property="og:title" />
|
<meta content="{$re?.name ?? 'Alex'}'s CV" property="og:title" />
|
||||||
<meta
|
<meta
|
||||||
content="This CV is made completely with svelte + html + css + js"
|
content="This CV is made completely with svelte + html + css + js"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
|
import { getLocale, setLocale, locales } from "$paraglide/runtime";
|
||||||
|
import re from "@ts/Redaction/Redactor";
|
||||||
|
|
||||||
import RepeatedSkills from "./RepeatedSkills.svelte";
|
import RepeatedSkills from "./RepeatedSkills.svelte";
|
||||||
|
|
||||||
// Cedit
|
// Cedit
|
||||||
|
|
@ -8,7 +11,8 @@
|
||||||
export let Class = "";
|
export let Class = "";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="container {Class}" style={Style}>
|
<div class="flex justify-end w-full">
|
||||||
|
<div class="container {Class}" style={Style}>
|
||||||
<div class="NotoSans-cn text-center bg-[var(--left-grid-bg-color)]">
|
<div class="NotoSans-cn text-center bg-[var(--left-grid-bg-color)]">
|
||||||
<RepeatedSkills
|
<RepeatedSkills
|
||||||
textOverride={["Hello", "你好", "Hej"]}
|
textOverride={["Hello", "你好", "Hej"]}
|
||||||
|
|
@ -23,6 +27,16 @@
|
||||||
<!-- <LinkToSource /> -->
|
<!-- <LinkToSource /> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
</div>
|
||||||
|
<div class="z-10 pr-4 pt-2 {!$re?.name ? 'hidden' : ''}">
|
||||||
|
<a
|
||||||
|
href="/cv?locale={getLocale() == 'en' ? 'dk' : 'en'}&key={$re?.key ??
|
||||||
|
'nah'}"
|
||||||
|
><span class="text-blue-500 underline"
|
||||||
|
>{getLocale() == "en" ? "Dansk" : "English"} CV</span
|
||||||
|
></a
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
@ -46,8 +60,8 @@
|
||||||
// Text inside
|
// Text inside
|
||||||
display: grid;
|
display: grid;
|
||||||
place-content: center;
|
place-content: center;
|
||||||
border-bottom: var(--left-decor-line-color) dotted 0.5mm;
|
border-bottom: var(--left-decor-line-color) dotted 1mm;
|
||||||
border-top: var(--left-decor-line-color) dotted 0.5mm;
|
border-top: var(--left-decor-line-color) dotted 1mm;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
color: var(--left-decor-text-color);
|
color: var(--left-decor-text-color);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ const CV = z.object({
|
||||||
|
|
||||||
const ProfileSchema = z.object({
|
const ProfileSchema = z.object({
|
||||||
name: z.string().min(1),
|
name: z.string().min(1),
|
||||||
|
key: z.string().min(1),
|
||||||
selfie: z.string().min(1),
|
selfie: z.string().min(1),
|
||||||
nick: z.string().min(1),
|
nick: z.string().min(1),
|
||||||
shortProfileHiddenContent: z.array(z.string()),
|
shortProfileHiddenContent: z.array(z.string()),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue