File tree 4 files changed +41
-6
lines changed 4 files changed +41
-6
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
- $effect (() => {
3
- // @ts-ignore
4
- (adsbygoogle = window .adsbygoogle || []).push ({});
5
- });
2
+ import { navigating } from ' $app/stores' ;
3
+ $ : if ($navigating ) {
4
+ try {
5
+ // @ts-ignore
6
+ (adsbygoogle = window .adsbygoogle || []).push ({});
7
+ } catch (e ) {}
8
+ }
6
9
</script >
7
10
8
11
<ins
Original file line number Diff line number Diff line change
1
+ <script lang =" ts" >
2
+ let siteData = {
3
+ title: ' Svelte Turbo' ,
4
+ desc: " A Willin Wang's Work"
5
+ };
6
+ const {
7
+ formatTitle = true ,
8
+ title = ' ' ,
9
+ desc = siteData .desc
10
+ } = $props <{ formatTitle? : boolean ; title? : string ; desc? : string }>();
11
+ const formattedTitle = $derived (
12
+ formatTitle ? (title ? ` ${title } — ${siteData .title } ` : ` ${siteData .title } ` ) : title
13
+ );
14
+ </script >
15
+
16
+ <svelte:head >
17
+ <title >{formattedTitle }</title >
18
+ <meta name ="description" content ={desc } />
19
+ <meta name =" twitter:card" content =" summary_large_image" />
20
+ <meta name ="twitter:title" content ={formattedTitle } />
21
+ <meta name ="twitter:description" content ={desc } />
22
+ <meta property ="og:title" content ={formattedTitle } />
23
+ <meta property ="og:description" content ={desc } />
24
+ </svelte:head >
Original file line number Diff line number Diff line change 1
- <script >
1
+ <script lang = " ts " >
2
2
import { createTableOfContents } from ' @melt-ui/svelte' ;
3
3
import Toc from ' ./toc.svelte' ;
4
4
import AdSlot from ' ./AdSlot.svelte' ;
5
+ import SEO from ' ./SEO.svelte' ;
5
6
6
- const { title , desc } = $props ();
7
+ const { title, desc } = $props <{ title : string ; desc : string }> ();
7
8
8
9
const {
9
10
elements : { item },
14
15
});
15
16
</script >
16
17
18
+ {#if title }
19
+ <SEO {title } {desc } />
20
+ {/if }
21
+
17
22
<div
18
23
class =" hero min-h-screen bg-neutral"
19
24
style =" background-image: url(https://willin.wang/images/bg.jpg);" >
Original file line number Diff line number Diff line change 4
4
import { getPossibleLocales , locales } from ' @svelte-dev/i18n' ;
5
5
import { fallbackLng } from ' $lib/i8n' ;
6
6
import { page } from ' $app/stores' ;
7
+ import SEO from ' $components/SEO.svelte' ;
8
+ import { goto } from ' $app/navigation' ;
7
9
8
10
$effect (() => {
9
11
const isInit = !! localStorage .getItem (' lang' );
20
22
});
21
23
</script >
22
24
25
+ <SEO />
23
26
<div class =" hero min-h-screen" style =" background-image: url(https://willin.wang/images/bg.jpg);" >
24
27
<div class =" hero-overlay bg-opacity-60" ></div >
25
28
<div class =" hero-content text-center text-neutral-content" >
You can’t perform that action at this time.
0 commit comments