-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
401 additions
and
327 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
plugins: { | ||
tailwindcss: {}, | ||
autoprefixer: {}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,38 @@ | ||
// This file was auto-generated by 'typesafe-i18n'. Any manual changes will be overwritten. | ||
/* eslint-disable */ | ||
|
||
import { i18n as initI18n, i18nObject as initI18nObject, i18nString as initI18nString } from 'typesafe-i18n' | ||
import { | ||
i18n as initI18n, | ||
i18nObject as initI18nObject, | ||
i18nString as initI18nString, | ||
} from 'typesafe-i18n' | ||
import type { LocaleDetector } from 'typesafe-i18n/detectors' | ||
import type { LocaleTranslationFunctions, TranslateByString } from 'typesafe-i18n' | ||
import { detectLocale as detectLocaleFn } from 'typesafe-i18n/detectors' | ||
import type { Formatters, Locales, Translations, TranslationFunctions } from './i18n-types' | ||
|
||
export const baseLocale: Locales = 'en' | ||
|
||
export const locales: Locales[] = [ | ||
'en', | ||
'vi' | ||
] | ||
export const locales: Locales[] = ['en', 'vi'] | ||
|
||
export const isLocale = (locale: string): locale is Locales => locales.includes(locale as Locales) | ||
|
||
export const loadedLocales: Record<Locales, Translations> = {} as Record<Locales, Translations> | ||
|
||
export const loadedFormatters: Record<Locales, Formatters> = {} as Record<Locales, Formatters> | ||
|
||
export const i18nString = (locale: Locales): TranslateByString => initI18nString<Locales, Formatters>(locale, loadedFormatters[locale]) | ||
export const i18nString = (locale: Locales): TranslateByString => | ||
initI18nString<Locales, Formatters>(locale, loadedFormatters[locale]) | ||
|
||
export const i18nObject = (locale: Locales): TranslationFunctions => | ||
initI18nObject<Locales, Translations, TranslationFunctions, Formatters>( | ||
locale, | ||
loadedLocales[locale], | ||
loadedFormatters[locale] | ||
loadedFormatters[locale], | ||
) | ||
|
||
export const i18n = (): LocaleTranslationFunctions<Locales, Translations, TranslationFunctions> => | ||
initI18n<Locales, Translations, TranslationFunctions, Formatters>(loadedLocales, loadedFormatters) | ||
|
||
export const detectLocale = (...detectors: LocaleDetector[]): Locales => detectLocaleFn<Locales>(baseLocale, locales, ...detectors) | ||
export const detectLocale = (...detectors: LocaleDetector[]): Locales => | ||
detectLocaleFn<Locales>(baseLocale, locales, ...detectors) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import type { LayoutServerLoad } from './$types' | ||
import { getTopTags } from '$lib/db/tag' | ||
|
||
export const load: LayoutServerLoad = async ({ locals: { locale } }) => { | ||
return { locale, tags: await getTopTags({ posts: false }) } | ||
return { locale } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,5 @@ | ||
<script lang="ts"> | ||
import '../app.css' | ||
import { setLocale } from '$i18n/i18n-svelte' | ||
import Firebase from '$lib/Firebase.svelte' | ||
import Navbar from '$ui/Navbar.svelte' | ||
import type { LayoutData } from './$types' | ||
import Sidebar from '$components/Sidebar.svelte' | ||
import Rightbar from '$ui/Rightbar.svelte' | ||
import dayjs from 'dayjs' | ||
import 'dayjs/locale/vi' | ||
import { page } from '$app/stores' | ||
import { SvelteToast } from '@zerodevx/svelte-toast' | ||
import relativeTime from 'dayjs/plugin/relativeTime' | ||
import utc from 'dayjs/plugin/utc' | ||
export let data: LayoutData | ||
dayjs.extend(relativeTime) | ||
dayjs.extend(utc) | ||
setLocale(data.locale) | ||
switch ($page.params.lang) { | ||
case 'vi': | ||
dayjs.locale('vi') | ||
break | ||
} | ||
</script> | ||
|
||
<Firebase /> | ||
<div class="drawer"> | ||
<input id="drawer-left" type="checkbox" class="drawer-toggle" /> | ||
<div class="drawer-content flex flex-col min-h-screen bg-base-200"> | ||
<Navbar /> | ||
|
||
<div class="flex w-full mx-auto pt-4 overflow-hidden min-h-[90%]"> | ||
<aside class="w-72 hidden lg:block rounded-box bg-base-100"> | ||
<Sidebar /> | ||
</aside> | ||
<main class="flex flex-col w-full max-w-5xl ml-auto overflow-auto"> | ||
<slot /> | ||
</main> | ||
<aside class="w-72 mx-auto hidden lg:block"> | ||
<Rightbar tags={data.tags} /> | ||
</aside> | ||
</div> | ||
</div> | ||
<div class="drawer-side"> | ||
<label for="drawer-left" class="drawer-overlay" /> | ||
<ul class="menu p-4 overflow-y-auto w-80 bg-base-100"> | ||
<Sidebar /> | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<SvelteToast /> | ||
<slot /> |
Oops, something went wrong.
eafb65d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
bayquamon – ./
bayquamon.vercel.app
bayquamon-btl01.vercel.app
bayquamon-git-main-btl01.vercel.app