The rest of the tutorial up to serving the site.

This commit is contained in:
Bradley Shellnut 2021-06-03 14:55:45 -07:00
parent 8a1d523d10
commit f96b54231a
28 changed files with 559 additions and 44 deletions

View file

@ -0,0 +1 @@
#svelte-announcer.svelte-1j55zn5{position:absolute;left:0;top:0;clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);overflow:hidden;white-space:nowrap;width:1px;height:1px}

View file

@ -0,0 +1 @@
import{S as t,i as a,s,e,t as o,c as r,a as l,g as i,d,b as f,f as h,D as c,E as n}from"./vendor-55eff8e9.js";function u(t){let a,s,u;return{c(){a=e("h1"),s=e("a"),u=o(b),this.h()},l(t){a=r(t,"H1",{id:!0});var e=l(a);s=r(e,"A",{href:!0});var o=l(s);u=i(o,b),o.forEach(d),e.forEach(d),this.h()},h(){f(s,"href","#title"),f(a,"id","title")},m(t,e){h(t,a,e),c(a,s),c(s,u)},p:n,i:n,o:n,d(t){t&&d(a)}}}const g={title:"Goodbye",slug:"goodbye"},{title:b,slug:m}=g;var p=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:class extends t{constructor(t){super(),a(this,t,null,u,s,{})}},metadata:g});export{p as _};

View file

@ -0,0 +1 @@
import{S as a,i as l,s as r,e as s,t as e,k as o,c as t,a as i,g as h,d as f,n as c,b as u,f as d,D as n,E as m}from"./vendor-55eff8e9.js";function p(a){let l,r,p,v,g,_,H,b,L,S,W,j,x;return{c(){l=s("h1"),r=s("a"),p=e(E),v=o(),g=s("p"),_=e("lorem ipsum"),H=o(),b=s("ul"),L=s("li"),S=e("Hello"),W=o(),j=s("li"),x=e("World"),this.h()},l(a){l=t(a,"H1",{id:!0});var s=i(l);r=t(s,"A",{href:!0});var e=i(r);p=h(e,E),e.forEach(f),s.forEach(f),v=c(a),g=t(a,"P",{});var o=i(g);_=h(o,"lorem ipsum"),o.forEach(f),H=c(a),b=t(a,"UL",{});var u=i(b);L=t(u,"LI",{});var d=i(L);S=h(d,"Hello"),d.forEach(f),W=c(u),j=t(u,"LI",{});var n=i(j);x=h(n,"World"),n.forEach(f),u.forEach(f),this.h()},h(){u(r,"href","#title"),u(l,"id","title")},m(a,s){d(a,l,s),n(l,r),n(r,p),d(a,v,s),d(a,g,s),n(g,_),d(a,H,s),d(a,b,s),n(b,L),n(L,S),n(b,W),n(b,j),n(j,x)},p:m,i:m,o:m,d(a){a&&f(l),a&&f(v),a&&f(g),a&&f(H),a&&f(b)}}}const v={title:"Hello World",slug:"hello"},{title:E,slug:g}=v;var _=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:class extends a{constructor(a){super(),l(this,a,null,p,r,{})}},metadata:v});export{_};

View file

