Skip to content

Commit

Permalink
Reformat all code and update more parts of the wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazevic committed Jun 18, 2024
1 parent 675b6c5 commit 5245803
Show file tree
Hide file tree
Showing 33 changed files with 596 additions and 550 deletions.
5 changes: 4 additions & 1 deletion .github/assets/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion .github/assets/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Deploy
on: [push]
on: [ push ]

jobs:
build:
Expand All @@ -9,7 +9,7 @@ jobs:
deployments: write
strategy:
matrix:
node-version: [20]
node-version: [ 20 ]
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lunaria.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Lunaria

on:
pull_request_target:
types: [opened, synchronize]
branches: [master]
types: [ opened, synchronize ]
branches: [ master ]

# Allow this job to clone the repository and comment on the pull request
permissions:
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
node-version: [ 20 ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You can contribute to the project in various ways:
For site generation, we use [Vitepress](https://vitepress.dev), so you'll need a working Node.js
environment installed. Refer to its documentation for making changes to Vitepress itself.

You will also need some hands-on experience with TypeScript if you're going to contribute to
You will also need some hands-on experience with TypeScript if you're going to contribute to
improving internals.

The root directory is `docs/`.
Expand Down
24 changes: 12 additions & 12 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import {enLocale} from "./locales/en-us";
import {brLocale} from "./locales/pt-br";

export default defineConfig({
...sharedConfig,
locales: {
root: {
label: "English",
lang: "en",
...enLocale,
...sharedConfig,
locales: {
root: {
label: "English",
lang: "en",
...enLocale,
},
br: {
label: "Brazilian Portuguese",
lang: "br",
...brLocale,
},
},
br: {
label: "Brazilian Portuguese",
lang: "br",
...brLocale,
},
},
});
20 changes: 10 additions & 10 deletions docs/.vitepress/hooks/Template.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<script setup lang="ts">
<script lang="ts" setup>
defineProps<{ title: string; description?: string }>();
</script>

<template>
<div
tw="w-full h-full bg-black flex flex-col"
style="
style="
background-image: linear-gradient(
43deg,
#c6f6d5 1%,
Expand All @@ -27,9 +26,10 @@ defineProps<{ title: string; description?: string }>();
#22543d 97%
);
"
tw="w-full h-full bg-black flex flex-col"
>
<div
tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between"
tw="p-10 w-full min-h-0 grow flex flex-col items-center justify-between"
>
<div tw="w-full flex justify-between items-center text-5xl font-medium">
<div tw="flex items-center">
Expand All @@ -39,15 +39,15 @@ defineProps<{ title: string; description?: string }>();
</div>
</div>
<div tw="w-full pr-56 flex flex-col items-start justify-end">
<div style="color: #eeeeee" tw="text-6xl font-bold" v-html="title" />
<div style="color: #eeeeee" tw="text-6xl font-bold" v-html="title"/>
<div
v-if="description"
style="color: #adf0dd; text-decoration-style: dotted"
tw="mt-2 text-4xl underline"
v-html="description"
v-if="description"
style="color: #adf0dd; text-decoration-style: dotted"
tw="mt-2 text-4xl underline"
v-html="description"
/>
</div>
</div>
<div tw="shrink-0 h-4 w-full flex" style="background-color: #adf0dd" />
<div style="background-color: #adf0dd" tw="shrink-0 h-4 w-full flex"/>
</div>
</template>
180 changes: 90 additions & 90 deletions docs/.vitepress/hooks/meta.ts
Original file line number Diff line number Diff line change
@@ -1,100 +1,100 @@
import type {HeadConfig, TransformContext} from "vitepress";

export function generateMeta(context: TransformContext, hostname: string) {
const head: HeadConfig[] = [];
const { pageData } = context;
const head: HeadConfig[] = [];
const {pageData} = context;

const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2")}`;
const url = `${hostname}/${pageData.relativePath.replace(/((^|\/)index)?\.md$/, "$2")}`;

head.push(
["link", { rel: "canonical", href: url }],
["meta", { property: "og:url", content: url }],
["meta", { name: "twitter:url", content: url }],
["meta", { name: "twitter:card", content: "summary_large_image" }],
["meta", { property: "og:title", content: pageData.frontmatter.title }],
["meta", { name: "twitter:title", content: pageData.frontmatter.title }],
);
if (pageData.frontmatter.description) {
head.push(
[
"meta",
{
property: "og:description",
content: pageData.frontmatter.description,
},
],
[
"meta",
{
name: "twitter:description",
content: pageData.frontmatter.description,
},
],
["link", {rel: "canonical", href: url}],
["meta", {property: "og:url", content: url}],
["meta", {name: "twitter:url", content: url}],
["meta", {name: "twitter:card", content: "summary_large_image"}],
["meta", {property: "og:title", content: pageData.frontmatter.title}],
["meta", {name: "twitter:title", content: pageData.frontmatter.title}],
);
}
if (pageData.frontmatter.image) {
head.push([
"meta",
{
property: "og:image",
content: `${hostname}/${pageData.frontmatter.image.replace(/^\//, "")}`,
},
]);
head.push([
"meta",
{
name: "twitter:image",
content: `${hostname}/${pageData.frontmatter.image.replace(/^\//, "")}`,
},
]);
} else {
const url = pageData.filePath.replace("index.md", "").replace(".md", "");
const imageUrl = `${url}/__og_image__/og.png`
.replaceAll("//", "/")
.replace(/^\//, "");
if (pageData.frontmatter.description) {
head.push(
[
"meta",
{
property: "og:description",
content: pageData.frontmatter.description,
},
],
[
"meta",
{
name: "twitter:description",
content: pageData.frontmatter.description,
},
],
);
}
if (pageData.frontmatter.image) {
head.push([
"meta",
{
property: "og:image",
content: `${hostname}/${pageData.frontmatter.image.replace(/^\//, "")}`,
},
]);
head.push([
"meta",
{
name: "twitter:image",
content: `${hostname}/${pageData.frontmatter.image.replace(/^\//, "")}`,
},
]);
} else {
const url = pageData.filePath.replace("index.md", "").replace(".md", "");
const imageUrl = `${url}/__og_image__/og.png`
.replaceAll("//", "/")
.replace(/^\//, "");

head.push(
["meta", { property: "og:image", content: `${hostname}/${imageUrl}` }],
["meta", { property: "og:image:width", content: "1200" }],
["meta", { property: "og:image:height", content: "628" }],
["meta", { property: "og:image:type", content: "image/png" }],
[
"meta",
{ property: "og:image:alt", content: pageData.frontmatter.title },
],
["meta", { name: "twitter:image", content: `${hostname}/${imageUrl}` }],
["meta", { name: "twitter:image:width", content: "1200" }],
["meta", { name: "twitter:image:height", content: "628" }],
[
"meta",
{ name: "twitter:image:alt", content: pageData.frontmatter.title },
],
);
}
if (pageData.frontmatter.tag) {
head.push([
"meta",
{ property: "article:tag", content: pageData.frontmatter.tag },
]);
}
if (pageData.frontmatter.date) {
head.push([
"meta",
{
property: "article:published_time",
content: pageData.frontmatter.date,
},
]);
}
if (pageData.lastUpdated && pageData.frontmatter.lastUpdated !== false) {
head.push([
"meta",
{
property: "article:modified_time",
content: new Date(pageData.lastUpdated).toISOString(),
},
]);
}
head.push(
["meta", {property: "og:image", content: `${hostname}/${imageUrl}`}],
["meta", {property: "og:image:width", content: "1200"}],
["meta", {property: "og:image:height", content: "628"}],
["meta", {property: "og:image:type", content: "image/png"}],
[
"meta",
{property: "og:image:alt", content: pageData.frontmatter.title},
],
["meta", {name: "twitter:image", content: `${hostname}/${imageUrl}`}],
["meta", {name: "twitter:image:width", content: "1200"}],
["meta", {name: "twitter:image:height", content: "628"}],
[
"meta",
{name: "twitter:image:alt", content: pageData.frontmatter.title},
],
);
}
if (pageData.frontmatter.tag) {
head.push([
"meta",
{property: "article:tag", content: pageData.frontmatter.tag},
]);
}
if (pageData.frontmatter.date) {
head.push([
"meta",
{
property: "article:published_time",
content: pageData.frontmatter.date,
},
]);
}
if (pageData.lastUpdated && pageData.frontmatter.lastUpdated !== false) {
head.push([
"meta",
{
property: "article:modified_time",
content: new Date(pageData.lastUpdated).toISOString(),
},
]);
}

return head;
return head;
}
Loading

0 comments on commit 5245803

Please sign in to comment.