Skip to content

Commit 580c506

Browse files
Merge pull request #378 from SheetMetalConnect/claude/fix-broken-doc-links-52L92
Make documentation URL configurable for self-hosters
2 parents b74d2b7 + 1579906 commit 580c506

File tree

9 files changed

+34
-10
lines changed

9 files changed

+34
-10
lines changed

.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ VITE_SUPABASE_PROJECT_ID="your-project-id"
3333

3434
VITE_TURNSTILE_SITE_KEY="your-turnstile-site-key"
3535

36+
# =============================================================================
37+
# DOCUMENTATION URL (Optional - for self-hosters)
38+
# =============================================================================
39+
# Override the documentation URL if you host your own docs
40+
# VITE_DOCS_URL="https://eryxon.eu"
41+
3642
# =============================================================================
3743
# CAD PROCESSING SERVICE (Optional)
3844
# =============================================================================

docs/API_DOCUMENTATION.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,9 +1067,9 @@ API access is governed by your subscription plan:
10671067
## Support
10681068

10691069
For API support:
1070-
- Documentation: https://docs.eryxon.com
1071-
- Email: api-support@eryxon.com
1072-
- Status Page: https://status.eryxon.com
1070+
- Documentation: https://docs.eryxon.eu
1071+
- Email: api-support@eryxon.eu
1072+
- Status Page: https://status.eryxon.eu
10731073

10741074
---
10751075

src/components/AdminLayout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useAuth } from "@/contexts/AuthContext";
2+
import { DOCS_GUIDES_URL } from "@/lib/config";
23
import { Button } from "@/components/ui/button";
34
import { ScrollArea } from "@/components/ui/scroll-area";
45
import { Separator } from "@/components/ui/separator";
@@ -284,7 +285,7 @@ export default function AdminLayout({ children }: AdminLayoutProps) {
284285
// External links (open in new tab)
285286
const externalLinks = [
286287
{
287-
href: "https://flow.eryxon.io/guides/",
288+
href: DOCS_GUIDES_URL,
288289
label: t("navigation.docsAndHelp"),
289290
icon: BookOpen,
290291
},

src/components/operator/OperatorLayout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react';
22
import { useTranslation } from 'react-i18next';
3+
import { DOCS_GUIDES_URL } from '@/lib/config';
34
import { Button } from '@/components/ui/button';
45
import { ScrollArea } from '@/components/ui/scroll-area';
56
import { Avatar, AvatarFallback } from '@/components/ui/avatar';
@@ -186,7 +187,7 @@ export const OperatorLayout = ({ children, showBackToAdmin = false }: OperatorLa
186187
asChild
187188
className="gap-1.5 cursor-pointer focus:bg-white/5 text-xs"
188189
>
189-
<a href="https://flow.eryxon.io/guides/" target="_blank" rel="noopener noreferrer">
190+
<a href={DOCS_GUIDES_URL} target="_blank" rel="noopener noreferrer">
190191
<HelpCircle className="h-3.5 w-3.5" />
191192
{t('common.helpAndDocs')}
192193
</a>

src/lib/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Application Configuration
3+
*
4+
* External URLs and other configurable settings.
5+
* Self-hosters can override these via environment variables.
6+
*/
7+
8+
// Documentation site URL - self-hosters can point to their own docs
9+
export const DOCS_URL = import.meta.env.VITE_DOCS_URL || 'https://eryxon.eu';
10+
11+
// Convenience exports for common doc paths
12+
export const DOCS_GUIDES_URL = `${DOCS_URL}/guides/`;
13+
export const DOCS_ERP_INTEGRATION_URL = `${DOCS_URL}/features/erp-integration/`;

src/pages/admin/DataImport.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState, useCallback, useRef } from "react";
22
import { Link } from "react-router-dom";
3+
import { DOCS_ERP_INTEGRATION_URL } from "@/lib/config";
34
import { Button } from "@/components/ui/button";
45
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
56
import { Label } from "@/components/ui/label";
@@ -411,7 +412,7 @@ export default function DataImport() {
411412
<AlertTitle>Need Help?</AlertTitle>
412413
<AlertDescription className="flex flex-wrap items-center gap-3 mt-2">
413414
<span className="text-sm">Learn more about data sync options:</span>
414-
<a href="https://flow.eryxon.io/features/erp-integration/" target="_blank" rel="noopener noreferrer">
415+
<a href={DOCS_ERP_INTEGRATION_URL} target="_blank" rel="noopener noreferrer">
415416
<Button variant="outline" size="sm" className="h-7 gap-1.5">
416417
<HelpCircle className="h-3.5 w-3.5" />
417418
ERP Integration Guide

src/pages/common/About.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Link } from "react-router-dom";
22
import { Card, CardContent } from "@/components/ui/card";
33
import { Separator } from "@/components/ui/separator";
4+
import { DOCS_GUIDES_URL } from "@/lib/config";
45

56
export default function About() {
67
return (
@@ -32,7 +33,7 @@ export default function About() {
3233
<div className="space-y-2">
3334
<p className="text-sm text-muted-foreground">
3435
<a
35-
href="https://flow.eryxon.io/guides/"
36+
href={DOCS_GUIDES_URL}
3637
target="_blank"
3738
rel="noopener noreferrer"
3839
className="hover:underline"

src/pages/common/ApiDocs.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useEffect, useState } from "react";
22
import { Link } from "react-router-dom";
3+
import { DOCS_GUIDES_URL } from "@/lib/config";
34
import SwaggerUI from "swagger-ui-react";
45
import "swagger-ui-react/swagger-ui.css";
56
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
@@ -430,7 +431,7 @@ apiClient.post('/api-jobs', jobData)
430431
CSV Import Wizard
431432
</Button>
432433
</Link>
433-
<a href="https://flow.eryxon.io/guides/" target="_blank" rel="noopener noreferrer">
434+
<a href={DOCS_GUIDES_URL} target="_blank" rel="noopener noreferrer">
434435
<Button variant="outline" size="sm" className="gap-2">
435436
<HelpCircle className="h-4 w-4" />
436437
Documentation

supabase/functions/send-invitation/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*
77
* Required environment variables:
88
* - RESEND_API_KEY: Your Resend API key
9-
* - APP_URL: Your application URL (e.g., https://app.eryxon.com)
10-
* - EMAIL_FROM: Sender email address (e.g., noreply@eryxon.com)
9+
* - APP_URL: Your application URL (e.g., https://app.eryxon.eu)
10+
* - EMAIL_FROM: Sender email address (e.g., noreply@eryxon.eu)
1111
*/
1212

1313
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'

0 commit comments

Comments
 (0)