Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new version and design #68

Merged
merged 37 commits into from
Jan 19, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
689802d
Update about section in English and Spanish translations
Michael-Liendo Jan 17, 2024
40707bb
Update user main design
Michael-Liendo Jan 17, 2024
5c2b1bf
Update main container padding
Michael-Liendo Jan 17, 2024
ff7413b
Refactor SocialMedia component
Michael-Liendo Jan 17, 2024
e5e4f6e
Add schema.org metadata to +page.svelte
Michael-Liendo Jan 17, 2024
99c2764
create a Bentogrids and create the design for the first item
Michael-Liendo Jan 17, 2024
3bed6c6
chore: add 2 item of the bento grid
Michael-Liendo Jan 17, 2024
20c683d
create the 3 item of the grid
Michael-Liendo Jan 17, 2024
f0624ae
Update styling for note cards
Michael-Liendo Jan 17, 2024
ff17606
Fix note links in +page.svelte
Michael-Liendo Jan 17, 2024
cae9766
Update SocialMedia and +page components
Michael-Liendo Jan 17, 2024
105c381
Add title attribute to dark mode button
Michael-Liendo Jan 17, 2024
1e67e2d
Update copyright year in footer
Michael-Liendo Jan 17, 2024
77764e3
Update note URLs in +page.svelte
Michael-Liendo Jan 18, 2024
2b0bb7f
Refactor page layout and metadata in notes component
Michael-Liendo Jan 18, 2024
1aee7b7
Update styling in +page and +page notes
Michael-Liendo Jan 18, 2024
32cf363
Remove unused imports and update meta tags in +page.svelte
Michael-Liendo Jan 18, 2024
dcea0f9
Update Header and Page styles
Michael-Liendo Jan 18, 2024
9c0b62c
Update background color in page links
Michael-Liendo Jan 18, 2024
8cc4722
Update font size and margin in homepage notes section
Michael-Liendo Jan 18, 2024
ca9a4fa
Update package.json version to 5.0.0
Michael-Liendo Jan 18, 2024
83a3d4f
Capacity on main route
Michael-Liendo Jan 18, 2024
3e84bf1
Refactor language selection links in Header.svelte and +page.svelte
Michael-Liendo Jan 19, 2024
07e1c44
Add Notion service and client code
Michael-Liendo Jan 19, 2024
703d402
Update import paths for Note types
Michael-Liendo Jan 19, 2024
c855ab6
Add type definitions for ProjectResponse and update project transformer
Michael-Liendo Jan 19, 2024
d6ee7f5
Refactor Entry and projects page components
Michael-Liendo Jan 19, 2024
6f0a8f6
Update layout styles in notes and projects pages
Michael-Liendo Jan 19, 2024
6e0ffe1
Refactor Entry component and note list layout
Michael-Liendo Jan 19, 2024
7bc3110
Update import statement in sitemap.xml server file
Michael-Liendo Jan 19, 2024
f77c060
Update sitemap routes
Michael-Liendo Jan 19, 2024
451a7e0
Update font size in homepage section
Michael-Liendo Jan 19, 2024
e57e331
Update language settings
Michael-Liendo Jan 19, 2024
5d72933
Update i18n-util imports and use baseLocale
Michael-Liendo Jan 19, 2024
965b056
Add new routes to sitemap.xml server file
Michael-Liendo Jan 19, 2024
15e5ffd
Refactor sitemap generation and add support for multiple languages
Michael-Liendo Jan 19, 2024
b22b362
Swap notesSlugsEn and notesSlugsEs in generateRoutes function
Michael-Liendo Jan 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update i18n-util imports and use baseLocale
Michael-Liendo committed Jan 19, 2024
commit 5d729335fca2d26910386f8b7784d3b55e29cb4d
4 changes: 2 additions & 2 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { initAcceptLanguageHeaderDetector } from 'typesafe-i18n/detectors';

import { loadAllLocales } from '$i18n/i18n-util.sync';
import { detectLocale, i18n, isLocale } from '$i18n/i18n-util';
import { baseLocale, detectLocale, i18n, isLocale } from '$i18n/i18n-util';

import type { Handle, RequestEvent } from '@sveltejs/kit';
import type { Locales } from '$i18n/i18n-types';
@@ -14,7 +14,7 @@ export const handle: Handle = async ({ event, resolve }) => {
const [, lang] = event.url.pathname.split('/');

// if slug is not a locale, use base locale (e.g. api endpoints)
const locale = isLocale(lang) ? (lang as Locales) : 'es';
const locale = isLocale(lang) ? (lang as Locales) : baseLocale;
const LL = L[locale];

// bind locale and translation functions to current request
3 changes: 2 additions & 1 deletion src/lib/components/Entry.svelte
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
import { page } from '$app/stores';
import { locale } from '$i18n/i18n-svelte';
import Calendar from '~icons/mdi/calendar-month';
import { baseLocale } from '$i18n/i18n-util';

import type { MultiSelectEntity } from '$lib/services/Notion/Notes/notes';

@@ -12,7 +13,7 @@
export let slug = '';
export let previewImageUrl: string | null = '';

const baseLocaleUrl = $locale === 'es' ? '' : `/${$locale}`;
const baseLocaleUrl = $locale === baseLocale ? '' : `/${$locale}`;

let formattedDate = new Date(publishDate).toLocaleDateString(
`${$page.data.locale}-us`,
3 changes: 2 additions & 1 deletion src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
@@ -12,8 +12,9 @@
import { replaceLocaleInUrl } from '$lib/utils/locale';

import type { Locales } from '$i18n/i18n-types';
import { baseLocale } from '$i18n/i18n-util';

const baseLocaleUrl = $locale === 'es' ? '' : `/${$locale}`;
const baseLocaleUrl = $locale === baseLocale ? '' : `/${$locale}`;

let useDarkMode = false;
let isLangMenuOpen = false;
4 changes: 2 additions & 2 deletions src/lib/utils/locale.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
//
// Otherwise (default) the URL relative to the base is returned.

import { locales } from '$i18n/i18n-util';
import { baseLocale, locales } from '$i18n/i18n-util';

// e.g. https://mywebsite.com/en/blog/article-1 => /de/blog/article-1
export const replaceLocaleInUrl = (
@@ -16,7 +16,7 @@ export const replaceLocaleInUrl = (
const [, ...rest] = url.pathname.split('/');

let new_pathname;
if (locale === 'es') {
if (locale === baseLocale) {
if ((locales as string[]).includes(rest[0])) {
new_pathname = `/${rest.slice(1).join('/')}`;
} else {
3 changes: 2 additions & 1 deletion src/routes/[[lang=lang]]/+page.svelte
Original file line number Diff line number Diff line change
@@ -4,12 +4,13 @@
import SocialMedia from '$lib/components/SocialMedia.svelte';

import type { Note } from '$lib/services/Notion/Notes/notes';
import { baseLocale } from '$i18n/i18n-util';

export let data: {
notes: Note[];
};

const baseLocaleUrl = $locale === 'es' ? '' : `/${$locale}`;
const baseLocaleUrl = $locale === baseLocale ? '' : `/${$locale}`;

let title = 'Michael Liendo | Software Developer';
let description =