-
Notifications
You must be signed in to change notification settings - Fork 2
fix(www): SEO/AEO audit improvements #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| User-agent: * | ||
| Allow: / | ||
|
|
||
| Disallow: /api/ | ||
|
|
||
| Sitemap: https://ui.shipbase.xyz/sitemap-index.xml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| export interface Props { | ||
| data: Record<string, unknown> | Record<string, unknown>[] | ||
| } | ||
|
|
||
| const { data } = Astro.props | ||
| const items = Array.isArray(data) ? data : [data] | ||
| --- | ||
|
|
||
| {items.map((item) => ( | ||
| <script type="application/ld+json" set:html={JSON.stringify(item)} /> | ||
|
Comment on lines
+10
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, locate and examine the target file
find . -name "structured-data.astro" -type f 2>/dev/nullRepository: shipbase/ui Length of output: 102 🏁 Script executed: # Check file structure and content if it exists
cat -n apps/www/src/components/structured-data.astro 2>/dev/null || echo "File not found in expected location"Repository: shipbase/ui Length of output: 413 🏁 Script executed: # Search for similar JSON-LD or set:html usage patterns in the codebase
rg "set:html.*JSON|JSON.*set:html" --type astro -A 2 -B 2 2>/dev/null || echo "No similar patterns found"Repository: shipbase/ui Length of output: 80 🌐 Web query:
💡 Result:
Practical XSS-prevention guidance
Key takeaway: Escape JSON-LD output before The component accepts untrusted data via the 🔒 Suggested hardening patch const { data } = Astro.props
const items = Array.isArray(data) ? data : [data]
+const toSafeJsonLd = (value: Record<string, unknown>) =>
+ JSON.stringify(value)
+ .replace(/</g, "\\u003c")
+ .replace(/>/g, "\\u003e")
+ .replace(/&/g, "\\u0026")
+ .replace(/\u2028/g, "\\u2028")
+ .replace(/\u2029/g, "\\u2029")
---
{items.map((item) => (
- <script type="application/ld+json" set:html={JSON.stringify(item)} />
+ <script type="application/ld+json" set:html={toSafeJsonLd(item)} />
))}🤖 Prompt for AI Agents |
||
| ))} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: shipbase/ui
Length of output: 580
Consolidate
robots.txtto one source of truth.Both
apps/www/public/robots.txtandapps/www/src/pages/robots.txt.tsexist. In Astro, the static file takes precedence, masking the dynamic route. The static file includesDisallow: /api/and a hardcoded sitemap URL, while the route lacks the API disallow directive and uses environment-aware sitemap generation.To resolve: add
Disallow: /api/toapps/www/src/pages/robots.txt.ts, then remove the staticapps/www/public/robots.txt.🤖 Prompt for AI Agents