add contentEditUrl config url
All checks were successful
Deploy / deploy (ubuntu-latest, 2.44.0) (push) Successful in 1m54s

Took 10 minutes
This commit is contained in:
Braydon 2024-10-09 22:20:01 -04:00
parent 6a2c23229e
commit adf898e3ef
3 changed files with 10 additions and 1 deletions

View File

@ -23,6 +23,7 @@
"themeColor": "#A855F7"
},
"contentSource": "{process}/docs",
"contentEditUrl": "https://git.rainnny.club/PulseApp/docs-content/src/branch/master/{slug}{ext}",
"socialLinks": [
{
"name": "GitHub",

View File

@ -23,6 +23,11 @@ export type Config = {
*/
contentSource: string;
/**
* The URL to link to for editing content of a page.
*/
contentEditUrl: string;
/**
* Social links for this app.
*/

View File

@ -8,6 +8,7 @@ import { motion, useInView } from "framer-motion";
import { Separator } from "@/components/ui/separator";
import { Button } from "@/components/ui/button";
import { AlignLeftIcon, ArrowUpFromDot, MoveRight } from "lucide-react";
import config from "@/config";
type Header = {
id: string;
@ -148,7 +149,9 @@ const Footer = ({ page }: { page: DocsContentMetadata }): ReactElement => {
{/* Edit on Git */}
<Link
className="flex gap-1.5 items-center text-xs hover:opacity-75 transition-all transform-gpu group"
href={`https://git.rainnny.club/PulseApp/docs/src/branch/master/docs/${page.slug}${page.extension}`}
href={config.contentEditUrl
.replace("{slug}", page.slug as string)
.replace("{ext}", page.extension as string)}
target="_blank"
draggable={false}
>