mirror of
https://github.com/Sevichecc/Urara-Blog.git
synced 2025-04-30 10:29:31 +08:00
merge with upsteam 455fcd5941
This commit is contained in:
parent
ffd76f5d56
commit
6583df822e
4 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { site } from '$lib/config/site'
|
import { site } from '$lib/config/site'
|
||||||
import Image from '$lib/components/prose/img.svelte'
|
// import Image from '$lib/components/prose/img.svelte'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="sticky flex flex-col gap-4 top-24 xl:ml-auto xl:mr-8 xl:max-w-xs">
|
<div class="sticky flex flex-col gap-4 top-24 xl:ml-auto xl:mr-8 xl:max-w-xs">
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
<a href={site.protocol + site.domain} class="hidden u-url u-uid">{site.author.name}</a>
|
<a href={site.protocol + site.domain} class="hidden u-url u-uid">{site.author.name}</a>
|
||||||
<figure class="relative mx-auto group">
|
<figure class="relative mx-auto group">
|
||||||
{#if site.author.avatar}
|
{#if site.author.avatar}
|
||||||
<Image
|
<img
|
||||||
class="u-photo rounded-full shadow-xl w-32 h-32 hover:rotate-[360deg] transition-transform duration-1000 ease-in-out"
|
class="u-photo rounded-full shadow-xl w-32 h-32 hover:rotate-[360deg] transition-transform duration-1000 ease-in-out"
|
||||||
src={site.author.avatar}
|
src={site.author.avatar}
|
||||||
alt={site.author.name} />
|
alt={site.author.name} />
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
/* @see {@link https://github.com/sveltejs/kit/issues/241#issuecomment-1363621896} */
|
/* @see {@link https://github.com/sveltejs/kit/issues/241#issuecomment-1363621896} */
|
||||||
|
|
||||||
const images = import.meta.glob('/static/**/*.{jpg,jpeg,png,webp,avif}', {
|
const images = import.meta.glob(['/static/**/*.{jpg,jpeg,png,webp,avif}', '!/static/assets'], {
|
||||||
import: 'default',
|
import: 'default',
|
||||||
eager: true
|
eager: true
|
||||||
})
|
})
|
||||||
|
|
||||||
const sources = import.meta.glob('/static/**/*.{jpg,jpeg,png,webp,avif}', {
|
const sources = import.meta.glob(['/static/**/*.{jpg,jpeg,png,webp,avif}', '!/static/assets'], {
|
||||||
query: {
|
query: {
|
||||||
format: 'avif',
|
quality: '80',
|
||||||
width: '384;768',
|
width: '736',
|
||||||
source: ''
|
source: ''
|
||||||
},
|
},
|
||||||
import: 'default',
|
import: 'default',
|
||||||
|
@ -35,5 +35,5 @@
|
||||||
|
|
||||||
<picture>
|
<picture>
|
||||||
<source srcset={source.map(({ src, w }) => `${src} ${w}w`).join(', ')} type="image/avif" />
|
<source srcset={source.map(({ src, w }) => `${src} ${w}w`).join(', ')} type="image/avif" />
|
||||||
<img src={image.src} width={image.w} height={image.h} {alt} class={className ?? 'rounded-lg my-2'} {loading} {decoding} />
|
<img src={image.src} {alt} class={className ?? 'rounded-lg my-2'} {loading} {decoding} />
|
||||||
</picture>
|
</picture>
|
|
@ -16,7 +16,7 @@ export default defineConfig({
|
||||||
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
|
extensions: ['.svelte', ...(mdsvexConfig.extensions as string[])],
|
||||||
preprocess: [mdsvex(mdsvexConfig), importAssets(), vitePreprocess()],
|
preprocess: [mdsvex(mdsvexConfig), importAssets(), vitePreprocess()],
|
||||||
kit: {
|
kit: {
|
||||||
adapter: Object.keys(process.env).some(key => ['VERCEL', 'CF_PAGES', 'NETLIFY'].includes(key))
|
adapter: Object.keys(process.env).some(key => ['VERCEL', 'NETLIFY'].includes(key))
|
||||||
? adapterAuto()
|
? adapterAuto()
|
||||||
: process.env.ADAPTER === 'node'
|
: process.env.ADAPTER === 'node'
|
||||||
? adapterNode({ out: 'build' })
|
? adapterNode({ out: 'build' })
|
||||||
|
|
2
urara.ts
2
urara.ts
|
@ -102,7 +102,7 @@ const clean = () => {
|
||||||
switch (process.argv[2]) {
|
switch (process.argv[2]) {
|
||||||
case 'watch':
|
case 'watch':
|
||||||
{
|
{
|
||||||
let watcher = chokidar.watch('urara', {
|
const watcher = chokidar.watch('urara', {
|
||||||
ignored: (file: string) => path.basename(file).startsWith('.')
|
ignored: (file: string) => path.basename(file).startsWith('.')
|
||||||
})
|
})
|
||||||
watcher
|
watcher
|
||||||
|
|
Loading…
Reference in a new issue