diff --git a/CHANGELOG.md b/CHANGELOG.md index c165e71..3b71425 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,28 @@ ### Added +- Expandables Leftbar +- sponsor badges or ads - boolean show/hide `edit on github` +- with the same code run anywhere (bun or nodejs) +- add fronmatter (metadata) to playground editor ### Improved - adjusment docu.json - adjustment navbar, footer and components +### Fixed + +- bun compability rename .js to common js +- cli manage packageManager on package.json +- inconsistent design moved to better UI/UX +- error handle render footer.social + +### Removed + +- remove confused and verbose cli on installer + ## [1.8.0] - 2025-03-01 > Now looks more modern and clean which is a big change in layout and design diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx index 7fb2d1e..7022893 100644 --- a/app/docs/[[...slug]]/page.tsx +++ b/app/docs/[[...slug]]/page.tsx @@ -88,7 +88,7 @@ export default async function DocsPage({ params: { slug = [] } }: PageProps) {

{description}

{res.content}
diff --git a/components/SidebarToggle.tsx b/components/SidebarToggle.tsx new file mode 100644 index 0000000..8c977d0 --- /dev/null +++ b/components/SidebarToggle.tsx @@ -0,0 +1,23 @@ +import { Button } from "@/components/ui/button"; +import { ChevronLeft, ChevronRight } from "lucide-react"; + +type Props = { + isOpen: boolean; + onToggle: () => void; +}; + +export function SidebarToggle({ isOpen, onToggle }: Props) { + return ( +
+ +
+ ); +} diff --git a/components/Sponsor.tsx b/components/Sponsor.tsx new file mode 100644 index 0000000..c1c5b31 --- /dev/null +++ b/components/Sponsor.tsx @@ -0,0 +1,37 @@ +import docuConfig from "@/docu.json"; +import Image from "next/image"; +import Link from "next/link"; + +export function Sponsor() { + const sponsor = docuConfig.sponsor; + const item = sponsor?.item; + + if (!item) return null; + + return ( +
+

{sponsor.title || "Sponsor"}

+ +
+ {item.title} +
+
+

{item.title}

+

{item.description}

+
+ +
+ ); +} + +export default Sponsor; diff --git a/components/changelog/version-entry.tsx b/components/changelog/version-entry.tsx index 4e32da1..1b89242 100644 --- a/components/changelog/version-entry.tsx +++ b/components/changelog/version-entry.tsx @@ -24,13 +24,13 @@ interface VersionEntryProps { isLast?: boolean; } -export function VersionEntry({ - version, - date, +export function VersionEntry({ + version, + date, description, - image, + image, changes, - isLast + isLast }: VersionEntryProps) { const [expanded, setExpanded] = useState(false); @@ -45,7 +45,7 @@ export function VersionEntry({ {formatDate2(date)}
- + {description && (

{description}

)} @@ -69,8 +69,8 @@ export function VersionEntry({
{Object.entries(changes).map(([type, items]) => ( items && items.length > 0 && ( - items && items.length > 5) && (
); -} \ No newline at end of file +} diff --git a/components/footer.tsx b/components/footer.tsx index 67d513a..5dbaeeb 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -30,12 +30,20 @@ export function Footer() { } export function FooterButtons() { - const { footer } = docuConfig; + const footer = docuConfig?.footer; + + // Jangan render apapun jika tidak ada data sosial + if (!footer?.social || !Array.isArray(footer.social) || footer.social.length === 0) { + return null; + } return ( <> - {footer.social?.map((item) => { - const IconComponent = (LucideIcons[item.iconName as keyof typeof LucideIcons] ?? LucideIcons["Globe"]) as unknown as React.FC<{ className?: string }>; + {footer.social.map((item) => { + const IconComponent = + (LucideIcons[item.iconName as keyof typeof LucideIcons] ?? + LucideIcons["Globe"]) as React.FC<{ className?: string }>; + return ( - - + ); @@ -36,7 +60,7 @@ export function SheetLeftbar() { Menu - +
diff --git a/components/toc.tsx b/components/toc.tsx index 099291a..ff81fed 100644 --- a/components/toc.tsx +++ b/components/toc.tsx @@ -2,19 +2,25 @@ import { getDocsTocs } from "@/lib/markdown"; import TocObserver from "./toc-observer"; import { ScrollArea } from "@/components/ui/scroll-area"; import { ListIcon } from "lucide-react"; +import Sponsor from "./Sponsor"; + export default async function Toc({ path }: { path: string }) { const tocs = await getDocsTocs(path); return (
-
-
-

On this page

+
+
+
+ +

On this page

+
+ + +
- - - +
); diff --git a/docu.json b/docu.json index bf87854..1d64772 100644 --- a/docu.json +++ b/docu.json @@ -17,12 +17,12 @@ "social": [ { "name": "Gitlab", - "url": "https://gitlab.com/mywildancloud/docubook", + "url": "https://gitlab.com/mywildancloud", "iconName": "GitlabIcon" }, { "name": "Instagram", - "url": "https://www.instagram.com/wildan.nrs/", + "url": "https://www.instagram.com/wildan.nrs", "iconName": "InstagramIcon" }, { @@ -53,6 +53,15 @@ "editPathTemplate": "/blob/main/{filePath}", "editLink": true }, + "sponsor": { + "title": "Our Sponsor", + "item": { + "title": "Vercel", + "description": "Deploy your Next.js app with zero configuration.", + "image": "/images/vercel.png", + "url": "https://vercel.com" + } + }, "routes": [ { "title": "Getting Started", diff --git a/package.json b/package.json index 1248c9d..ec48371 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "docubook", - "version": "1.8.0", + "version": "1.8.5", "private": true, "scripts": { "dev": "next dev", diff --git a/public/images/vercel.png b/public/images/vercel.png new file mode 100644 index 0000000..43f8281 Binary files /dev/null and b/public/images/vercel.png differ diff --git a/tailwind.config.ts b/tailwind.config.ts index b529851..56783f3 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -14,7 +14,7 @@ const config = { center: true, padding: '2rem', screens: { - '2xl': '1300px' + '2xl': '1440px' } }, extend: {