forked from sveltejs/community-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
sw-yx
committed
Oct 10, 2019
1 parent
7c9b694
commit ce70640
Showing
9 changed files
with
1,605 additions
and
3,267 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,9 @@ | |
"author": "sw-yx <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@ssgjs/source-yaml": "^0.0.3", | ||
"@sveltejs/site-kit": "^1.1.4", | ||
"fuse.js": "^3.4.5", | ||
"ssg": "^0.0.38", | ||
"yaml": "^1.7.1" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,106 @@ | ||
<script context="module"> | ||
export async function preload() { | ||
const res = await this.fetch(`data/resources___ssg___index.json`); | ||
const data = await res.json(); | ||
return { data }; | ||
} | ||
</script> | ||
|
||
<script> | ||
import { Hero, Blurb } from "@sveltejs/site-kit"; | ||
import Event from "components/Event.svelte"; | ||
import Box from "components/Box.svelte"; | ||
export let data; | ||
let resources = data.resources; | ||
let results = resources; | ||
// $: console.log({ data }); | ||
import Fuse from "fuse.js"; | ||
let searchterm = ""; | ||
$: { | ||
if (searchterm) { | ||
var options = { | ||
keys: ["name", "url", "tags", "description"] | ||
}; | ||
window.scrollTo({ | ||
top: 466, // top of Resources | ||
left: 0, | ||
behavior: "smooth" | ||
}); | ||
var fuse = new Fuse(resources, options); | ||
results = fuse.search(searchterm); | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.container { | ||
display: flex; | ||
align-items: start; | ||
max-width: 120rem; | ||
margin: 10rem auto; | ||
padding: 0 var(--side-nav); | ||
} | ||
.resourcetags { | ||
background-color: antiquewhite; | ||
} | ||
:global(.resourcetags + .resourcetags):before { | ||
content: ", "; | ||
} | ||
input { | ||
font-family: inherit; | ||
font-size: inherit; | ||
padding: 0.4em; | ||
margin: 0 0 0.5em 0; | ||
box-sizing: border-box; | ||
border: 1px solid #ccc; | ||
border-radius: 2px; | ||
} | ||
.search { | ||
position: sticky; | ||
top: 40px; | ||
} | ||
</style> | ||
|
||
<svelte:head> | ||
<title>Resources • Sapper Community</title> | ||
</svelte:head> | ||
|
||
<Hero | ||
title="Svelte Community" | ||
title="Community Resources" | ||
tagline="Resources" | ||
outline="sapper-logo-outline.svg" | ||
logotype="sapper-logotype.svg" /> | ||
|
||
<!-- <Blurb> | ||
</Blurb> --> | ||
outline="svelte-logo-outline.svg" | ||
logotype="community-logotype.svg" /> | ||
|
||
<div class="description"> | ||
<p>TODO: do Resources page</p> | ||
<div class="container"> | ||
<div class="text"> | ||
<h2>Resources</h2> | ||
<ul> | ||
{#each results as resource, i} | ||
<li> | ||
{#each resource.tags as tag} | ||
<code class="resourcetags">{tag}</code> | ||
{/each} | ||
<a href={resource.url} target="_blank">{resource.name}</a> | ||
{#if resource.description} | ||
<div>{resource.description}</div> | ||
{/if} | ||
</li> | ||
{/each} | ||
<!-- <li> | ||
➕ | ||
<a href="https://svelte-community.netlify.com/admin"> | ||
Add/Request your event here! | ||
</a> | ||
</li> --> | ||
</ul> | ||
</div> | ||
<div class="boxes search"> | ||
<Box color="#ededed"> | ||
<label> | ||
<h2>Search resources</h2> | ||
<input bind:value={searchterm} placeholder="search for your thing" /> | ||
</label> | ||
</Box> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
Arguments: | ||
/Users/swyx/.nvm/versions/node/v10.13.0/bin/node /usr/local/Cellar/yarn/1.17.0/libexec/bin/yarn.js add @ssgjs/plugin-yaml | ||
|
||
PATH: | ||
/Users/swyx/.wasmer/bin:/Users/swyx/.wasmer/globals/wapm_packages/.bin:/Users/swyx/.netlify/helper/bin:/Users/swyx/bin:/usr/local/bin:/Users/swyx/Library/Python/2.7/bin:/Users/swyx/ANT_HOME/bin:/Users/swyx/jython2.7.0/bin:/Users/swyx/.wasmer/bin:/Users/swyx/.wasmer/globals/wapm_packages/.bin:/Users/swyx/.netlify/helper/bin:/Users/swyx/.nvm/versions/node/v10.13.0/bin:/Users/swyx/bin:/usr/local/bin:/Users/swyx/Library/Python/2.7/bin:/Users/swyx/ANT_HOME/bin:/Users/swyx/jython2.7.0/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin | ||
|
||
Yarn version: | ||
1.17.0 | ||
|
||
Node version: | ||
10.13.0 | ||
|
||
Platform: | ||
darwin x64 | ||
|
||
Trace: | ||
Error: https://registry.yarnpkg.com/@ssgjs%2fplugin-yaml: Not found | ||
at Request.params.callback [as _callback] (/usr/local/Cellar/yarn/1.17.0/libexec/lib/cli.js:66823:18) | ||
at Request.self.callback (/usr/local/Cellar/yarn/1.17.0/libexec/lib/cli.js:140439:22) | ||
at Request.emit (events.js:182:13) | ||
at Request.<anonymous> (/usr/local/Cellar/yarn/1.17.0/libexec/lib/cli.js:141411:10) | ||
at Request.emit (events.js:182:13) | ||
at IncomingMessage.<anonymous> (/usr/local/Cellar/yarn/1.17.0/libexec/lib/cli.js:141333:12) | ||
at Object.onceWrapper (events.js:273:13) | ||
at IncomingMessage.emit (events.js:187:15) | ||
at endReadableNT (_stream_readable.js:1094:12) | ||
at process._tickCallback (internal/process/next_tick.js:63:19) | ||
|
||
npm manifest: | ||
{ | ||
"name": "community", | ||
"version": "1.0.0", | ||
"main": "index.js", | ||
"repository": "https://github.com/sveltejs/community.git", | ||
"author": "sw-yx <[email protected]>", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@sveltejs/site-kit": "^1.1.4", | ||
"ssg": "^0.0.38", | ||
"yaml": "^1.7.1" | ||
}, | ||
"scripts": { | ||
"start": "ssg dev", | ||
"build": "ssg export" | ||
} | ||
} | ||
|
||
yarn manifest: | ||
No manifest | ||
|
||
Lockfile: | ||
No lockfile |
Oops, something went wrong.