Skip to content

Commit 2f34236

Browse files
committed
Remove nightly references, link to Discord & add widget
1 parent f53e83b commit 2f34236

File tree

5 files changed

+114
-24
lines changed

5 files changed

+114
-24
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<template>
2+
<div v-if="members.length > 0" class="community">
3+
<div class="list">
4+
<a v-for="member in members" href="https://discord.gg/U63XU2J" :title="member.username" :class="member.status" target="_blank" rel="noopener">
5+
<img :src="member.avatar_url + '?size=64'" :alt="member.username" loading="lazy" />
6+
</a>
7+
</div>
8+
</div>
9+
</template>
10+
11+
<script>
12+
const widgetUrl = 'https://discordapp.com/api/guilds/721472913886281818/widget.json'
13+
14+
export default {
15+
name: 'Community',
16+
17+
data() {
18+
return {
19+
members: this.members || []
20+
}
21+
},
22+
23+
mounted() {
24+
fetch('https://green-sun-f03e.encors.workers.dev/?url=' + encodeURIComponent(widgetUrl), { mode: 'cors', credentials: 'omit' })
25+
.then(res => res.json())
26+
.then(({ members }) => {
27+
this.members = members.filter(member =>
28+
typeof member.username === 'string' &&
29+
typeof member.avatar_url === 'string' &&
30+
member.avatar_url.startsWith('https://cdn.discordapp.com/') &&
31+
['online', 'idle'].includes(member.status))
32+
})
33+
.catch(err => {
34+
// don't show the widget
35+
})
36+
}
37+
}
38+
</script>
39+
40+
<style scoped>
41+
.community .list {
42+
text-align: center;
43+
}
44+
.community .list a {
45+
display: inline-block;
46+
box-sizing: border-box;
47+
position: relative;
48+
top: 0;
49+
transition: top 100ms;
50+
}
51+
.community .list a:hover {
52+
top: -4px;
53+
}
54+
.community .list a:before {
55+
content: '';
56+
position: absolute;
57+
border-radius: 50%;
58+
background: #999;
59+
bottom: 2px;
60+
right: 2px;
61+
width: 10px;
62+
height: 10px;
63+
border: 2px solid #fff;
64+
}
65+
.community .list a.online:before {
66+
background: #49b684;
67+
}
68+
.community .list a.idle:before {
69+
background: #f8a735;
70+
}
71+
.community .list img {
72+
width: 32px;
73+
height: 32px;
74+
overflow: hidden;
75+
border-radius: 50%;
76+
border: 1px solid #fff;
77+
box-shadow: 0 0 0 1px #007acc;
78+
}
79+
.community .list a {
80+
padding: 0.15rem;
81+
}
82+
</style>

src/.vuepress/nav.js

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,6 @@ module.exports = [
7272
{
7373
text: 'Community',
7474
items: [
75-
{
76-
text: 'Working Group',
77-
link: 'https://github.com/AssemblyScript/working-group'
78-
},
79-
{
80-
text: 'Community Group',
81-
link: 'https://github.com/AssemblyScript/community-group'
82-
},
83-
{
84-
text: 'Slack (with invite)',
85-
link: 'https://assemblyscript.slack.com/'
86-
},
8775
{
8876
text: 'Contributing guidelines',
8977
link: 'https://github.com/AssemblyScript/assemblyscript/blob/master/CONTRIBUTING.md'
@@ -92,25 +80,38 @@ module.exports = [
9280
text: 'Code of Conduct',
9381
link: 'https://github.com/AssemblyScript/assemblyscript/blob/master/CODE_OF_CONDUCT.md'
9482
},
83+
{
84+
text: 'Groups',
85+
items: [
86+
{
87+
text: 'Community Group',
88+
link: 'https://github.com/AssemblyScript/community-group'
89+
},
90+
{
91+
text: 'Working Group',
92+
link: 'https://github.com/AssemblyScript/working-group'
93+
}
94+
]
95+
},
9596
{
9697
text: 'Social',
9798
items: [
9899
{
99100
text: 'Twitter',
100101
link: 'https://twitter.com/AssemblyScript'
102+
},
103+
{
104+
text: 'Discord',
105+
link: 'https://discord.gg/U63XU2J'
101106
}
102107
]
103108
},
104109
{
105-
text: 'General',
110+
text: 'Q&A',
106111
items: [
107112
{
108113
text: 'Stack Overflow',
109114
link: 'https://stackoverflow.com/questions/tagged/assemblyscript'
110-
},
111-
{
112-
text: 'WebAssembly Discord',
113-
link: 'https://discordapp.com/invite/nEFErF8'
114115
}
115116
]
116117
}

src/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ loader.instantiate(module_wasm, { /* imports */ })
9393
<a href="./quick-start.html">Install locally! ⭢</a>
9494
</p>
9595

96+
<div id="community">
97+
<h2><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 245 240"><path d="M104.4 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1.1-6.1-4.5-11.1-10.2-11.1zM140.9 103.9c-5.7 0-10.2 5-10.2 11.1s4.6 11.1 10.2 11.1c5.7 0 10.2-5 10.2-11.1s-4.5-11.1-10.2-11.1z"/><path class="st0" d="M189.5 20h-134C44.2 20 35 29.2 35 40.6v135.2c0 11.4 9.2 20.6 20.5 20.6h113.4l-5.3-18.5 12.8 11.9 12.1 11.2 21.5 19V40.6c0-11.4-9.2-20.6-20.5-20.6zm-38.6 130.6s-3.6-4.3-6.6-8.1c13.1-3.7 18.1-11.9 18.1-11.9-4.1 2.7-8 4.6-11.5 5.9-5 2.1-9.8 3.5-14.5 4.3-9.6 1.8-18.4 1.3-25.9-.1-5.7-1.1-10.6-2.7-14.7-4.3-2.3-.9-4.8-2-7.3-3.4-.3-.2-.6-.3-.9-.5-.2-.1-.3-.2-.4-.3-1.8-1-2.8-1.7-2.8-1.7s4.8 8 17.5 11.8c-3 3.8-6.7 8.3-6.7 8.3-22.1-.7-30.5-15.2-30.5-15.2 0-32.2 14.4-58.3 14.4-58.3 14.4-10.8 28.1-10.5 28.1-10.5l1 1.2c-18 5.2-26.3 13.1-26.3 13.1s2.2-1.2 5.9-2.9c10.7-4.7 19.2-6 22.7-6.3.6-.1 1.1-.2 1.7-.2 6.1-.8 13-1 20.2-.2 9.5 1.1 19.7 3.9 30.1 9.6 0 0-7.9-7.5-24.9-12.7l1.4-1.6s13.7-.3 28.1 10.5c0 0 14.4 26.1 14.4 58.3 0 0-8.5 14.5-30.6 15.2z"/></svg> Join our Discord</h2>
98+
<p>If you have questions only a human can answer, would like to show others what you are working on or just want to hang out with other AssemblyScript folks, make sure to <a href="https://discord.gg/U63XU2J" target="_blank" rel="noopener">join our Discord server</a>! There you'll find channels for <strong>#announcements</strong>, <strong>#help</strong>, and more.</p>
99+
<Community />
100+
</div>
101+
96102
<style scoped>
97103
#hero {
98104
margin-top: 2rem;
@@ -196,6 +202,12 @@ loader.instantiate(module_wasm, { /* imports */ })
196202
#sponsors {
197203
margin-bottom: 2rem;
198204
}
205+
#community h2 svg {
206+
display: inline-block;
207+
height: 25px;
208+
position: relative;
209+
top: 3px;
210+
}
199211
</style>
200212

201213
<style>

src/loader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ npm install --save @assemblyscript/loader
3636
```
3737

3838
::: tip
39-
If you need a [specific version](https://github.com/AssemblyScript/assemblyscript/releases) of the loader, append the respective version number as usual. For each nightly version of the compiler there is a respective nightly of the loader as well.
39+
If you need a [specific version](https://github.com/AssemblyScript/assemblyscript/releases) of the loader, append the respective version number as usual.
4040
:::
4141

4242
## Usage

src/quick-start.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ npm install --save-dev assemblyscript
2727
```
2828

2929
::: tip
30-
If you need a [specific version](https://github.com/AssemblyScript/assemblyscript/releases) of the loader and/or the compiler, append the respective version number as usual. The latest nightly version \(note the `--save-exact`\) can be obtained via
31-
32-
```sh
33-
npm install --save --save-exact @assemblyscript/loader@nightly
34-
npm install --save-dev --save-exact assemblyscript@nightly
35-
```
30+
If you need a [specific version](https://github.com/AssemblyScript/assemblyscript/releases) of the loader and/or the compiler, append the respective version number as usual.
3631
:::
3732

3833
Once installed, the compiler provides a handy scaffolding utility to quickly set up a new AssemblyScript project, for example in the directory of the just initialized node module:

0 commit comments

Comments
 (0)