Skip to content

Instantly share code, notes, and snippets.

@ispyinternet
Created August 14, 2018 03:03
Show Gist options
  • Save ispyinternet/97778361c957a6c78a83d2fc69357170 to your computer and use it in GitHub Desktop.
Save ispyinternet/97778361c957a6c78a83d2fc69357170 to your computer and use it in GitHub Desktop.
sapper (working)
{
"page": {
"pattern": {},
"parts": [null, {
"name": "blog_$slug",
"component": {
"filename": "/home/richard/TestCognito/Project/Server/Cognito/routes/blog/[slug].html",
"css": {
"code": ".content.svelte-gnxal1 h2{font-size:1.4em;font-weight:500}.content.svelte-gnxal1 pre{background-color:#f9f9f9;box-shadow:inset 1px 1px 5px rgba(0,0,0,0.05);padding:0.5em;border-radius:2px;overflow-x:auto}.content.svelte-gnxal1 pre code{background-color:transparent;padding:0}.content.svelte-gnxal1 ul{line-height:1.5}.content.svelte-gnxal1 li{margin:0 0 0.5em 0}",
"map": "{\"version\":3,\"file\":\"[slug].html\",\"sources\":[\"[slug].html\"],\"sourcesContent\":[\"<svelte:head>\\n\\t<title>{post.title}</title>\\n</svelte:head>\\n\\n<h1>{post.title}</h1>\\n\\n<div class='content'>\\n\\t{@html post.html}\\n</div>\\n\\n<style>\\n\\t/*\\n\\t\\tBy default, CSS is locally scoped to the component,\\n\\t\\tand any unused styles are dead-code-eliminated.\\n\\t\\tIn this page, Svelte can't know which elements are\\n\\t\\tgoing to appear inside the {{{post.html}}} block,\\n\\t\\tso we have to use the :global(...) modifier to target\\n\\t\\tall elements inside .content\\n\\t*/\\n\\t.content :global(h2) {\\n\\t\\tfont-size: 1.4em;\\n\\t\\tfont-weight: 500;\\n\\t}\\n\\n\\t.content :global(pre) {\\n\\t\\tbackground-color: #f9f9f9;\\n\\t\\tbox-shadow: inset 1px 1px 5px rgba(0,0,0,0.05);\\n\\t\\tpadding: 0.5em;\\n\\t\\tborder-radius: 2px;\\n\\t\\toverflow-x: auto;\\n\\t}\\n\\n\\t.content :global(pre) :global(code) {\\n\\t\\tbackground-color: transparent;\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t.content :global(ul) {\\n\\t\\tline-height: 1.5;\\n\\t}\\n\\n\\t.content :global(li) {\\n\\t\\tmargin: 0 0 0.5em 0;\\n\\t}\\n</style>\\n\\n<script>\\n\\texport default {\\n\\t\\tasync preload({ params, query }) {\\n\\t\\t\\t// the `slug` parameter is available because\\n\\t\\t\\t// this file is called [slug].html\\n\\t\\t\\tconst res = await this.fetch(`blog/${params.slug}.json`);\\n\\t\\t\\tconst data = await res.json();\\n\\n\\t\\t\\tif (res.status === 200) {\\n\\t\\t\\t\\treturn { post: data };\\n\\t\\t\\t} else {\\n\\t\\t\\t\\tthis.error(res.status, data.message);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t};\\n</script>\"],\"names\":[],\"mappings\":\"AAmBC,sBAAQ,CAAC,AAAQ,EAAE,AAAE,CAAC,AACrB,SAAS,CAAE,KAAK,CAChB,WAAW,CAAE,GAAG,AACjB,CAAC,AAED,sBAAQ,CAAC,AAAQ,GAAG,AAAE,CAAC,AACtB,gBAAgB,CAAE,OAAO,CACzB,UAAU,CAAE,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAC9C,OAAO,CAAE,KAAK,CACd,aAAa,CAAE,GAAG,CAClB,UAAU,CAAE,IAAI,AACjB,CAAC,AAED,sBAAQ,CAAC,AAAQ,GAAG,AAAC,CAAC,AAAQ,IAAI,AAAE,CAAC,AACpC,gBAAgB,CAAE,WAAW,CAC7B,OAAO,CAAE,CAAC,AACX,CAAC,AAED,sBAAQ,CAAC,AAAQ,EAAE,AAAE,CAAC,AACrB,WAAW,CAAE,GAAG,AACjB,CAAC,AAED,sBAAQ,CAAC,AAAQ,EAAE,AAAE,CAAC,AACrB,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,AACpB,CAAC\"}"
}
}
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment