1
mirror of https://github.com/importantimport/urara-docs.git synced 2024-09-18 18:08:39 +08:00
urara-docs/getting-started/configuration.md

132 lines
3.3 KiB
Markdown
Raw Permalink Normal View History

# Configuration
2022-02-11 23:04:51 +08:00
2023-01-13 02:13:04 +08:00
## Config Files
2022-02-11 23:04:51 +08:00
This project uses `/src/lib/config/` as the config file directory, but most configurations do not need to be modified in general.
### site.ts | Site Info
2022-02-11 23:04:51 +08:00
```ts
export const site: SiteConfig = {
protocol: import.meta.env.URARA_SITE_PROTOCOL ?? import.meta.env.DEV ? 'http://' : 'https://', // site protocol (usually no change is required)
domain: import.meta.env.URARA_SITE_DOMAIN ?? 'urara-demo.netlify.app', // site domain
2022-02-11 23:04:51 +08:00
title: 'Urara', // title
subtitle: 'Sweet & Powerful SvelteKit Blog Template', // subtitle
2023-04-11 20:43:56 +08:00
lang: 'en', // language
2022-02-11 23:04:51 +08:00
descr: 'Powered by SvelteKit/Urara', // description
author: {
name: 'John Doe', // author name
avatar: '/assets/maskable@512.png', // author image
2022-02-11 23:04:51 +08:00
status: '🌸', // author status
bio: 'lorem ipsum dolor sit amet, consectetur adipiscing elit.' // author bio
},
themeColor: '#3D4451' // theme color (currently only used in Manifest)
}
```
2023-01-13 02:20:53 +08:00
### icon.ts | Icons
Some icons are provided by default to be compatible with web app manifests and modern browsers, and can be replaced by yourself.
2023-02-27 20:03:52 +08:00
```
2023-01-13 02:20:53 +08:00
/urara/favicon.png - Website icon, 32x32
/urara/assets/any@180.png - Website icon, 180x180
/urara/assets/any@192.png - Website/Manifest icon, 192x192
/urara/assets/any@512.png - Manifest icon, 512x512
/urara/assets/manifest@192.png - Manifest mask icon, 192x192
/urara/assets/manifest@512.png - Manifest mask icon, 512x512
```
You can also replace the number of icons and their paths by modifying `/src/lib/config/icon.ts`.
### general.ts | Theme
```ts
export const theme: ThemeConfig = [
{
name: 'light', // Theme varable name
text: '🌕 Light' // Theme display name, can be modified
},
{
name: 'dark',
text: '🌑 Dark'
},
]
```
2023-01-13 21:57:01 +08:00
This project uses the [**daisyUI**](https://daisyui.com/) theme, see the availble [**daisyUI themes**](https://daisyui.com/docs/themes/?lang=en).
### general.ts | Header
```ts
export const header: HeaderConfig = {
nav: [
{
text: 'Get Started', // Button name
link: '/hello-world' // Link to page, or other sites
},
{
text: 'Elements',
link: '/hello-world/elements'
}
]
}
```
Dropdown menu can added to the header following the format below.
```ts
{
text: 'Hello World',
children: [
{
text: 'Get Started',
link: '/hello-world'
},
{
text: 'Elements',
link: '/hello-world/elements'
},
{
text: 'ToC Disabled',
link: '/hello-world/toc-disabled'
}
]
}
```
### general.ts | Footer
Same as the Header, except the dropdown menu.
```ts
export const footer: FooterConfig = {
nav: [
{
text: 'Feed', // Hypelink name
link: '/atom.xml' // Link to page, or other sites
},
{
text: 'Sitemap',
link: '/sitemap.xml'
}
]
}
```
### general.ts | Date Format
```ts
export const date: DateConfig = {
2023-04-11 20:43:56 +08:00
locales: 'en', // Language, refer to IETF language tag
options: {
2023-01-25 21:19:56 +08:00
year: '2-digit', // Year: numeric / 2-digit
weekday: 'long', // Week: narrow / short / long
month: 'short', // Month: numeric / 2-digit / narrow / short / long
day: 'numeric' // day: numeric / 2-digit
}
}
```
2023-01-13 21:57:01 +08:00
For more additonal, see [**Intl.DateTimeFormat - JavaScript | MDN**](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat).