Skip to content

Commit

Permalink
docs: ⚡ improvement: add config for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xandemon committed Nov 6, 2024
1 parent 3767e67 commit 0cc39b0
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/src/components/HeroSection.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { ArrowUpRight } from "lucide-react";
import { Badge } from "./ui/badge";
import { Button } from "./ui/button";
import { publicBaseUrl } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
---

<div class="flex items-center justify-between gap-4 w-full py-4">
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Navbar.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { GitHubDarkIcon, NPMIcon } from "developer-icons";
import Container from "./Container.astro";
import { publicBaseUrl } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
---

<div class="navbar bg-zinc-900">
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/UnderDevelopment.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { Button } from "./ui/button";
import { publicBaseUrl } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
---

<div class="w-full flex flex-col items-center justify-center gap-6">
Expand Down
3 changes: 2 additions & 1 deletion docs/src/components/ui/iconCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import type { IconDataType } from "../../../../lib/iconsData";
import { generateIconCompName } from "../../../../lib/utils";
import { Badge } from "./badge";
import { Loader } from "./loader";
import { downloader, publicBaseUrl } from "@/lib/utils";
import { downloader } from "@/lib/utils";
import { publicBaseUrl } from "@/config";

export const IconCard = ({ icon }: { icon: IconDataType }) => {
const [downloadLoading, setDownloadLoading] = useState(false);
Expand Down
1 change: 1 addition & 0 deletions docs/src/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const publicBaseUrl = "/developer-icons/docs";
3 changes: 2 additions & 1 deletion docs/src/layouts/DocsLayout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
---
import Container from "@/components/Container.astro";
import Navbar from "@/components/Navbar.astro";
import { cn, publicBaseUrl } from "@/lib/utils";
import { cn } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
import "@fontsource-variable/noto-sans";
import "../styles/globals.css";
import "../styles/docs.css";
Expand Down
2 changes: 1 addition & 1 deletion docs/src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import Container from "@/components/Container.astro";
import Navbar from "@/components/Navbar.astro";
import { publicBaseUrl } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
import "@fontsource-variable/noto-sans";
import "../styles/globals.css";
Expand Down
2 changes: 0 additions & 2 deletions docs/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export const publicBaseUrl = import.meta.env.PUBLIC_VITE_PUBLIC_BASE_URL;

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}
Expand Down
3 changes: 2 additions & 1 deletion docs/src/pages/icons/[category].astro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import Layout from "@/layouts/Layout.astro";
import { IconsList } from "@/components/iconsList";
import { categoriesData, iconsData } from "../../../../lib/iconsData";
import type { Category as CategoryType } from "../../../../lib/iconsData";
import { cn, publicBaseUrl } from "@/lib/utils";
import { cn } from "@/lib/utils";
import { publicBaseUrl } from "@/config";
export function getStaticPaths() {
return ["All", ...categoriesData].map((category) => ({
Expand Down

0 comments on commit 0cc39b0

Please sign in to comment.