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
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
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 (!hideOnPrintParam) {
|
||||
window.location.href = `${window.location.href}${window.location.href.indexOf("?") > 0 ? "&" : "?"}hideOnPrint=1`;
|
||||
}
|
||||
|
||||
if (locale && locale != getLocale()) {
|
||||
setLocale(locale);
|
||||
}
|
||||
});
|
||||
|
||||
function getFormattedDate(): string {
|
||||
|
|
@ -49,7 +54,9 @@
|
|||
</script>
|
||||
|
||||
<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="This CV is made completely with svelte + html + css + js"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<script>
|
||||
import { getLocale, setLocale, locales } from "$paraglide/runtime";
|
||||
import re from "@ts/Redaction/Redactor";
|
||||
|
||||
import RepeatedSkills from "./RepeatedSkills.svelte";
|
||||
|
||||
// Cedit
|
||||
|
|
@ -8,6 +11,7 @@
|
|||
export let Class = "";
|
||||
</script>
|
||||
|
||||
<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)]">
|
||||
<RepeatedSkills
|
||||
|
|
@ -24,6 +28,16 @@
|
|||
<!-- </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>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
|
|
@ -46,8 +60,8 @@
|
|||
// Text inside
|
||||
display: grid;
|
||||
place-content: center;
|
||||
border-bottom: var(--left-decor-line-color) dotted 0.5mm;
|
||||
border-top: 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 1mm;
|
||||
|
||||
&:first-child {
|
||||
color: var(--left-decor-text-color);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ const CV = z.object({
|
|||
|
||||
const ProfileSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
key: z.string().min(1),
|
||||
selfie: z.string().min(1),
|
||||
nick: z.string().min(1),
|
||||
shortProfileHiddenContent: z.array(z.string()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue