@@ -20,6 +20,11 @@ await Promise.all(
20
20
})
21
21
)
22
22
);
23
+ const articleCount = allWikiArticles .length ;
24
+ const wordCount = allWikiArticles .reduce (
25
+ (x , article ) => x + Array .from (article .body .matchAll (/ \w + / g )).length ,
26
+ 0
27
+ );
23
28
const gettingStartedArticles = allWikiArticles .filter (
24
29
(article ) => article .data [" getting-started" ] === true
25
30
);
@@ -73,20 +78,26 @@ if (!contributors) {
73
78
74
79
<Layout title =" Wiki" >
75
80
<main >
76
- <h1 >Welcome to the wiki!</h1 >
81
+ <h1 >Welcome To The Wiki!</h1 >
82
+ <div id =" quick-links" >
83
+ <a href =" /#install" >
84
+ <Icon name =" download" group =" solid" class =" icon" />
85
+ <h2 >Install</h2 >
86
+ <p >Install instructions for the Lua Language Server.</p >
87
+ </a >
88
+ <a href =" /wiki/faq/" >
89
+ <Icon name =" question" group =" solid" class =" icon" />
90
+ <h2 >FAQ</h2 >
91
+ <p >Frequently asked questions and answers to them.</p >
92
+ </a >
93
+ </div >
77
94
<div class =" grid" >
78
95
<section id =" get-started" >
79
96
<h2 >Get Started</h2 >
80
97
<p >
81
- Below are some good articles for those new to the Lua Language Server
98
+ Below are some good articles for those new to the Lua Language Server.
82
99
</p >
83
100
<div class =" grid" >
84
- <div class =" article" >
85
- <a href =" /#install" target =" _blank" >
86
- Install
87
- <p >Installation instructions</p >
88
- </a >
89
- </div >
90
101
{
91
102
gettingStartedArticles .map ((article ) => (
92
103
<div class = " article" >
@@ -99,6 +110,46 @@ if (!contributors) {
99
110
}
100
111
</div >
101
112
</section >
113
+ <section id =" all-articles" >
114
+ <h2 >All Wiki Articles</h2 >
115
+ <div class =" subtitle" >
116
+ <p class =" tip" >
117
+ <i
118
+ ><b >Tip:</b > You can press <code >/ </code > to search the wiki!</i
119
+ >
120
+ </p >
121
+ <div class =" sorts" >
122
+ <Tooltip content =" Sort Method" >
123
+ <Icon group =" solid" name =" sort" />
124
+ </Tooltip >
125
+ <select name =" sort" id =" sort" >
126
+ <option value =" alphabetical" >A-Z</option >
127
+ <option value =" last-modified" >Last Modified</option >
128
+ <option value =" length" >Length</option >
129
+ </select >
130
+ </div >
131
+ </div >
132
+ <div class =" grid" >
133
+ {
134
+ allWikiArticles .map ((article ) => (
135
+ <div
136
+ class = " article"
137
+ data-last-modified = { article .data .lastModified }
138
+ data-length = { article .body .length }
139
+ >
140
+ <a href = { ` /wiki/${article .slug }/ ` } >
141
+ <div class = " name" >{ article .data .title } </div >
142
+ <p class = " description" >{ article .data .description } </p >
143
+ </a >
144
+ </div >
145
+ ))
146
+ }
147
+ </div >
148
+ <div class =" stats" >
149
+ <span ><b >{ articleCount } </b > Articles</span >
150
+ <span ><b >{ wordCount } </b > Words</span >
151
+ </div >
152
+ </section >
102
153
<section id =" contributors" >
103
154
<h2 >Top Contributors</h2 >
104
155
<p >
@@ -107,12 +158,6 @@ if (!contributors) {
107
158
group =" solid"
108
159
color =" red"
109
160
/>
110
- <br />
111
- <ExternalLink
112
- url =" https://github.com/LuaLS/LuaLS.github.io/blob/main/docs/CONTRIBUTING.md"
113
- >
114
- Contribute today!
115
- </ExternalLink >
116
161
</p >
117
162
<div class =" grid" >
118
163
{
@@ -143,35 +188,13 @@ if (!contributors) {
143
188
))
144
189
}
145
190
</div >
146
- </section >
147
- <section id =" all-articles" >
148
- <h2 >All Wiki Articles</h2 >
149
- <div class =" sorts" >
150
- <Tooltip content =" Sort Method" >
151
- <Icon group =" solid" name =" sort" />
152
- </Tooltip >
153
- <select name =" sort" id =" sort" >
154
- <option value =" alphabetical" >A-Z</option >
155
- <option value =" last-modified" >Last Modified</option >
156
- <option value =" length" >Length</option >
157
- </select >
158
- </div >
159
- <div class =" grid" >
160
- {
161
- allWikiArticles .map ((article ) => (
162
- <div
163
- class = " article"
164
- data-last-modified = { article .data .lastModified }
165
- data-length = { article .body .length }
166
- >
167
- <a href = { ` /wiki/${article .slug }/ ` } >
168
- <div class = " name" >{ article .data .title } </div >
169
- <p class = " description" >{ article .data .description } </p >
170
- </a >
171
- </div >
172
- ))
173
- }
174
- </div >
191
+ <p >
192
+ <ExternalLink
193
+ url =" https://github.com/LuaLS/LuaLS.github.io/blob/main/docs/CONTRIBUTING.md"
194
+ >
195
+ Help Contribute To The Wiki!
196
+ </ExternalLink >
197
+ </p >
175
198
</section >
176
199
</div >
177
200
</main >
@@ -226,27 +249,75 @@ if (!contributors) {
226
249
</script >
227
250
228
251
<style lang =" scss" >
252
+ #quick-links {
253
+ display: flex;
254
+ justify-content: center;
255
+ gap: 5vw 5vw;
256
+ margin: 0px 1em;
257
+
258
+ & > a {
259
+ color: white;
260
+ border: solid #0084ff 0.1em;
261
+ box-shadow: #0084ff 0px 0px 0.2em 0.1em;
262
+ transition: box-shadow 0.25s ease-in-out;
263
+ border-radius: 0.5em;
264
+ padding: 0.5em 1em;
265
+ gap: 0px 0.75em;
266
+
267
+ &:hover {
268
+ box-shadow: #178fff 0px 0px 0.4em 0.3em;
269
+ }
270
+
271
+ :global(.icon) {
272
+ font-size: 2.5em;
273
+ display: inline-block;
274
+ }
275
+
276
+ h2 {
277
+ display: inline-block;
278
+ width: fit-content;
279
+ margin: 0px 0px 0px 0.5em;
280
+ font-size: 2em;
281
+ }
282
+
283
+ p {
284
+ margin: 0px 0px;
285
+ }
286
+ }
287
+ }
288
+
229
289
.grid {
230
290
display: grid;
231
291
grid-template-columns: 1fr 1fr;
232
292
gap: 1em;
233
- margin: 1em;
234
293
235
294
& > section {
236
- background-color: #163d62;
295
+ border: solid #0084ff 0.1em;
296
+ box-shadow: #0084ff 0px 0px 0.2em 0.1em;
237
297
padding: 1em;
238
298
border-radius: 0.5em;
239
299
240
300
h2 {
241
301
margin: 0px;
302
+ width: fit-content;
242
303
}
243
- }
244
304
245
- p {
246
- text-align: center;
305
+ p {
306
+ &:first-of-type {
307
+ margin: 0px 0px 1em 0px;
308
+ }
309
+ &:nth-of-type(2) {
310
+ text-align: center;
311
+ margin-bottom: 0px;
312
+ }
313
+ }
247
314
}
248
315
}
249
316
317
+ main > .grid {
318
+ margin: 2em 1em;
319
+ }
320
+
250
321
div.article {
251
322
a {
252
323
font-size: 1.3em;
@@ -263,6 +334,17 @@ if (!contributors) {
263
334
.grid {
264
335
grid-template-columns: repeat(auto-fill, minmax(10em, 1fr));
265
336
text-align: center;
337
+
338
+ p {
339
+ color: #ffffffcc;
340
+ }
341
+
342
+ a {
343
+ transition: color 0.25s ease-in-out;
344
+ &:hover {
345
+ color: #ffb700;
346
+ }
347
+ }
266
348
}
267
349
}
268
350
@@ -333,7 +415,8 @@ if (!contributors) {
333
415
}
334
416
335
417
section#all-articles {
336
- grid-column: 1 / span 2;
418
+ grid-column: 2 / 3;
419
+ grid-row: 1 / 3;
337
420
338
421
.grid {
339
422
grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
@@ -344,21 +427,49 @@ if (!contributors) {
344
427
flex-direction: column;
345
428
justify-content: space-between;
346
429
gap: 0.2em 0px;
430
+
431
+ p {
432
+ color: #ffffffcc;
433
+ }
434
+
435
+ a {
436
+ transition: color 0.25s ease-in-out;
437
+ &:hover {
438
+ color: #ffb700;
439
+ }
440
+ }
347
441
}
348
442
}
349
443
350
- .sorts {
351
- width: fit-content;
352
- margin-left: auto;
444
+ .stats {
445
+ display: flex;
446
+ gap: 1em;
447
+ justify-content: right;
448
+ }
353
449
354
- select#sort {
355
- background: transparent;
356
- border: none;
357
- border-bottom: #276cae solid 0.2em;
358
- color: white;
450
+ .subtitle {
451
+ display: flex;
452
+ flex-wrap: wrap;
453
+ margin-bottom: 0.5em;
359
454
360
- option {
361
- color: black;
455
+ p.tip {
456
+ font-size: 0.7em;
457
+ opacity: 0.8;
458
+ margin: 0px;
459
+ }
460
+ .sorts {
461
+ width: fit-content;
462
+ margin-left: auto;
463
+
464
+ select#sort {
465
+ background: transparent;
466
+ border: none;
467
+ border-bottom: #276cae solid 0.2em;
468
+ color: white;
469
+
470
+ option {
471
+ color: black;
472
+ }
362
473
}
363
474
}
364
475
}
@@ -370,13 +481,18 @@ if (!contributors) {
370
481
}
371
482
372
483
section#all-articles {
373
- grid-column: 1;
484
+ grid-column: unset;
485
+ grid-row: 3 / 3;
374
486
}
375
487
}
376
488
377
489
@media screen and (max-width: 700px) {
378
490
#contributors div.grid {
379
491
grid-template-columns: repeat(auto-fill, minmax(5em, 1fr));
380
492
}
493
+
494
+ #quick-links {
495
+ flex-wrap: wrap;
496
+ }
381
497
}
382
498
</style >
0 commit comments