@ -0,0 +1 @@
let e;const r={},t=function(t,n){if(!n)return t();if(void 0===e){const r=document.createElement("link").relList;e=r&&r.supports&&r.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(n.map((t=>{if(t in r)return;r[t]=!0;const n=t.endsWith(".css"),o=n?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${o}`))return;const s=document.createElement("link");return s.rel=n?"stylesheet":e,n||(s.as="script",s.crossOrigin=""),s.href=t,document.head.appendChild(s),n?new Promise(((e,r)=>{s.addEventListener("load",e),s.addEventListener("error",r)})):void 0}))).then((()=>t()))};export{t as _};

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
import{S as s,i as r,s as a,e as t,t as e,k as o,c as n,a as u,g as c,d as f,n as E,f as h,D as i,h as p,E as H}from"../chunks/vendor-55eff8e9.js";function d(s){let r,a,d,l,m,v,N,P,g=s[1].message+"";return{c(){r=t("h1"),a=e("SOMETHING HAPPENED!"),d=o(),l=t("h3"),m=e(s[0]),v=o(),N=t("h3"),P=e(g)},l(t){r=n(t,"H1",{});var e=u(r);a=c(e,"SOMETHING HAPPENED!"),e.forEach(f),d=E(t),l=n(t,"H3",{});var o=u(l);m=c(o,s[0]),o.forEach(f),v=E(t),N=n(t,"H3",{});var h=u(N);P=c(h,g),h.forEach(f)},m(s,t){h(s,r,t),i(r,a),h(s,d,t),h(s,l,t),i(l,m),h(s,v,t),h(s,N,t),i(N,P)},p(s,[r]){1&r&&p(m,s[0]),2&r&&g!==(g=s[1].message+"")&&p(P,g)},i:H,o:H,d(s){s&&f(r),s&&f(d),s&&f(l),s&&f(v),s&&f(N)}}}function l({error:s,status:r}){return{props:{error:s,status:r}}}function m(s,r,a){let{status:t}=r,{error:e}=r;return s.$$set=s=>{"status"in s&&a(0,t=s.status),"error"in s&&a(1,e=s.error)},[t,e]}export default class extends s{constructor(s){super(),r(this,s,m,d,a,{status:0,error:1})}}export{l as load};

View file

@ -0,0 +1 @@
import{S as s,i as a,s as r,e,t,k as o,c as n,a as c,g as h,d as l,n as f,b as u,f as $,D as i,E as m,F as p,j as E,m as d,o as v,G as g,v as A,r as b,w as H}from"../chunks/vendor-55eff8e9.js";function x(s){let a,r,p,E,d,v,g,A,b,H;return{c(){a=e("header"),r=e("h1"),p=t("Welcome"),E=o(),d=e("nav"),v=e("a"),g=t("Home"),A=o(),b=e("a"),H=t("About Us"),this.h()},l(s){a=n(s,"HEADER",{});var e=c(a);r=n(e,"H1",{});var t=c(r);p=h(t,"Welcome"),t.forEach(l),E=f(e),d=n(e,"NAV",{});var o=c(d);v=n(o,"A",{href:!0});var u=c(v);g=h(u,"Home"),u.forEach(l),A=f(o),b=n(o,"A",{href:!0});var $=c(b);H=h($,"About Us"),$.forEach(l),o.forEach(l),e.forEach(l),this.h()},h(){u(v,"href","/"),u(b,"href","/about")},m(s,e){$(s,a,e),i(a,r),i(r,p),i(a,E),i(a,d),i(d,v),i(v,g),i(d,A),i(d,b),i(b,H)},p:m,i:m,o:m,d(s){s&&l(a)}}}class j extends s{constructor(s){super(),a(this,s,null,x,r,{})}}function k(s){let a,r,m,x,k,w,y;a=new j({});const C=s[1].default,D=p(C,s,s[0],null);return{c(){E(a.$$.fragment),r=o(),m=e("main"),D&&D.c(),x=o(),k=e("footer"),w=t("Copyright 2021"),this.h()},l(s){d(a.$$.fragment,s),r=f(s),m=n(s,"MAIN",{class:!0});var e=c(m);D&&D.l(e),e.forEach(l),x=f(s),k=n(s,"FOOTER",{});var t=c(k);w=h(t,"Copyright 2021"),t.forEach(l),this.h()},h(){u(m,"class","bg-blue-400")},m(s,e){v(a,s,e),$(s,r,e),$(s,m,e),D&&D.m(m,null),$(s,x,e),$(s,k,e),i(k,w),y=!0},p(s,[a]){D&&D.p&&(!y||1&a)&&g(D,C,s,s[0],a,null,null)},i(s){y||(A(a.$$.fragment,s),A(D,s),y=!0)},o(s){b(a.$$.fragment,s),b(D,s),y=!1},d(s){H(a,s),s&&l(r),s&&l(m),D&&D.d(s),s&&l(x),s&&l(k)}}}function w(s,a,r){let{$$slots:e={},$$scope:t}=a;return s.$$set=s=>{"$$scope"in s&&r(0,t=s.$$scope)},[t,e]}export default class extends s{constructor(s){super(),a(this,s,w,k,r,{})}}

View file

@ -0,0 +1 @@
import{S as e,i as a,s as i,e as s,t,k as u,c as n,a as o,g as l,d as m,n as r,f as c,D as d,E as p}from"../chunks/vendor-55eff8e9.js";function f(e){let a,i,f,v,b;return{c(){a=s("h1"),i=t("About Us"),f=u(),v=s("p"),b=t("Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti in natus, at laboriosam\n laudantium amet eum aliquid repellat minima exercitationem officiis quibusdam voluptates eaque\n assumenda vero consectetur repellendus, illum cum.")},l(e){a=n(e,"H1",{});var s=o(a);i=l(s,"About Us"),s.forEach(m),f=r(e),v=n(e,"P",{});var t=o(v);b=l(t,"Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti in natus, at laboriosam\n laudantium amet eum aliquid repellat minima exercitationem officiis quibusdam voluptates eaque\n assumenda vero consectetur repellendus, illum cum."),t.forEach(m)},m(e,s){c(e,a,s),d(a,i),c(e,f,s),c(e,v,s),d(v,b)},p:p,i:p,o:p,d(e){e&&m(a),e&&m(f),e&&m(v)}}}export default class extends e{constructor(e){super(),a(this,e,null,f,i,{})}}

View file

@ -0,0 +1 @@
import{S as e,i as a,s as t,e as s,t as o,k as r,c as h,a as i,g as l,d as c,n,b as v,f as d,D as f,E as u}from"../chunks/vendor-55eff8e9.js";function p(e){let a,t,p,m,k,E,H,x,y,L,U;return{c(){a=s("h1"),t=o("Welcome to Level Up"),p=r(),m=s("h2"),k=o("Hi y'all"),E=r(),H=s("p"),x=o("Visit "),y=s("a"),L=o("kit.svelte.dev"),U=o(" to read the documentation"),this.h()},l(e){a=h(e,"H1",{});var s=i(a);t=l(s,"Welcome to Level Up"),s.forEach(c),p=n(e),m=h(e,"H2",{});var o=i(m);k=l(o,"Hi y'all"),o.forEach(c),E=n(e),H=h(e,"P",{});var r=i(H);x=l(r,"Visit "),y=h(r,"A",{href:!0});var v=i(y);L=l(v,"kit.svelte.dev"),v.forEach(c),U=l(r," to read the documentation"),r.forEach(c),this.h()},h(){v(y,"href","https://kit.svelte.dev")},m(e,s){d(e,a,s),f(a,t),d(e,p,s),d(e,m,s),f(m,k),d(e,E,s),d(e,H,s),f(H,x),f(H,y),f(y,L),f(H,U)},p:u,i:u,o:u,d(e){e&&c(a),e&&c(p),e&&c(m),e&&c(E),e&&c(H)}}}export default class extends e{constructor(e){super(),a(this,e,null,p,t,{})}}

View file

@ -0,0 +1 @@
import{_ as t}from"../../chunks/preload-helper-9f12a5fd.js";import{S as r,i as s,s as e,j as n,m as o,o as a,E as u,v as c,r as f,w as i}from"../../chunks/vendor-55eff8e9.js";function m(t){let r,s;return r=new t[0]({}),{c(){n(r.$$.fragment)},l(t){o(r.$$.fragment,t)},m(t,e){a(r,t,e),s=!0},p:u,i(t){s||(c(r.$$.fragment,t),s=!0)},o(t){f(r.$$.fragment,t),s=!1},d(t){i(r,t)}}}async function p({page:r}){try{return{props:{Post:(await function(r){switch(r){case"../../posts/goodbye.md":return t((()=>import("../../chunks/goodbye-62de47d1.js").then((function(t){return t._}))),["/_app/chunks/goodbye-62de47d1.js","/_app/chunks/vendor-55eff8e9.js"]);case"../../posts/hello.md":return t((()=>import("../../chunks/hello-750c14bf.js").then((function(t){return t._}))),["/_app/chunks/hello-750c14bf.js","/_app/chunks/vendor-55eff8e9.js"]);default:return Promise.reject(new Error("Unknown variable dynamic import: "+r))}}(`../../posts/${r.params.slug}.md`)).default}}}catch(s){return{status:404,error:"Post not found"}}}function d(t,r,s){let{Post:e}=r;return t.$$set=t=>{"Post"in t&&s(0,e=t.Post)},[e]}export default class extends r{constructor(t){super(),s(this,t,d,m,e,{Post:0})}}export{p as load};

View file

@ -0,0 +1 @@
import{_ as s}from"../../chunks/goodbye-62de47d1.js";import{_ as t}from"../../chunks/hello-750c14bf.js";import{S as e,i as o,s as l,F as r,e as a,t as h,c as n,a as c,g as f,d as p,b as i,f as u,D as v,h as d,k as m,n as g,G as $,v as E,r as k,H as b}from"../../chunks/vendor-55eff8e9.js";function A(s,t,e){const o=s.slice();return o[3]=t[e],o}function I(s){let t,e,o,l,r=s[3].title+"";return{c(){t=a("li"),e=a("a"),o=h(r),this.h()},l(s){t=n(s,"LI",{});var l=c(t);e=n(l,"A",{"sveltekit:prefetch":!0,href:!0});var a=c(e);o=f(a,r),a.forEach(p),l.forEach(p),this.h()},h(){i(e,"sveltekit:prefetch",""),i(e,"href",l=`/posts/${s[3].slug}`)},m(s,l){u(s,t,l),v(t,e),v(e,o)},p(s,t){1&t&&r!==(r=s[3].title+"")&&d(o,r),1&t&&l!==(l=`/posts/${s[3].slug}`)&&i(e,"href",l)},d(s){s&&p(t)}}}function j(s){let t,e,o,l,d,j,x,L,y,D,U,H;const S=s[2].default,_=r(S,s,s[1],null);let F=s[0],G=[];for(let r=0;r<F.length;r+=1)G[r]=I(A(s,F,r));return{c(){t=a("div"),_&&_.c(),e=m(),o=a("aside"),l=a("h5"),d=h("Archive"),j=m(),x=a("ui");for(let s=0;s<G.length;s+=1)G[s].c();L=m(),y=a("li"),D=a("a"),U=h("Level Up"),this.h()},l(s){t=n(s,"DIV",{});var r=c(t);_&&_.l(r),e=g(r),o=n(r,"ASIDE",{});var a=c(o);l=n(a,"H5",{});var h=c(l);d=f(h,"Archive"),h.forEach(p),j=g(a),x=n(a,"UI",{});var i=c(x);for(let t=0;t<G.length;t+=1)G[t].l(i);L=g(i),y=n(i,"LI",{});var u=c(y);D=n(u,"A",{rel:!0,href:!0});var v=c(D);U=f(v,"Level Up"),v.forEach(p),u.forEach(p),i.forEach(p),a.forEach(p),r.forEach(p),this.h()},h(){i(D,"rel","external"),i(D,"href","https://leveluptutorials.com")},m(s,r){u(s,t,r),_&&_.m(t,null),v(t,e),v(t,o),v(o,l),v(l,d),v(o,j),v(o,x);for(let t=0;t<G.length;t+=1)G[t].m(x,null);v(x,L),v(x,y),v(y,D),v(D,U),H=!0},p(s,[t]){if(_&&_.p&&(!H||2&t)&&$(_,S,s,s[1],t,null,null),1&t){let e;for(F=s[0],e=0;e<F.length;e+=1){const o=A(s,F,e);G[e]?G[e].p(o,t):(G[e]=I(o),G[e].c(),G[e].m(x,L))}for(;e<G.length;e+=1)G[e].d(1);G.length=F.length}},i(s){H||(E(_,s),H=!0)},o(s){k(_,s),H=!1},d(s){s&&p(t),_&&_.d(s),b(G,s)}}}async function x(){const e={"../../posts/goodbye.md":s,"../../posts/hello.md":t},o=Object.values(e).map((s=>s.metadata));return console.log("postsMeta",o),{props:{posts:o}}}function L(s,t,e){let{$$slots:o={},$$scope:l}=t,{posts:r}=t;return s.$$set=s=>{"posts"in s&&e(0,r=s.posts),"$$scope"in s&&e(1,l=s.$$scope)},[r,l,o]}export default class extends e{constructor(s){super(),o(this,s,L,j,l,{posts:0})}}export{x as load};

View file

@ -0,0 +1 @@
import{S as s,i as a,s as t,e as o,t as e,c as r,a as u,g as c,d as l,f as n,D as f,E as i}from"../../chunks/vendor-55eff8e9.js";function h(s){let a,t;return{c(){a=o("h3"),t=e("About this blog")},l(s){a=r(s,"H3",{});var o=u(a);t=c(o,"About this blog"),o.forEach(l)},m(s,o){n(s,a,o),f(a,t)},p:i,i:i,o:i,d(s){s&&l(a)}}}export default class extends s{constructor(s){super(),a(this,s,null,h,t,{})}}

View file

@ -0,0 +1 @@
import{S as s,i as a,s as r,e as t,t as o,k as e,c,a as f,g as n,d as h,n as l,f as u,D as i,E as d}from"../../chunks/vendor-55eff8e9.js";function E(s){let a,r,E,p,v,P;return{c(){a=t("h1"),r=o("Posts"),E=e(),p=t("article"),v=t("h3"),P=o("New Post")},l(s){a=c(s,"H1",{});var t=f(a);r=n(t,"Posts"),t.forEach(h),E=l(s),p=c(s,"ARTICLE",{});var o=f(p);v=c(o,"H3",{});var e=f(v);P=n(e,"New Post"),e.forEach(h),o.forEach(h)},m(s,t){u(s,a,t),i(a,r),u(s,E,t),u(s,p,t),i(p,v),i(v,P)},p:d,i:d,o:d,d(s){s&&h(a),s&&h(E),s&&h(p)}}}export default class extends s{constructor(s){super(),a(this,s,null,E,r,{})}}

File diff suppressed because one or more lines are too long

73
build/about/index.html Normal file
View file

@ -0,0 +1,73 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/about.svelte-38b2fb12.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/about.svelte-38b2fb12.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/about",
query: new URLSearchParams(""),
params: {}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><h1>About Us</h1>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Deleniti in natus, at laboriosam
laudantium amet eum aliquid repellat minima exercitationem officiis quibusdam voluptates eaque
assumenda vero consectetur repellendus, illum cum.
</p></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

BIN
build/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

71
build/index.html Normal file
View file

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/index.svelte-1cf09077.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/index.svelte-1cf09077.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/",
query: new URLSearchParams(""),
params: {}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><h1>Welcome to Level Up</h1>
<h2>Hi y&#39;all</h2>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/posts/__layout.svelte-9b5e845d.js">
<link rel="modulepreload" href="/./_app/chunks/goodbye-62de47d1.js">
<link rel="modulepreload" href="/./_app/chunks/hello-750c14bf.js">
<link rel="modulepreload" href="/./_app/pages/posts/about.svelte-80837ddb.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/posts/__layout.svelte-9b5e845d.js"),
import("/./_app/pages/posts/about.svelte-80837ddb.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/posts/about",
query: new URLSearchParams(""),
params: {}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><div><h3>About this blog</h3>
<aside><h5>Archive</h5>
<ui><li><a sveltekit:prefetch href="/posts/goodbye">Goodbye</a></li><li><a sveltekit:prefetch href="/posts/hello">Hello World</a></li>
<li><a rel="external" href="https://leveluptutorials.com">Level Up</a></li></ui></aside></div></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/posts/__layout.svelte-9b5e845d.js">
<link rel="modulepreload" href="/./_app/chunks/goodbye-62de47d1.js">
<link rel="modulepreload" href="/./_app/chunks/hello-750c14bf.js">
<link rel="modulepreload" href="/./_app/pages/posts/[slug].svelte-bf81e842.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/posts/__layout.svelte-9b5e845d.js"),
import("/./_app/pages/posts/[slug].svelte-bf81e842.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/posts/goodbye",
query: new URLSearchParams(""),
params: {"slug":"goodbye"}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><div><h1 id="title"><a href="#title">Goodbye</a></h1>
<aside><h5>Archive</h5>
<ui><li><a sveltekit:prefetch href="/posts/goodbye">Goodbye</a></li><li><a sveltekit:prefetch href="/posts/hello">Hello World</a></li>
<li><a rel="external" href="https://leveluptutorials.com">Level Up</a></li></ui></aside></div></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

View file

@ -0,0 +1,79 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/posts/__layout.svelte-9b5e845d.js">
<link rel="modulepreload" href="/./_app/chunks/goodbye-62de47d1.js">
<link rel="modulepreload" href="/./_app/chunks/hello-750c14bf.js">
<link rel="modulepreload" href="/./_app/pages/posts/[slug].svelte-bf81e842.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/posts/__layout.svelte-9b5e845d.js"),
import("/./_app/pages/posts/[slug].svelte-bf81e842.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/posts/hello",
query: new URLSearchParams(""),
params: {"slug":"hello"}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><div><h1 id="title"><a href="#title">Hello World</a></h1>
<p>lorem ipsum</p>
<ul><li>Hello</li>
<li>World</li></ul>
<aside><h5>Archive</h5>
<ui><li><a sveltekit:prefetch href="/posts/goodbye">Goodbye</a></li><li><a sveltekit:prefetch href="/posts/hello">Hello World</a></li>
<li><a rel="external" href="https://leveluptutorials.com">Level Up</a></li></ui></aside></div></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

77
build/posts/index.html Normal file
View file

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="/./_app/start-042b987c.js">
<link rel="modulepreload" href="/./_app/chunks/vendor-55eff8e9.js">
<link rel="modulepreload" href="/./_app/chunks/preload-helper-9f12a5fd.js">
<link rel="modulepreload" href="/./_app/pages/__layout.svelte-d83a74e6.js">
<link rel="modulepreload" href="/./_app/pages/posts/__layout.svelte-9b5e845d.js">
<link rel="modulepreload" href="/./_app/chunks/goodbye-62de47d1.js">
<link rel="modulepreload" href="/./_app/chunks/hello-750c14bf.js">
<link rel="modulepreload" href="/./_app/pages/posts/index.svelte-2b52bcc1.js">
<link rel="stylesheet" href="/./_app/assets/start-8077b9bf.css">
<link rel="stylesheet" href="/./_app/assets/pages/__layout.svelte-b325a427.css">
<script type="module">
import { start } from "/./_app/start-042b987c.js";
start({
target: document.querySelector("#svelte"),
paths: {"base":"","assets":"/."},
session: {},
host: location.host,
route: true,
spa: false,
trailing_slash: "never",
hydrate: {
status: 200,
error: null,
nodes: [
import("/./_app/pages/__layout.svelte-d83a74e6.js"),
import("/./_app/pages/posts/__layout.svelte-9b5e845d.js"),
import("/./_app/pages/posts/index.svelte-2b52bcc1.js")
],
page: {
host: location.host, // TODO this is redundant
path: "/posts",
query: new URLSearchParams(""),
params: {}
}
}
});
</script>
</head>
<body>
<div id="svelte">
<header><h1>Welcome</h1>
<nav><a href="/">Home</a>
<a href="/about">About Us</a></nav></header>
<main class="bg-blue-400"><div><h1>Posts</h1>
<article><h3>New Post</h3></article>
<aside><h5>Archive</h5>
<ui><li><a sveltekit:prefetch href="/posts/goodbye">Goodbye</a></li><li><a sveltekit:prefetch href="/posts/hello">Hello World</a></li>
<li><a rel="external" href="https://leveluptutorials.com">Level Up</a></li></ui></aside></div></main>
<footer>Copyright 2021</footer>
</div>
</body>
</html>

55
package-lock.json generated
View file

@ -12,20 +12,21 @@
"svelte-preprocess": "^4.7.3" "svelte-preprocess": "^4.7.3"
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-static": "^1.0.0-next.13",
"@sveltejs/kit": "next", "@sveltejs/kit": "next",
"autoprefixer": "^10.2.6", "autoprefixer": "^10.2.6",
"eslint": "^7.22.0", "eslint": "^7.27.0",
"eslint-config-prettier": "^8.1.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.2.0", "eslint-plugin-svelte3": "^3.2.0",
"mdsvex": "^0.9.0", "mdsvex": "^0.9.6",
"prettier": "~2.2.1", "prettier": "~2.3.0",
"prettier-plugin-svelte": "^2.2.0", "prettier-plugin-svelte": "^2.3.0",
"rehype-autolink-headings": "^5.0.1", "rehype-autolink-headings": "^5.1.0",
"rehype-slug": "^4.0.1", "rehype-slug": "^4.0.1",
"remark-abbr": "^1.4.1", "remark-abbr": "^1.4.1",
"remark-github": "^10.0.1", "remark-github": "^10.1.0",
"svelte": "^3.34.0", "svelte": "^3.38.2",
"tailwindcss": "^2.1.3" "tailwindcss": "^2.1.4"
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
@ -229,6 +230,12 @@
"rollup": "^1.20.0||^2.0.0" "rollup": "^1.20.0||^2.0.0"
} }
}, },
"node_modules/@sveltejs/adapter-static": {
"version": "1.0.0-next.13",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-1.0.0-next.13.tgz",
"integrity": "sha512-zaXJlWK9JfrjrE6nG5etB8kf4DSkbE3H8Ql6gmCk3WjdvpY85a60TMYBU9OK2iunkqpHnPYiMUGEnOGYmWlLYA==",
"dev": true
},
"node_modules/@sveltejs/kit": { "node_modules/@sveltejs/kit": {
"version": "1.0.0-next.111", "version": "1.0.0-next.111",
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.111.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.111.tgz",
@ -3095,9 +3102,9 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.2.1", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz",
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==",
"dev": true, "dev": true,
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin-prettier.js"
@ -3971,9 +3978,9 @@
"dev": true "dev": true
}, },
"node_modules/tailwindcss": { "node_modules/tailwindcss": {
"version": "2.1.3", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.3.tgz", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.4.tgz",
"integrity": "sha512-434rlH/gVSm0Qhc2pQjvsQeasrcmPWEWSxyDcF66Y+CavOURsdqx3hymqqXlozs+CVWN3z+VpFV/PE9b2wx/GA==", "integrity": "sha512-fh1KImDLg6se/Suaelju/5oFbqq1b0ntagmGLu0aG9LlnNPGHgO1n/4E57CbKcCtyz/VYnvVXUiWmfyfBBZQ6g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@fullhuman/postcss-purgecss": "^3.1.3", "@fullhuman/postcss-purgecss": "^3.1.3",
@ -4718,6 +4725,12 @@
"picomatch": "^2.2.2" "picomatch": "^2.2.2"
} }
}, },
"@sveltejs/adapter-static": {
"version": "1.0.0-next.13",
"resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-1.0.0-next.13.tgz",
"integrity": "sha512-zaXJlWK9JfrjrE6nG5etB8kf4DSkbE3H8Ql6gmCk3WjdvpY85a60TMYBU9OK2iunkqpHnPYiMUGEnOGYmWlLYA==",
"dev": true
},
"@sveltejs/kit": { "@sveltejs/kit": {
"version": "1.0.0-next.111", "version": "1.0.0-next.111",
"resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.111.tgz", "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-1.0.0-next.111.tgz",
@ -6909,9 +6922,9 @@
"dev": true "dev": true
}, },
"prettier": { "prettier": {
"version": "2.2.1", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.3.0.tgz",
"integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", "integrity": "sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==",
"dev": true "dev": true
}, },
"prettier-plugin-svelte": { "prettier-plugin-svelte": {
@ -7534,9 +7547,9 @@
} }
}, },
"tailwindcss": { "tailwindcss": {
"version": "2.1.3", "version": "2.1.4",
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.3.tgz", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-2.1.4.tgz",
"integrity": "sha512-434rlH/gVSm0Qhc2pQjvsQeasrcmPWEWSxyDcF66Y+CavOURsdqx3hymqqXlozs+CVWN3z+VpFV/PE9b2wx/GA==", "integrity": "sha512-fh1KImDLg6se/Suaelju/5oFbqq1b0ntagmGLu0aG9LlnNPGHgO1n/4E57CbKcCtyz/VYnvVXUiWmfyfBBZQ6g==",
"dev": true, "dev": true,
"requires": { "requires": {
"@fullhuman/postcss-purgecss": "^3.1.3", "@fullhuman/postcss-purgecss": "^3.1.3",

View file

@ -9,20 +9,21 @@
"format": "prettier --write --plugin-search-dir=. ." "format": "prettier --write --plugin-search-dir=. ."
}, },
"devDependencies": { "devDependencies": {
"@sveltejs/adapter-static": "^1.0.0-next.13",
"@sveltejs/kit": "next", "@sveltejs/kit": "next",
"autoprefixer": "^10.2.6", "autoprefixer": "^10.2.6",
"eslint": "^7.22.0", "eslint": "^7.27.0",
"eslint-config-prettier": "^8.1.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^3.2.0", "eslint-plugin-svelte3": "^3.2.0",
"mdsvex": "^0.9.0", "mdsvex": "^0.9.6",
"prettier": "~2.2.1", "prettier": "~2.3.0",
"prettier-plugin-svelte": "^2.2.0", "prettier-plugin-svelte": "^2.3.0",
"rehype-autolink-headings": "^5.0.1", "rehype-autolink-headings": "^5.1.0",
"rehype-slug": "^4.0.1", "rehype-slug": "^4.0.1",
"remark-abbr": "^1.4.1", "remark-abbr": "^1.4.1",
"remark-github": "^10.0.1", "remark-github": "^10.1.0",
"svelte": "^3.34.0", "svelte": "^3.38.2",
"tailwindcss": "^2.1.3" "tailwindcss": "^2.1.4"
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {

20
src/routes/__error.svelte Normal file
View file

@ -0,0 +1,20 @@
<script context="module">
export function load({ error, status }) {
return {
props: {
error,
status
}
};
}
</script>
<script>
export let status;
export let error;
</script>
<h1>SOMETHING HAPPENED!</h1>
<h3>{status}</h3>
<h3>{error.message}</h3>

View file

@ -1,20 +1,32 @@
<script context="module"> <script context="module">
export async function load({ page }) { export async function load({ page }) {
const Hello = await import(`../../posts/${page.params.slug}.md`); try {
const Post = await import(`../../posts/${page.params.slug}.md`);
return { return {
// Data passed into svelte component
props: { props: {
Hello: Hello.default, Post: Post.default
title: Hello.metadata.title
} }
}; };
} catch (e) {
// return {
// status: 307,
// redirect: '/posts'
// };
// For status to work we need the correct outputs
// 404 needs and error message
// Redirect need status and redirect
return {
status: 404,
error: 'Post not found'
};
}
} }
</script> </script>
<script> <script>
export let Hello; export let Post;
export let title;
</script> </script>
<h2>{title}</h2> <Post />
<Hello />

View file

@ -24,8 +24,9 @@
<h5>Archive</h5> <h5>Archive</h5>
<ui> <ui>
{#each posts as post} {#each posts as post}
<li><a href={post.slug}>{post.title}</a></li> <li><a sveltekit:prefetch href={`/posts/${post.slug}`}>{post.title}</a></li>
{/each} {/each}
<li><a rel="external" href="https://leveluptutorials.com">Level Up</a></li>
</ui> </ui>
</aside> </aside>
</div> </div>

View file

@ -2,6 +2,7 @@ import { mdsvex } from "mdsvex";
import { mdsvexConfig } from "./mdsvex.config.js"; import { mdsvexConfig } from "./mdsvex.config.js";
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
import sveltePreprocess from 'svelte-preprocess'; import sveltePreprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-static';
const config = { const config = {
extensions: [".svelte", ...mdsvexConfig.extensions], extensions: [".svelte", ...mdsvexConfig.extensions],
@ -11,7 +12,8 @@ const config = {
], ],
kit: { kit: {
// hydrate the <div id="svelte"> element in src/app.html // hydrate the <div id="svelte"> element in src/app.html
target: '#svelte' target: '#svelte',
adapter: adapter(),
}, },
}; };