This commit is contained in:
2021-03-22 15:59:05 +01:00
parent dd27483b16
commit 2ee7f650db
46 changed files with 5636 additions and 0 deletions

32
src/components/App.svelte Normal file
View File

@@ -0,0 +1,32 @@
<h1>__PROJECT_TITLE__</h1>
<style lang="less">
h1 {
color: red;
}
</style>
<script lang="typescript">
import { scrollToTop } from "svelte-scrollto"
import { location } from "../store"
export let url = ""
if (url) {
// ssr
let l = url.split("?")
$location = {
path: l[0],
search: l.length > 1 ? l[1] : "",
categoryPath: l[0].replace(/\/\d{4,99}[^\/]+$/, ""),
push: false,
pop: false,
}
}
// scroll to top on new site
location.subscribe((l) => {
if (l.push) scrollToTop()
})
if (typeof window !== "undefined") console.log("App initialized")
</script>