diff --git a/README.md b/README.md index 1548cfb..3a52f56 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ string[] or string field make `Page` component that uses the $page store to get the current collection document +-- + +check todo +important transform function for fields + --- - "inline" properties like: diff --git a/src/_modules/fields.ts b/src/_modules/fields.ts index 3c3771a..43a9e00 100644 --- a/src/_modules/fields.ts +++ b/src/_modules/fields.ts @@ -23,6 +23,13 @@ type DateFormats = 'yyyy-MM' | 'yyyy-MM-dd'; export const DateString = (dateFormat: DateFormats) => T.Transform(T.String()).Decode(stringToDate).Encode(dateToString(dateFormat)); +// TODO - Aggiungere funzioni come kirby +// export const Date = (format: DateFormats) => +// T.Transform(T.String()).Decode((date_string) => ({ +// format: () => formatDate(date_string, format), +// _raw: date_string +// })).Encode(dateToString(format)); + // export const DateSpan = (dateFormat: DateFormats = 'yyyy-MM-dd') => // T.Object({ // date_start: DateString(dateFormat), diff --git a/src/app.pcss b/src/app.pcss index e2d5e42..2640d49 100644 --- a/src/app.pcss +++ b/src/app.pcss @@ -6,3 +6,7 @@ .link { @apply cursor-pointer text-blue-600 underline hover:text-blue-400; } + +.button { + @apply inline-block rounded-xl bg-blue-500 p-4 text-white; +} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 996ca33..80e9adb 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -2,44 +2,49 @@ import { Collection, Document, Relation } from '$modules/components'; import DocumentContent from '$modules/components/DocumentContent.svelte'; import { db } from '$modules/index'; + import { href } from '$modules/utils'; const links = db.get_paths(); -
- {#each links as link} - {link} - {/each} -
+
+
+ {#each links as link} + {link} + {/each} +
-CV +
+ CV - -
{JSON.stringify(doc)}
- ciao -
+ +
{JSON.stringify(doc)}
+ ciao +
-
+
- -
- {#each documents as experience} -
- -
{JSON.stringify(experience, null, 2)}
+ +
+ {#each documents as experience} +
+ +
{JSON.stringify(experience, null, 2)}
- -
{JSON.stringify(doc, null, 2)}
- -
+ +
{JSON.stringify(doc, null, 2)}
+ +
+
+ {/each}
- {/each} +
- +
diff --git a/src/routes/cv/+page.svelte b/src/routes/cv/+page.svelte index e69de29..50b8942 100644 --- a/src/routes/cv/+page.svelte +++ b/src/routes/cv/+page.svelte @@ -0,0 +1,61 @@ + + +Home + + +
+

Esperienze lavorative attuali

+ {#each documents as document} + {#if document.props?.current} +
+

{document.props.roles.join(', ')}

+ +

{doc.props?.name}

+
+

+ + {formatDate(document.props.date_start, 'MM / yyyy')} + + -> + oggi +

+
+ + {/if} + {/each} + +

Esperienze lavorative passate

+ {#each documents as document} + {#if document.props?.date_end} +
+

{document.props.roles.join(', ')}

+ +

{doc.props?.name}

+
+

+ + {formatDate(document.props.date_start, 'MM / yyyy')} + + -> + oggi +

+
+ + {/if} + {/each} +
+