From a1c076305dbf5956cf2faaaae9eda23504410769 Mon Sep 17 00:00:00 2001 From: Araozu Date: Thu, 21 Nov 2024 21:35:21 -0500 Subject: [PATCH] refactor: change lang spec to use new layout --- src/pages/spec/_wrapper.astro | 21 +++++++++++++++++++++ src/pages/spec/ast/ast.md | 2 +- src/pages/spec/ast/expression.md | 2 +- src/pages/spec/index.mdx | 22 ++-------------------- src/pages/spec/tokens/comments.mdx | 4 ++-- src/pages/spec/tokens/grouping.md | 2 +- src/pages/spec/tokens/identifier.mdx | 4 ++-- src/pages/spec/tokens/newline.md | 2 +- src/pages/spec/tokens/numbers.mdx | 4 ++-- src/pages/spec/tokens/operator.mdx | 4 ++-- src/pages/spec/tokens/string.mdx | 4 ++-- src/pages/spec/tokens/tokens.md | 2 +- 12 files changed, 38 insertions(+), 35 deletions(-) create mode 100644 src/pages/spec/_wrapper.astro diff --git a/src/pages/spec/_wrapper.astro b/src/pages/spec/_wrapper.astro new file mode 100644 index 0000000..fcbf1dc --- /dev/null +++ b/src/pages/spec/_wrapper.astro @@ -0,0 +1,21 @@ +--- +import NewDocsLayout, { type AstroFile } from "@/layouts/NewDocsLayout.astro"; + +const { frontmatter, headings } = Astro.props; +// Get all the posts from this dir + +const posts = await Astro.glob("./**/*.{md,mdx}") as unknown as Array; + +// Current dir +const current_dir = import.meta.dirname; +--- + + + + + diff --git a/src/pages/spec/ast/ast.md b/src/pages/spec/ast/ast.md index b62280f..7b5ba52 100644 --- a/src/pages/spec/ast/ast.md +++ b/src/pages/spec/ast/ast.md @@ -1,5 +1,5 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: AST --- diff --git a/src/pages/spec/ast/expression.md b/src/pages/spec/ast/expression.md index c153753..7e02440 100644 --- a/src/pages/spec/ast/expression.md +++ b/src/pages/spec/ast/expression.md @@ -1,5 +1,5 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Expression --- diff --git a/src/pages/spec/index.mdx b/src/pages/spec/index.mdx index 64344e5..6602dbe 100644 --- a/src/pages/spec/index.mdx +++ b/src/pages/spec/index.mdx @@ -1,26 +1,8 @@ --- -layout: ../../layouts/SpecLayout.astro +layout: "./_wrapper.astro" title: Welcome -pagesLayout: -- path: index -- path: tokens - title: Tokens - children: - - path: tokens - - path: numbers - - path: identifier - - path: string - - path: comments - - path: operator - - path: grouping - - path: newline -- path: ast - title: THP AST - children: - - path: ast - - path: expression --- -import Code from "../../components/Code.astro" +import Code from "@/components/Code.astro" # The THP Language Specification diff --git a/src/pages/spec/tokens/comments.mdx b/src/pages/spec/tokens/comments.mdx index 48bebae..002f289 100644 --- a/src/pages/spec/tokens/comments.mdx +++ b/src/pages/spec/tokens/comments.mdx @@ -1,8 +1,8 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Comment --- -import Code from "../../../components/Code.astro" +import Code from "@/components/Code.astro" # Comment diff --git a/src/pages/spec/tokens/grouping.md b/src/pages/spec/tokens/grouping.md index db54ffa..c2eea52 100644 --- a/src/pages/spec/tokens/grouping.md +++ b/src/pages/spec/tokens/grouping.md @@ -1,5 +1,5 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Grouping signs --- diff --git a/src/pages/spec/tokens/identifier.mdx b/src/pages/spec/tokens/identifier.mdx index 9ed7c1a..d40aa0f 100644 --- a/src/pages/spec/tokens/identifier.mdx +++ b/src/pages/spec/tokens/identifier.mdx @@ -1,8 +1,8 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Identifiers & Datatypes --- -import Code from "../../../components/Code.astro" +import Code from "@/components/Code.astro" # Identifiers & Datatypes diff --git a/src/pages/spec/tokens/newline.md b/src/pages/spec/tokens/newline.md index cd35b5c..beb9868 100644 --- a/src/pages/spec/tokens/newline.md +++ b/src/pages/spec/tokens/newline.md @@ -1,5 +1,5 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: New line --- diff --git a/src/pages/spec/tokens/numbers.mdx b/src/pages/spec/tokens/numbers.mdx index 892efbc..d1d77a7 100644 --- a/src/pages/spec/tokens/numbers.mdx +++ b/src/pages/spec/tokens/numbers.mdx @@ -1,8 +1,8 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Numbers --- -import Code from "../../../components/Code.astro" +import Code from "@/components/Code.astro" # Numbers diff --git a/src/pages/spec/tokens/operator.mdx b/src/pages/spec/tokens/operator.mdx index e4a8d25..12cd36e 100644 --- a/src/pages/spec/tokens/operator.mdx +++ b/src/pages/spec/tokens/operator.mdx @@ -1,8 +1,8 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Operator --- -import Code from "../../../components/Code.astro" +import Code from "@/components/Code.astro" # Operator diff --git a/src/pages/spec/tokens/string.mdx b/src/pages/spec/tokens/string.mdx index 00c661c..605553a 100644 --- a/src/pages/spec/tokens/string.mdx +++ b/src/pages/spec/tokens/string.mdx @@ -1,8 +1,8 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: String --- -import Code from "../../../components/Code.astro" +import Code from "@/components/Code.astro" # String diff --git a/src/pages/spec/tokens/tokens.md b/src/pages/spec/tokens/tokens.md index dc41312..e89f1b8 100644 --- a/src/pages/spec/tokens/tokens.md +++ b/src/pages/spec/tokens/tokens.md @@ -1,5 +1,5 @@ --- -layout: ../../../layouts/SpecLayout.astro +layout: "../_wrapper.astro" title: Index ---