Skip to content

Commit fff8ebf

Browse files
chore: Remove Terra pages since they have a new home (#398)
* chore: Remove Terra pages since they have a new home * test: Redirect * feat: Cursed slug redirects * feat(terra): use json lookup table for `permanentRedirect()` * chore: Remove Terra pages since they have a new home * test: Redirect * feat: Cursed slug redirects * feat(terra): use json lookup table for `permanentRedirect()` * chore: Update Getting Started slug * fix: Did this wrong * feat(terra): add description * fix: icons were not populated correctly --------- Co-authored-by: madonuko <madonuko@outlook.com>
1 parent 229a4ed commit fff8ebf

19 files changed

Lines changed: 45 additions & 3449 deletions

app/(home)/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const FYRA_PROJECTS = [
1010
slug: "helium/hig",
1111
icon: "Atom",
1212
},
13-
{ title: "Terra", href: "/terra", slug: "terra", icon: "Earth" },
13+
{ title: "Terra", href: "/terra", slug: "terra", icon: "Earth", description: "Welcome to the documentation for the Terra repository." },
1414
{ title: "Andaman", href: "/andaman", slug: "andaman", icon: "Hammer" },
1515
{
1616
title: "Submarine",
@@ -47,13 +47,13 @@ function getIcon(iconName: string | undefined): React.ReactNode | undefined {
4747

4848
export default function HomePage() {
4949
const fyraProjects = FYRA_PROJECTS.map((section) => ({
50-
...section,
5150
description: source.getPage([section.slug])?.data.description ?? "",
51+
...section,
5252
icon: getIcon(section.icon),
5353
}));
5454
const otherProjects = OTHER_PROJECTS.map((section) => ({
55-
...section,
5655
description: source.getPage([section.slug])?.data.description ?? "",
56+
...section,
5757
icon: getIcon(section.icon),
5858
}));
5959

app/terra/[...slug]/page.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { permanentRedirect } from "next/navigation";
2+
3+
export async function generateStaticParams() {
4+
return [
5+
{ slug: ["appstream"] },
6+
{ slug: ["autoupdate"] },
7+
{ slug: ["contributing"] },
8+
{ slug: ["faq"] },
9+
{ slug: ["guidelines"] },
10+
{ slug: ["index"] },
11+
{ slug: ["infrastructure"] },
12+
{ slug: ["installing"] },
13+
{ slug: ["lifecycle"] },
14+
{ slug: ["policies"] },
15+
{ slug: ["srpm"] },
16+
];
17+
}
18+
19+
export default async function Page({ params }: { params: Promise<{ slug: string }> }) {
20+
const { slug } = await params;
21+
22+
const slugKey = slug.toString();
23+
const REDIRECT_MAP: Record<string, string> = {
24+
appstream: `https://docs.terrapkg.com/contributing/${slug}`,
25+
autoupdate: `https://docs.terrapkg.com/contributing/${slug}`,
26+
contributing: `https://docs.terrapkg.com/contributing/getting-started`,
27+
guidelines: `https://docs.terrapkg.com/contributing/${slug}`,
28+
policies: `https://docs.terrapkg.com/contributing/${slug}`,
29+
srpm: `https://docs.terrapkg.com/contributing/${slug}`,
30+
installing: `https://docs.terrapkg.com/usage/${slug}`,
31+
lifecycle: `https://docs.terrapkg.com/usage/${slug}`,
32+
infrastructure: `https://docs.terrapkg.com/general/${slug}`,
33+
faq: `https://docs.terrapkg.com/reference/${slug}`,
34+
};
35+
36+
permanentRedirect(REDIRECT_MAP[slugKey] ?? "https://docs.terrapkg.com");
37+
}

content/docs/andaman/mechanisms.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following static modules (built into AndaX directly) are also available:
4848
- `anda::rpmbuild`
4949
- `anda::cfg`
5050

51-
Most if not all of the functions in the above static modules are well-documented in the [Terra documentation](/terra/autoupdate).
51+
Most if not all of the functions in the above static modules are well-documented in the [Terra documentation](https://docs.terrapkg.com/contributing/autoupdate).
5252

5353
You can pass labels into the AndaX executor during with the `--labels command-line argument`. A label is a key-value pair that can be used to tag packages (is it a nightly package?), adding special variables, etc.
5454

@@ -70,7 +70,7 @@ Which will be parsed to:
7070

7171
## Automatic Updates
7272

73-
See [Terra autoupdate documentation](/terra/autoupdate) for supported functions in AndaX
73+
See [Terra autoupdate documentation](https://docs.terrapkg.com/contributing/autoupdate) for supported functions in AndaX
7474

7575
Anda supports automatically updating packages via the `anda update` command.
7676
The command finds all the projects with an `update.rhai` in the same directory.

content/docs/rpm/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ to [Terra], packaging a few apps you find possibly useful to other people using
2222

2323
We hope you find this document useful.
2424

25-
[Terra]: https://terra.fyralabs.com
25+
[Terra]: https://terrapkg.com

content/docs/rpm/macros.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Technically, there are 3 types of "macros":
1818
This document only covers the first type.
1919

2020
<Callout type="info">
21-
This page does not cover Terra-specific (Anda SRPM) macros. For documentation on these macros, see [here](../terra/srpm). For documentation on our AppStream MetaInfo macros, see [here](../terra/appstream).
21+
This page does not cover Terra-specific (Anda SRPM) macros. For documentation on these macros, see [here](https://docs.terrapkg.com/contributing/srpm). For documentation on our AppStream MetaInfo macros, see [here](https://docs.terrapkg.com/contributing/appstream).
2222
</Callout>
2323

2424
<Callout title="Macro Argument Syntax" icon="‼️">
@@ -978,7 +978,7 @@ Parameterized as `%patch(b:p:P:REz:)`.
978978

979979
This list is NOT exhaustive. Some macros are not built-in. If your
980980
machine does not come with them, try `dnf install 'rpm_macro(macro_name)'{:sh}`.
981-
Macros with the '(Terra only)' warning are part of the `anda-srpm-macros` package in Terra, documentation for these can be found on the [Terra SRPM devdocs page](https://developer.fyralabs.com/terra/srpm#directories).
981+
Macros with the '(Terra only)' warning are part of the `anda-srpm-macros` package in Terra, documentation for these can be found on the [Terra SRPM devdocs page](https://docs.terrapkg.com/contributing/srpm#directories).
982982

983983
```
984984
/

content/docs/terra/appstream.mdx

Lines changed: 0 additions & 208 deletions
This file was deleted.

0 commit comments

Comments
 (0)