diff --git a/elixir-api/lib/routes/api/v1/about.ex b/elixir-api/lib/routes/api/v1/about.ex index 39b812da9..be25d0ebd 100644 --- a/elixir-api/lib/routes/api/v1/about.ex +++ b/elixir-api/lib/routes/api/v1/about.ex @@ -32,13 +32,9 @@ defmodule Router.Api.V1.About do ["'objectID'", "_id"], "_rev", "_type", - "at", "bio", "body", - "now", - "location", "contact", - "fullname", %{ "timeline[]" => [ "title", diff --git a/elixir-api/lib/routes/api/v1/project.ex b/elixir-api/lib/routes/api/v1/project.ex index e84d96e6c..e48074d39 100644 --- a/elixir-api/lib/routes/api/v1/project.ex +++ b/elixir-api/lib/routes/api/v1/project.ex @@ -76,20 +76,26 @@ defmodule Router.Api.V1.Project do _ -> 1 end - case params["lang"] do - "en" -> result - "fr" -> Translate.translate(:project, result, "fr", "en") - _ -> conn |> error_res(400, "Invalid request", "Invalid language") |> halt() - end - |> case do - {:error, message} -> - Logger.error("Error translating post: #{inspect(message)}") - result + translated_result = + case params["lang"] do + "en" -> result + "fr" -> Translate.translate(:project, result, "fr", "en") + _ -> conn |> error_res(400, "Invalid request", "Invalid language") |> halt() + end + |> case do + {:error, message} -> + Logger.error("Error translating post: #{inspect(message)}") + result + + translated_result -> + translated_result + end - translated_result -> - translated_result - end - |> Kernel.put_in(["result", "headings"], PT.build_summary(& &1["result"]["body"])) + Kernel.put_in( + translated_result, + ["result", "headings"], + PT.build_summary(translated_result["result"]["body"]) + ) |> Map.put("meta", %{ "total" => count, "count" => count, diff --git a/sanity-cms/schemas/author.ts b/sanity-cms/schemas/author.ts index 790acac00..2683a9d65 100644 --- a/sanity-cms/schemas/author.ts +++ b/sanity-cms/schemas/author.ts @@ -14,18 +14,6 @@ export default { type: 'string', validation: (Rule: Rule) => Rule.required() }, - { - name: 'fullname', - title: 'Full name', - type: 'string', - validation: (Rule: Rule) => Rule.required() - }, - { - name: 'at', - title: '@username', - type: 'string', - validation: (Rule: Rule) => Rule.required() - }, { name: 'image', title: 'Image', @@ -41,13 +29,6 @@ export default { of: BodyBlocks, validation: (Rule: Rule) => Rule.required() }, - { - name: 'now', - title: 'Now', - type: 'array', - of: BodyBlocks, - validation: (Rule: Rule) => Rule.required() - }, Body, { name: 'contact', diff --git a/sanity-cms/schemas/settings.ts b/sanity-cms/schemas/settings.ts index 2f0da9804..8299ae8f0 100644 --- a/sanity-cms/schemas/settings.ts +++ b/sanity-cms/schemas/settings.ts @@ -9,10 +9,6 @@ export default { name: 'pages', title: 'Pages' }, - { - name: 'experiments', - title: 'Experiments' - }, { name: 'links', title: 'Links' diff --git a/svelte-app/src/app.scss b/svelte-app/src/app.scss index 5f64da3dd..0e58e7540 100644 --- a/svelte-app/src/app.scss +++ b/svelte-app/src/app.scss @@ -30,7 +30,7 @@ img { body { @apply h-full w-full overflow-x-hidden; - background-color: $dark; + background-color: $dark; --textColour: $light; &.light { diff --git a/svelte-app/src/components/nav.svelte b/svelte-app/src/components/nav.svelte index 545a70c71..438a0acb2 100644 --- a/svelte-app/src/components/nav.svelte +++ b/svelte-app/src/components/nav.svelte @@ -3,75 +3,72 @@ import { slide } from 'svelte/transition'; import { linkTo } from '$i18n'; - import { BASE_ANIMATION_DURATION, TOP_LEVEL_ROUTES } from '$lib/consts'; + import { BASE_ANIMATION_DURATION, NAV_LINKS } from '$lib/consts'; import { navOpen } from '$stores/navigation'; import LanguageControls from '$components/controls/language-toggle.svelte'; import MenuToggle from '$components/controls/menu-toggle.svelte'; import ThemeToggle from '$components/controls/theme-toggle.svelte'; + import Hoverable from '$components/hoverable.svelte'; import NavLink from '$components/nav/nav-link.svelte'; - const navLinks = TOP_LEVEL_ROUTES.filter((route) => !route.hidden)?.map((route) => ({ - name: route.name, - url: route.path - })); + let hovered = false;
- +
diff --git a/svelte-app/src/components/nav/nav-link.svelte b/svelte-app/src/components/nav/nav-link.svelte index 3a7af1d18..ef925c673 100644 --- a/svelte-app/src/components/nav/nav-link.svelte +++ b/svelte-app/src/components/nav/nav-link.svelte @@ -70,7 +70,7 @@ {/if} diff --git a/svelte-app/src/components/portable-text/serializers/custom-link.svelte b/svelte-app/src/components/portable-text/serializers/custom-link.svelte index 299753c00..04ac81e99 100644 --- a/svelte-app/src/components/portable-text/serializers/custom-link.svelte +++ b/svelte-app/src/components/portable-text/serializers/custom-link.svelte @@ -20,36 +20,11 @@ href={href ? $linkTo(href) : '#'} target={newtab ? '_blank' : undefined} rel={newtab ? 'noopener noreferrer' : ''} - class="focusOutline-sm rounded-sm from-accent-light px-[2px] text-dark/90 no-underline dark:from-accent-dark dark:text-light" - class:active={hovered} + class="focusOutline-sm rounded-sm from-accent-light text-dark/90 underline decoration-accent-light underline-offset-[2px] dark:text-light dark:decoration-accent-dark {hovered + ? 'decoration-[3px]' + : 'decoration-2'}" tabindex="0" > {plainTextContent} - - diff --git a/svelte-app/src/lib/consts.ts b/svelte-app/src/lib/consts.ts index 6f098a700..052432a46 100644 --- a/svelte-app/src/lib/consts.ts +++ b/svelte-app/src/lib/consts.ts @@ -72,6 +72,13 @@ export const ROUTE_ORDER = [ 'etc' ]; +export const NAV_LINKS = TOP_LEVEL_ROUTES.filter((route) => !route.hidden)?.map( + (route) => ({ + name: route.name, + url: route.path + }) +); + export const BASE_TRANSITION_DURATION = 200 as const; export const BASE_ANIMATION_DURATION = 300 as const; diff --git a/svelte-app/types/app/documents/author.d.ts b/svelte-app/types/app/documents/author.d.ts index 3f0e177c2..051db6340 100644 --- a/svelte-app/types/app/documents/author.d.ts +++ b/svelte-app/types/app/documents/author.d.ts @@ -1,14 +1,11 @@ +import type { Document } from '$types/documents'; import type { - SanityImageObject, - InputValue, - SanityAsset, - PTBlock, ArbitraryTypedObject, - PortableTextBlock + PortableTextBlock, + SanityAsset, + SanityImageObject } from '$types/sanity'; -import type { Document } from '$types/documents'; - export type AuthorTimelineItem = SanityAsset & { title: string; subtitle?: string; @@ -25,13 +22,8 @@ export type AuthorTimelineItem = SanityAsset & { }; export interface AuthorDocument extends Omit { - at: string; bio: (PortableTextBlock | ArbitraryTypedObject)[]; - now: (PortableTextBlock | ArbitraryTypedObject)[]; name: string; - fullname: string; - at: string; - location: string; image: SanityImageObject; timeline: AuthorTimelineItem[]; contact: (PortableTextBlock | ArbitraryTypedObject)[];