mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
refactor: update theme configuration and background styles
This commit is contained in:
parent
8eb0876c01
commit
d148649454
9 changed files with 129 additions and 4214 deletions
|
@ -4,7 +4,6 @@ import mdx from '@astrojs/mdx'
|
|||
import partytown from '@astrojs/partytown'
|
||||
import sitemap from '@astrojs/sitemap'
|
||||
import { transformerCopyButton } from '@rehype-pretty/transformers'
|
||||
import swup from '@swup/astro'
|
||||
import compress from 'astro-compress'
|
||||
import robotsTxt from 'astro-robots-txt'
|
||||
import { defineConfig } from 'astro/config'
|
||||
|
@ -61,16 +60,6 @@ export default defineConfig({
|
|||
sitemap: true,
|
||||
}),
|
||||
compress(),
|
||||
swup({
|
||||
theme: false,
|
||||
animationClass: 'transition-swup-',
|
||||
cache: true,
|
||||
preload: true,
|
||||
accessibility: true,
|
||||
smoothScrolling: true,
|
||||
updateHead: true,
|
||||
updateBodyClass: true,
|
||||
}),
|
||||
],
|
||||
markdown: {
|
||||
remarkPlugins: [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "astro-theme-retyprset",
|
||||
"name": "astro-theme-retypeset",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
|
@ -20,7 +20,6 @@
|
|||
"@astrojs/rss": "^4.0.11",
|
||||
"@astrojs/sitemap": "^3.2.1",
|
||||
"@rehype-pretty/transformers": "^0.13.2",
|
||||
"@swup/astro": "^1.5.0",
|
||||
"@unocss/reset": "^65.4.2",
|
||||
"astro": "^5.1.7",
|
||||
"astro-compress": "^2.3.6",
|
||||
|
|
4278
pnpm-lock.yaml
generated
4278
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -9,7 +9,7 @@ interface Props {
|
|||
|
||||
const { postTitle, postDescription, postImage } = Astro.props
|
||||
const { title, subtitle, description, author, url, favicon } = themeConfig.site
|
||||
const { light: { backgroundStart: lightMode }, dark: { backgroundStart: darkMode } } = themeConfig.color
|
||||
const { light: { backgroundTop: lightMode }, dark: { backgroundTop: darkMode } } = themeConfig.color
|
||||
const { locale, moreLocale } = themeConfig.global
|
||||
const { verification = {}, twitterID = '', facebookID = '', facebookLink = '', googleAnalyticsID = '', umamiAnalyticsID = '', siteScreenshot = '' } = themeConfig.seo ?? {}
|
||||
const { google = '', bing = '', yandex = '', baidu = '' } = verification
|
||||
|
|
|
@ -16,13 +16,13 @@ export const themeConfig: ThemeConfig = {
|
|||
color: {
|
||||
mode: 'light',
|
||||
light: {
|
||||
primary: '#232323',
|
||||
backgroundStart: '#ffffff',
|
||||
backgroundEnd: '#ffeeee',
|
||||
text: '#232323',
|
||||
backgroundTop: '#f8f8f8',
|
||||
backgroundEnd: '#FDE9EB',
|
||||
},
|
||||
dark: {
|
||||
primary: '#000000',
|
||||
backgroundStart: '#ffffff',
|
||||
text: '#000000',
|
||||
backgroundTop: '#ffffff',
|
||||
backgroundEnd: '#000000',
|
||||
},
|
||||
},
|
||||
|
@ -31,9 +31,8 @@ export const themeConfig: ThemeConfig = {
|
|||
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> START
|
||||
global: {
|
||||
locale: 'zh', // zh, zh-tw, ja, en, es, ru, default locale setting
|
||||
moreLocale: ['zh-tw', 'ja', 'en', 'es', 'ru'], // ['zh-tw', 'ja', 'en', 'es', 'ru'], not fill in the default locale code again
|
||||
font: 'sans', // sans, serif, choose the font style for posts
|
||||
toc: true, // true, false, whether to enable table of contents in posts
|
||||
moreLocale: ['zh-tw', 'ja', 'en', 'es', 'ru'], // ['zh', 'zh-tw', 'ja', 'en', 'es', 'ru'], NOT fill in the default locale code again
|
||||
font: 'sans', // sans, serif, italic, choose the font style for posts
|
||||
},
|
||||
// GLOBAL SETTINGS >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> END
|
||||
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
---
|
||||
import Head from '@/components/Head.astro'
|
||||
import themeConfig from '@/config'
|
||||
import '@/styles/global.css'
|
||||
|
||||
const fontStyle = `font-${themeConfig.global.font}`
|
||||
---
|
||||
|
||||
<html lang={Astro.currentLocale || 'en-US'}>
|
||||
<html lang={Astro.currentLocale || 'en-US'} class={fontStyle}>
|
||||
<head>
|
||||
<Head />
|
||||
</head>
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
:root {
|
||||
--uno-colors-primary: theme('colors.primary');
|
||||
--uno-colors-backgroundStart: theme('colors.backgroundStart');
|
||||
--uno-colors-text: theme('colors.text');
|
||||
--uno-colors-backgroundTop: theme('colors.backgroundTop');
|
||||
--uno-colors-backgroundEnd: theme('colors.backgroundEnd');
|
||||
}
|
||||
html {
|
||||
--at-apply: 'min-h-full font-sans text-[62.5%] bg-gradient-to-b from-backgroundStart to-backgroundEnd c-primary antialiased scroll-smooth';
|
||||
}
|
||||
--at-apply: 'antialiased scroll-smooth text-62.5%';
|
||||
}
|
||||
body {
|
||||
--at-apply: 'min-h-screen text-[1.6rem] m-0';
|
||||
}
|
||||
--at-apply: 'min-h-screen min-h-dvh bg-gradient-to-b from-backgroundTop to-backgroundEnd bg-fixed overscroll-none text-1.6rem c-text';
|
||||
}
|
||||
h1, h2, h3 {
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ h5 {
|
|||
h6 {
|
||||
--at-apply: 'text-[1.6rem]';
|
||||
}
|
||||
:where(p) {
|
||||
--at-apply: 'text-primary/85';
|
||||
}
|
||||
/* :where(p) {
|
||||
--at-apply: 'text-text/85';
|
||||
} */
|
||||
|
|
9
src/types/index.d.ts
vendored
9
src/types/index.d.ts
vendored
|
@ -14,13 +14,13 @@ export interface ThemeConfig {
|
|||
color: {
|
||||
mode: 'light' | 'dark'
|
||||
light: {
|
||||
primary: string
|
||||
backgroundStart: string
|
||||
text: string
|
||||
backgroundTop: string
|
||||
backgroundEnd: string
|
||||
}
|
||||
dark: {
|
||||
primary: string
|
||||
backgroundStart: string
|
||||
text: string
|
||||
backgroundTop: string
|
||||
backgroundEnd: string
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ export interface ThemeConfig {
|
|||
locale: typeof langPath[number]
|
||||
moreLocale: typeof langPath[number][]
|
||||
font: string
|
||||
toc: boolean
|
||||
}
|
||||
|
||||
comment?: {
|
||||
|
|
|
@ -37,7 +37,7 @@ export default defineConfig({
|
|||
colors: light,
|
||||
fontFamily: {
|
||||
title: ['Snell-Black', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
time: ['Snell-Bold', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
date: ['Snell-Bold', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
serif: ['STIX', 'EarlySummer', 'Georgia', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
italic: ['STIX-italic', 'EarlySummer', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
custom: ['EarlySummer-custom', 'ui-serif', 'Georgia', 'Cambria', 'Times New Roman', 'Times', 'serif'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue