diff --git a/.gitignore b/.gitignore index acaf3a3..a68f926 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ node_modules .env*.local next-env.d.ts .sentryclirc -.env +config.json sw.* workbox-* swe-worker-* diff --git a/config.json.example b/config.json.example new file mode 100644 index 0000000..e8c0841 --- /dev/null +++ b/config.json.example @@ -0,0 +1,26 @@ +{ + "contentSource": "{process}/docs", + "socialLinks": [ + { + "name": "GitHub", + "tooltip": "View our Github", + "logo": "./github.svg", + "href": "https://github.com/PulseAppCC", + "navbar": true + }, + { + "name": "Discord", + "tooltip": "Join our Discord", + "logo": "./discord.svg", + "href": "https://discord.pulseapp.cc", + "navbar": true + }, + { + "name": "Email", + "tooltip": "Email us", + "logo": "Mail", + "href": "mailto:support@pulseapp.cc", + "navbar": false + } + ] +} \ No newline at end of file diff --git a/src/app/config.ts b/src/app/config.ts new file mode 100644 index 0000000..fe648c1 --- /dev/null +++ b/src/app/config.ts @@ -0,0 +1,6 @@ +/** + * The configuration for this app. + */ +import config from "@/configJson"; + +export default config as Config; diff --git a/src/app/types/config.ts b/src/app/types/config.ts new file mode 100644 index 0000000..1e7644e --- /dev/null +++ b/src/app/types/config.ts @@ -0,0 +1,42 @@ +type Config = { + /** + * The source to get the content from. + * This can either be a local source, or + * a remote Git repository. + */ + contentSource: string; + + /** + * Social links for this app. + */ + socialLinks: SocialLink[]; +}; + +type SocialLink = { + /** + * The name of this social link. + */ + name: string; + + /** + * The tooltip for this social link. + */ + tooltip: string; + + /** + * The logo for this social link. + * This can either be an image URL, or + * the name of an icon from Lucide Icons + */ + logo: string; + + /** + * The href for this social link. + */ + href: string; + + /** + * Whether to show this social link in the navbar. + */ + navbar: boolean; +}; diff --git a/src/components/footer.tsx b/src/components/footer.tsx index 8c69b16..6b3a487 100644 --- a/src/components/footer.tsx +++ b/src/components/footer.tsx @@ -5,8 +5,9 @@ import AnimatedGridPattern from "@/components/ui/animated-grid-pattern"; import Link from "next/link"; import Image from "next/image"; import { cn } from "@/lib/utils"; -import { ExternalLink, Mail } from "lucide-react"; +import { ExternalLink } from "lucide-react"; import SocialLink from "@/components/social-link"; +import config from "@/config"; const links = { Resources: [ @@ -55,27 +56,13 @@ const Footer = (): ReactElement => ( {/* Socials */}
- - - } - href="mailto:support@pulseapp.cc" - /> + {config.socialLinks.map((link: SocialLink) => ( + + ))}
diff --git a/src/components/navbar/navbar.tsx b/src/components/navbar/navbar.tsx index 4323844..aae7069 100644 --- a/src/components/navbar/navbar.tsx +++ b/src/components/navbar/navbar.tsx @@ -6,6 +6,7 @@ import Image from "next/image"; import QuickSearchDialog from "@/components/navbar/search-dialog"; import Sidebar from "@/components/sidebar/sidebar"; import SocialLink from "@/components/social-link"; +import config from "@/config"; const Navbar = ({ pages }: { pages: DocsContentMetadata[] }): ReactElement => (