├── .eslintignore
├── .npmrc
├── public
├── logo.ico
├── favicon.ico
├── weixin.jpg
├── icons
│ ├── antv.png
│ ├── es6.png
│ ├── taro.png
│ ├── apifox.png
│ ├── axios.ico
│ ├── coding.png
│ ├── coolify.png
│ ├── coolors.png
│ ├── cssfx.png
│ ├── figma.png
│ ├── gitee.ico
│ ├── igoutu.png
│ ├── json-cn.ico
│ ├── loading.ico
│ ├── netlify.png
│ ├── railway.png
│ ├── typeorm.ico
│ ├── uiverse.png
│ ├── electron.ico
│ ├── supabase.png
│ ├── google_fonts.ico
│ ├── hoppscotch.png
│ ├── typescript.png
│ ├── typing-svg.png
│ ├── css-inspiration.png
│ ├── github.svg
│ ├── twitter.svg
│ ├── rust.svg
│ ├── cnblogs.svg
│ ├── jquery.svg
│ ├── twind.svg
│ └── docusaurus.svg
├── next-web-nav-pc.png
├── next-web-nav-phone.png
├── next-web-nav-pc-dark.png
├── next-web-nav-pc-search.png
├── next-web-nav-phone-dark.png
├── next-web-nav-phone-search.png
├── next-web-nav-pc-dark-search.png
├── next-web-nav-phone-dark-search.png
├── vercel.svg
├── thirteen.svg
└── next.svg
├── types
└── nav.ts
├── postcss.config.mjs
├── .prettierignore
├── lib
├── utils.ts
└── fonts.ts
├── next-env.d.ts
├── components
├── site-footer.tsx
├── theme-provider.tsx
├── link-content.tsx
├── site-header
│ ├── components
│ │ ├── theme-toggle.tsx
│ │ └── icons.tsx
│ └── index.tsx
├── ui
│ ├── button.tsx
│ ├── card-hover-effect.tsx
│ ├── dialog.tsx
│ └── command.tsx
└── sidebar.tsx
├── .prettierrc.cjs
├── next.config.ts
├── .editorconfig
├── components.json
├── .gitignore
├── .eslintrc.json
├── app
├── page.tsx
└── layout.tsx
├── tsconfig.json
├── LICENSE
├── README.md
├── package.json
├── styles
└── globals.css
├── tailwind.config.ts
├── config
└── site.ts
└── tsconfig.tsbuildinfo
/.eslintignore:
--------------------------------------------------------------------------------
1 | dist/*
2 | .cache
3 | public
4 | node_modules
5 | *.esm.js
6 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.npmmirror.com
2 | # registry=https://registry.npmjs.com`
3 |
--------------------------------------------------------------------------------
/public/logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/logo.ico
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/favicon.ico
--------------------------------------------------------------------------------
/public/weixin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/weixin.jpg
--------------------------------------------------------------------------------
/public/icons/antv.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/antv.png
--------------------------------------------------------------------------------
/public/icons/es6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/es6.png
--------------------------------------------------------------------------------
/public/icons/taro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/taro.png
--------------------------------------------------------------------------------
/public/icons/apifox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/apifox.png
--------------------------------------------------------------------------------
/public/icons/axios.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/axios.ico
--------------------------------------------------------------------------------
/public/icons/coding.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/coding.png
--------------------------------------------------------------------------------
/public/icons/coolify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/coolify.png
--------------------------------------------------------------------------------
/public/icons/coolors.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/coolors.png
--------------------------------------------------------------------------------
/public/icons/cssfx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/cssfx.png
--------------------------------------------------------------------------------
/public/icons/figma.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/figma.png
--------------------------------------------------------------------------------
/public/icons/gitee.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/gitee.ico
--------------------------------------------------------------------------------
/public/icons/igoutu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/igoutu.png
--------------------------------------------------------------------------------
/public/icons/json-cn.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/json-cn.ico
--------------------------------------------------------------------------------
/public/icons/loading.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/loading.ico
--------------------------------------------------------------------------------
/public/icons/netlify.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/netlify.png
--------------------------------------------------------------------------------
/public/icons/railway.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/railway.png
--------------------------------------------------------------------------------
/public/icons/typeorm.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/typeorm.ico
--------------------------------------------------------------------------------
/public/icons/uiverse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/uiverse.png
--------------------------------------------------------------------------------
/public/icons/electron.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/electron.ico
--------------------------------------------------------------------------------
/public/icons/supabase.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/supabase.png
--------------------------------------------------------------------------------
/public/next-web-nav-pc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-pc.png
--------------------------------------------------------------------------------
/public/icons/google_fonts.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/google_fonts.ico
--------------------------------------------------------------------------------
/public/icons/hoppscotch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/hoppscotch.png
--------------------------------------------------------------------------------
/public/icons/typescript.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/typescript.png
--------------------------------------------------------------------------------
/public/icons/typing-svg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/typing-svg.png
--------------------------------------------------------------------------------
/public/next-web-nav-phone.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-phone.png
--------------------------------------------------------------------------------
/public/next-web-nav-pc-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-pc-dark.png
--------------------------------------------------------------------------------
/public/icons/css-inspiration.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/icons/css-inspiration.png
--------------------------------------------------------------------------------
/public/next-web-nav-pc-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-pc-search.png
--------------------------------------------------------------------------------
/public/next-web-nav-phone-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-phone-dark.png
--------------------------------------------------------------------------------
/public/next-web-nav-phone-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-phone-search.png
--------------------------------------------------------------------------------
/public/next-web-nav-pc-dark-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-pc-dark-search.png
--------------------------------------------------------------------------------
/types/nav.ts:
--------------------------------------------------------------------------------
1 | export interface NavItem {
2 | title: string
3 | href?: string
4 | disabled?: boolean
5 | external?: boolean
6 | }
7 |
--------------------------------------------------------------------------------
/public/next-web-nav-phone-dark-search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/knowledgefxg/knowledgeweb-nav/HEAD/public/next-web-nav-phone-dark-search.png
--------------------------------------------------------------------------------
/postcss.config.mjs:
--------------------------------------------------------------------------------
1 | /** @type {import('postcss-load-config').Config} */
2 | const config = {
3 | plugins: {
4 | tailwindcss: {}
5 | }
6 | }
7 |
8 | export default config
9 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | cache
2 | .cache
3 | package.json
4 | package-lock.json
5 | public
6 | CHANGELOG.md
7 | .yarn
8 | dist
9 | node_modules
10 | .next
11 | build
12 | .contentlayer
--------------------------------------------------------------------------------
/lib/utils.ts:
--------------------------------------------------------------------------------
1 | import { clsx, type ClassValue } from "clsx"
2 | import { twMerge } from "tailwind-merge"
3 |
4 | export function cn(...inputs: ClassValue[]) {
5 | return twMerge(clsx(inputs))
6 | }
7 |
--------------------------------------------------------------------------------
/next-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
33 |
34 |
35 |
基于 Next.js 的前端导航网站
38 | 39 | 40 | ## 预览地址 41 | 42 | - [前端导航](https://www.knowledgenav.dev/) 43 | 44 | ## 功能介绍 45 | 46 | - 自带前端导航模块 47 | - 移动端适配 48 | - 支持站内搜索 49 | - 可通过 JSON 自定义导航数据 50 | - 支持日夜颜色模式切换 51 | - 支持 Vercel 直接部署上线 52 | 53 | ## 说明 54 | 55 | - 此项目完全开源,仅供学习交流使用 56 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "next-template", 3 | "version": "0.0.3", 4 | "private": true, 5 | "packageManager": "pnpm@9.12.1", 6 | "scripts": { 7 | "dev": "next dev --turbopack", 8 | "build": "next build", 9 | "start": "next start", 10 | "lint": "next lint", 11 | "lint:fix": "next lint --fix", 12 | "preview": "next build && next start", 13 | "typecheck": "tsc --noEmit", 14 | "format:write": "prettier --write \"**/*.{cjs,mjs,js,cts,mts,ts,jsx,tsx,json,mdx}\" --cache", 15 | "format:check": "prettier --check \"**/*.{cjs,mjs,js,cts,mts,ts,jsx,tsx,json,mdx}\" --cache" 16 | }, 17 | "dependencies": { 18 | "@radix-ui/react-dialog": "^1.1.2", 19 | "@radix-ui/react-slot": "^1.0.2", 20 | "class-variance-authority": "^0.4.0", 21 | "clsx": "^1.2.1", 22 | "cmdk": "1.0.0", 23 | "framer-motion": "^11.16.0", 24 | "lucide-react": "0.105.0-alpha.4", 25 | "next": "^15.0.3", 26 | "next-themes": "^0.2.1", 27 | "react": "^18.3.1", 28 | "react-dom": "^18.3.1", 29 | "tailwind-merge": "^1.13.2", 30 | "tailwindcss-animate": "^1.0.6" 31 | }, 32 | "devDependencies": { 33 | "@types/node": "^17.0.45", 34 | "@types/react": "^18.2.70", 35 | "@types/react-dom": "^18.2.22", 36 | "@typescript-eslint/parser": "^5.61.0", 37 | "eslint": "^8.44.0", 38 | "eslint-config-next": "15.0.3", 39 | "eslint-config-prettier": "^9.1.0", 40 | "eslint-plugin-react": "^7.32.2", 41 | "eslint-plugin-tailwindcss": "^3.13.0", 42 | "postcss": "^8.4.24", 43 | "prettier": "^3.3.3", 44 | "prettier-plugin-tailwindcss": "^0.6.9", 45 | "tailwindcss": "^3.4.1", 46 | "typescript": "^5" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /components/site-header/components/theme-toggle.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import * as React from "react" 4 | import { Moon, Sun } from "lucide-react" 5 | import { useTheme } from "next-themes" 6 | 7 | import { Button } from "@/components/ui/button" 8 | 9 | export function ThemeToggle() { 10 | const { theme, setTheme } = useTheme() 11 | 12 | const isDark = theme === "dark" 13 | const toggleTheme = () => { 14 | setTheme(isDark ? "light" : "dark") 15 | } 16 | const toggleViewTransition = (event: React.MouseEvent{children}
87 | } 88 | -------------------------------------------------------------------------------- /public/icons/jquery.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /public/icons/twind.svg: -------------------------------------------------------------------------------- 1 | 63 | -------------------------------------------------------------------------------- /components/site-header/components/icons.tsx: -------------------------------------------------------------------------------- 1 | import { LucideProps, Moon, SunMedium, Twitter, type Icon as LucideIcon } from "lucide-react" 2 | 3 | export type Icon = LucideIcon 4 | 5 | export const Icons = { 6 | sun: SunMedium, 7 | moon: Moon, 8 | twitter: Twitter, 9 | logo: (props: LucideProps) => ( 10 | 16 | ), 17 | gitHub: (props: LucideProps) => ( 18 | 24 | ) 25 | } 26 | -------------------------------------------------------------------------------- /components/site-header/index.tsx: -------------------------------------------------------------------------------- 1 | "use client" 2 | 3 | import Link from "next/link" 4 | import { useCallback, useState } from "react" 5 | 6 | import { siteConfig, NavData } from "@/config/site" 7 | 8 | import { Circle, Laptop, Moon, Sun } from "lucide-react" 9 | import { useTheme } from "next-themes" 10 | import { DialogTitle } from "@radix-ui/react-dialog" 11 | 12 | import { Button } from "@/components/ui/button" 13 | import { 14 | CommandDialog, 15 | CommandEmpty, 16 | CommandGroup, 17 | CommandInput, 18 | CommandItem, 19 | CommandList, 20 | CommandSeparator 21 | } from "@/components/ui/command" 22 | 23 | import { Icons } from "./components/icons" 24 | import { ThemeToggle } from "./components/theme-toggle" 25 | 26 | export function SiteHeader() { 27 | const [open, setOpen] = useState(false) 28 | const { setTheme } = useTheme() 29 | const runCommand = useCallback((command: () => void) => { 30 | setOpen(false) 31 | command() 32 | }, []) 33 | 34 | return ( 35 |