From 4783b5edee9dd8164498a8f26db3869bf9175ad2 Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 15 Jul 2024 15:56:48 +0000 Subject: [PATCH 1/4] refactor: refresh wiki index page --- src/content/wiki/faq.mdx | 1 - src/pages/wiki/index.astro | 215 +++++++++++++++++++++++++++---------- src/scss/main.scss | 1 + 3 files changed, 157 insertions(+), 60 deletions(-) diff --git a/src/content/wiki/faq.mdx b/src/content/wiki/faq.mdx index bb0d560..6e9cfdd 100644 --- a/src/content/wiki/faq.mdx +++ b/src/content/wiki/faq.mdx @@ -1,7 +1,6 @@ --- title: FAQ description: Answers for frequently asked questions -getting-started: true --- import Accordion from "~/components/common/Accordion.astro"; diff --git a/src/pages/wiki/index.astro b/src/pages/wiki/index.astro index 88925e2..3796b1b 100644 --- a/src/pages/wiki/index.astro +++ b/src/pages/wiki/index.astro @@ -20,6 +20,11 @@ await Promise.all( }) ) ); +const articleCount = allWikiArticles.length; +const wordCount = allWikiArticles.reduce( + (x, article) => x + Array.from(article.body.matchAll(/\w+/g)).length, + 0 +); const gettingStartedArticles = allWikiArticles.filter( (article) => article.data["getting-started"] === true ); @@ -73,7 +78,19 @@ if (!contributors) {
-

Welcome to the wiki!

+

Welcome To The Wiki!

+

Get Started

@@ -81,12 +98,6 @@ if (!contributors) { Below are some good articles for those new to the Lua Language Server

-
- - Install -

Installation instructions

-
-
{ gettingStartedArticles.map((article) => (
@@ -99,6 +110,46 @@ if (!contributors) { }
+
+

All Wiki Articles

+
+

+ Tip: You can press / to search the wiki +

+
+ + + + +
+
+
+ { + allWikiArticles.map((article) => ( +
+ +
{article.data.title}
+

{article.data.description}

+
+
+ )) + } +
+
+ {articleCount} Articles + {wordCount} Words +
+

Top Contributors

@@ -107,12 +158,6 @@ if (!contributors) { group="solid" color="red" /> -
- - Contribute today! -

{ @@ -143,35 +188,13 @@ if (!contributors) { )) }
-
-
-

All Wiki Articles

-
- - - - -
-
- { - allWikiArticles.map((article) => ( -
- -
{article.data.title}
-

{article.data.description}

-
-
- )) - } -
+

+ + Contribute today! + +

@@ -226,27 +249,71 @@ if (!contributors) { diff --git a/src/scss/main.scss b/src/scss/main.scss index f3ccc30..4f5bcfc 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -42,6 +42,7 @@ h6 { text-align: center; word-wrap: break-word; white-space: normal; + font-weight: 500; } h1 { From 296cd0765ee59e4563afce6f78767aab79c4161e Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 15 Jul 2024 16:43:16 +0000 Subject: [PATCH 2/4] refactor: further wiki index page improvements --- src/pages/wiki/index.astro | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/pages/wiki/index.astro b/src/pages/wiki/index.astro index 3796b1b..3def2e3 100644 --- a/src/pages/wiki/index.astro +++ b/src/pages/wiki/index.astro @@ -95,7 +95,7 @@ if (!contributors) {

Get Started

- Below are some good articles for those new to the Lua Language Server + Below are some good articles for those new to the Lua Language Server.

{ @@ -115,7 +115,7 @@ if (!contributors) {

Tip: You can press / to search the wikiTip: You can press / to search the wiki!

@@ -192,7 +192,7 @@ if (!contributors) { - Contribute today! + Help Contribute To The Wiki!

@@ -259,11 +259,15 @@ if (!contributors) { color: white; border: solid #0084ff 0.1em; box-shadow: #0084ff 0px 0px 0.2em 0.1em; - // background-color: #0d2842; + transition: box-shadow 0.25s ease-in-out; border-radius: 0.5em; padding: 0.5em 1em; gap: 0px 0.75em; + &:hover { + box-shadow: #178fff 0px 0px 0.4em 0.3em; + } + :global(.icon) { font-size: 2.5em; display: inline-block; @@ -334,6 +338,13 @@ if (!contributors) { p { color: #ffffffcc; } + + a { + transition: color 0.25s ease-in-out; + &:hover { + color: #ffb700; + } + } } } @@ -420,6 +431,13 @@ if (!contributors) { p { color: #ffffffcc; } + + a { + transition: color 0.25s ease-in-out; + &:hover { + color: #ffb700; + } + } } } @@ -432,6 +450,7 @@ if (!contributors) { .subtitle { display: flex; flex-wrap: wrap; + margin-bottom: 0.5em; p.tip { font-size: 0.7em; From 8073cd7fdc553ecb07c2db5fa812576ac7af048c Mon Sep 17 00:00:00 2001 From: carsakiller Date: Mon, 15 Jul 2024 16:44:26 +0000 Subject: [PATCH 3/4] fix: semantic markup of wiki article layout --- src/layouts/WikiArticle.astro | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/layouts/WikiArticle.astro b/src/layouts/WikiArticle.astro index f4f3b4c..4470b3a 100644 --- a/src/layouts/WikiArticle.astro +++ b/src/layouts/WikiArticle.astro @@ -31,10 +31,10 @@ export interface Props {
-
+
+
@@ -90,10 +90,10 @@ export interface Props {
- +