Skip to content

Commit dc3ba86

Browse files
feat!(many things): read desc
* de-mbaharip-ify * fix version * improve footer more generally * move README to sidebar and get rid of the giant "Markdown" button * reduce margin on x axis either side in header
1 parent 24d5586 commit dc3ba86

File tree

9 files changed

+33
-89
lines changed

9 files changed

+33
-89
lines changed

src/app/layout.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { type Metadata } from "next";
22
import { JetBrains_Mono, Outfit, Source_Sans_3 } from "next/font/google";
3-
import { headers } from "next/headers";
43

54
import config from "@/config/gIndex.config";
65
import { BASE_URL } from "@/constant";
@@ -52,7 +51,7 @@ export const metadata: Metadata = {
5251
name: config.siteConfig.siteAuthor,
5352
}
5453
: undefined,
55-
creator: "mbaharip",
54+
creator: "allthingslinux",
5655
icons: [
5756
{
5857
url: config.siteConfig.favIcon,
@@ -70,27 +69,17 @@ export const metadata: Metadata = {
7069
},
7170
],
7271
},
73-
twitter: {
74-
card: "summary_large_image",
75-
creator: config.siteConfig.twitterHandle,
76-
},
7772
robots: config.siteConfig.robots,
7873
};
7974

8075
export default async function RootLayout({
8176
children,
8277
}: Readonly<{ children: React.ReactNode }>) {
83-
const head = await headers();
84-
const pathname = head.get("X-Pathname") ?? "/";
85-
8678
return (
8779
<html lang="en" suppressHydrationWarning>
8880
<body
8981
className={cn(
90-
"overflow-x-hidden stroke-foreground font-sans text-foreground",
91-
pathname.startsWith("/ngdi-internal/embed/")
92-
? "h-fit bg-transparent"
93-
: "h-full min-h-screen bg-background",
82+
"overflow-x-hidden stroke-foreground font-sans text-foreground h-full min-h-screen bg-background",
9483
jetbrainsMono.variable,
9584
sourceSans3.variable,
9685
outfit.variable

src/app/ngdi-internal/page.tsx

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

src/app/page.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,19 @@ export default function RootPage() {
304304
</div>
305305

306306
<div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
307-
{/* System Info Sidebar */}
307+
{/* System Info Sidebar and README view*/}
308308
<div className="lg:col-span-1 space-y-4">
309309
<SystemInfoPanel
310310
rootItemCount={(data as FileData).data?.files?.length || 0}
311311
/>
312+
{(readme as ReadmeData).data && (
313+
<Suspense fallback={<FileReadmeFallback />}>
314+
<FileReadme
315+
content={(readme as ReadmeData).data.content}
316+
title={`README.${(readme as ReadmeData).data.type === "markdown" ? "md" : "txt"}`}
317+
/>
318+
</Suspense>
319+
)}
312320
</div>
313321

314322
{/* Main Content */}
@@ -342,15 +350,6 @@ export default function RootPage() {
342350
</Card>
343351
</div>
344352
</div>
345-
346-
{(readme as ReadmeData).data && (
347-
<Suspense fallback={<FileReadmeFallback />}>
348-
<FileReadme
349-
content={(readme as ReadmeData).data.content}
350-
title={`README.${(readme as ReadmeData).data.type === "markdown" ? "md" : "txt"}`}
351-
/>
352-
</Suspense>
353-
)}
354353
</div>
355354
);
356355
}

src/components/explorer/FileReadme.tsx

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,26 @@ import { useState } from "react";
55
import { cn } from "@/lib/utils";
66

77
import { Markdown } from "@/components/global";
8-
import { Button } from "@/components/ui/button";
98
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
109

1110
type Props = {
1211
content: string;
1312
title: string;
1413
};
1514
export default function FileReadme({ content, title }: Props) {
16-
const [view, setView] = useState<"markdown" | "raw">("markdown");
15+
const [view] = useState<"markdown" | "raw">("markdown");
1716

1817
return (
1918
<div slot="readme" className="w-full">
2019
<Card>
2120
<CardHeader className="pb-0">
2221
<div
2322
className={cn(
24-
"flex flex-col gap-4 overflow-hidden",
23+
"flex flex-col overflow-hidden",
2524
"mobile:flex-row mobile:items-center mobile:justify-between"
2625
)}
2726
>
2827
<CardTitle>{title}</CardTitle>
29-
<div className="flex w-full items-center mobile:w-fit">
30-
<Button
31-
size={"sm"}
32-
variant={view === "markdown" ? "default" : "outline"}
33-
onClick={() => setView("markdown")}
34-
className="w-full rounded-r-none mobile:w-fit"
35-
>
36-
Markdown
37-
</Button>
38-
<Button
39-
size={"sm"}
40-
variant={view === "raw" ? "default" : "outline"}
41-
onClick={() => setView("raw")}
42-
className="w-full rounded-l-none mobile:w-fit"
43-
>
44-
Raw
45-
</Button>
46-
</div>
4728
</div>
4829
</CardHeader>
4930
<CardContent className="p-1.5 px-3 pt-0 tablet:p-3 tablet:px-6 tablet:pt-0">

src/components/internal/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/layout/Navbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Navbar() {
2020
return (
2121
<header className="sticky top-0 z-50 w-full border-b border-border/40 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
2222
<div className="w-full h-16 px-6">
23-
<div className="grid grid-cols-3 h-full items-center max-w-screen-2xl mx-auto">
23+
<div className="grid grid-cols-3 h-full items-center mx-auto tablet:grid-cols-2">
2424
{/* Left Section - Logo */}
2525
<div className="flex items-center justify-start">
2626
<Link href="/" className="flex items-center space-x-3">
@@ -42,7 +42,7 @@ export default function Navbar() {
4242
{config.siteConfig.siteName}
4343
</span>
4444
<span className="text-xs text-muted-foreground font-mono leading-tight">
45-
v2.4.2 • ONLINE
45+
v{config.version} • ONLINE
4646
</span>
4747
</div>
4848
</Link>

src/config/gIndex.config.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import { type z } from "zod";
44
import { type Schema_Config } from "@/types/schema";
55

66
const config: z.input<typeof Schema_Config> = {
7-
/**
8-
* If possible, please don't change this value
9-
* Even if you're creating a PR, just let me change it myself
7+
/*
8+
* version number
109
*/
11-
version: "2.4.2",
10+
version: "0.0.1-alpha",
1211
/**
1312
* Base path of the app, used for generating links
1413
*
@@ -171,7 +170,6 @@ const config: z.input<typeof Schema_Config> = {
171170
* ref: https://nextjs.org/docs/app/api-reference/functions/generate-metadata#robots
172171
*/
173172
robots: "noindex, nofollow",
174-
twitterHandle: "",
175173

176174
/**
177175
* Show file extension on the file name
@@ -252,18 +250,17 @@ const config: z.input<typeof Schema_Config> = {
252250
* - {{ year }} will be replaced with the current year
253251
* - {{ repository }} will be replaced with the original repository link
254252
* - {{ poweredBy }} will be replaced with "Powered by next-gdrive-index", linked to the repository
255-
* - {{ author }} will be replaced with author from siteAuthor config above (If it's not set, it will be set to mbaharip)
253+
* - {{ author }} will be replaced with author from siteAuthor config above (If it's not set, it will be set to allthingslinux)
256254
* - {{ version }} will be replaced with the current version
257255
* - {{ siteName }} will be replaced with the siteName config above
258256
* - {{ handle }} will be replaced with the twitter handle from twitterHandle config above
259-
* - {{ creator }} will be replaced with mbaharip if you want to credit me
260257
*/
261258
footer: [
262259
{
263-
value: "{{ poweredBy }}",
260+
value: "{{ repository }} :: {{ poweredBy }}",
264261
},
265262
{
266-
value: " [**{{ author }}**](https://allthingslinux.org)",
263+
value: "An [**{{ author }}**](https://allthingslinux.org) project",
267264
},
268265
],
269266
/**

src/lib/utils.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,11 @@ export function formatDate(
3737
const year = parseInt(yearStr!, 10);
3838

3939
parsedDate = new Date(year, month - 1, day); // JS months are 0-based
40-
} else if (typeof date === "string" || typeof date === "number" || date instanceof Date) {
40+
} else if (
41+
typeof date === "string" ||
42+
typeof date === "number" ||
43+
date instanceof Date
44+
) {
4145
parsedDate = new Date(date);
4246
} else {
4347
throw new TypeError("Invalid date format");
@@ -74,13 +78,12 @@ export function formatFooterContent(
7478
const data = siteConfig ?? config.siteConfig;
7579
const formatMap = {
7680
year: new Date().getFullYear().toString(),
77-
repository: "[Source Code](https://github.com/mbaharip/next-gdrive-index)",
78-
poweredBy: `Powered by [next-gdrive-index v${config.version}](https://github.com/mbaharip/next-gdrive-index)`,
79-
author: data.siteAuthor ?? "mbaharip",
80-
version: config.version ?? "0.0.0",
81-
siteName: data.siteName ?? "next-gdrive-index",
82-
handle: data.twitterHandle ?? "@__mbaharip__",
83-
creator: "mbaharip",
81+
repository: "[Source Code](https://github.com/allthingslinux/iso.atl.dev)",
82+
poweredBy: `Originally forked from [next-gdrive-index v2.4.2](https://github.com/mbaharip/next-gdrive-index)`,
83+
author: data.siteAuthor ?? "allthingslinux",
84+
version: config.version ?? "0.0.1",
85+
siteName: data.siteName ?? "iso.atl.dev",
86+
creator: "allthingslinux",
8487
};
8588

8689
return text

src/types/schema.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,9 @@ export const Schema_Config_Site = z.object({
165165
siteNameTemplate: z.string().optional().default("%s"),
166166
siteDescription: z.string(),
167167
siteIcon: z.string(),
168-
siteAuthor: z.string().optional().default("mbaharip"),
168+
siteAuthor: z.string().optional().default("allthingslinux"),
169169
favIcon: z.string(),
170170
robots: z.string().optional().default("noindex, nofollow"),
171-
twitterHandle: z.string().optional().default("@__mbaharip__"),
172-
173171
showFileExtension: z.coerce.boolean().optional().default(false),
174172

175173
footer: z

0 commit comments

Comments
 (0)