Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Improve free tools UI

Blue Mouse593724e45b44
diff --git a/docs/app/components/Footer.tsx b/docs/app/components/Footer.tsx
index 9add659e1..d966d21ed 100644
--- a/docs/app/components/Footer.tsx
+++ b/docs/app/components/Footer.tsx
@@ -26,6 +26,7 @@ import {
CodeIcon,
MoneyIcon,
QrCodeIcon,
+ PlusCircleIcon,
type IconProps,
} from "@phosphor-icons/react";
import type { FC, ReactNode } from "react";
@@ -138,6 +139,12 @@ const freeTools: NavItem[] = [
icon: QrCodeIcon,
iconColor: "text-fuchsia-400",
},
+ {
+ name: "More free tools",
+ href: `${SITE}/tools`,
+ icon: PlusCircleIcon,
+ iconColor: "text-gray-400",
+ },
];
const resources: NavItem[] = [
diff --git a/web/app/components/Footer/index.tsx b/web/app/components/Footer/index.tsx
index 2d35c7384..5b0c7262b 100644
--- a/web/app/components/Footer/index.tsx
+++ b/web/app/components/Footer/index.tsx
@@ -29,6 +29,7 @@ import {
CodeIcon,
MoneyIcon,
QrCodeIcon,
+ PlusCircleIcon,
} from '@phosphor-icons/react'
import _map from 'lodash/map'
import React, { memo, type FC } from 'react'
@@ -200,6 +201,16 @@ const freeTools: NavItem[] = [
icon: QrCodeIcon,
iconColor: 'text-fuchsia-400',
},
+ {
+ key: 'more-free-tools',
+ name: 'More free tools',
+ href: isSelfhosted
+ ? `https://swetrix.com${routesPath.tools}`
+ : routesPath.tools,
+ internal: !isSelfhosted,
+ icon: PlusCircleIcon,
+ iconColor: 'text-gray-400',
+ },
]
const comparisons: NavItem[] = [
diff --git a/web/app/components/ToolsNav.tsx b/web/app/components/ToolsNav.tsx
index 1b9642975..1266e0ad9 100644
--- a/web/app/components/ToolsNav.tsx
+++ b/web/app/components/ToolsNav.tsx
@@ -10,10 +10,13 @@ import {
CodeIcon,
MoneyIcon,
QrCodeIcon,
+ BracketsCurlyIcon,
+ RobotIcon,
} from '@phosphor-icons/react'
import { useState } from 'react'
import { Link, useLocation } from 'react-router'
+import { Text } from '~/ui/Text'
import { cn } from '~/utils/generic'
export const TOOLS = [
@@ -87,6 +90,20 @@ export const TOOLS = [
href: '/tools/qr-code-generator',
icon: QrCodeIcon,
},
+ {
+ id: 'schema-markup-generator',
+ title: 'Schema Markup Generator',
+ description: 'Generate JSON-LD structured data for rich snippets',
+ href: '/tools/schema-markup-generator',
+ icon: BracketsCurlyIcon,
+ },
+ {
+ id: 'robots-txt-generator',
+ title: 'Robots.txt Generator',
+ description: 'Create crawler rules to control search engine indexing',
+ href: '/tools/robots-txt-generator',
+ icon: RobotIcon,
+ },
] as const
interface ToolsNavProps {
@@ -99,7 +116,7 @@ export function ToolsNav({ className }: ToolsNavProps) {
return (
<nav
className={cn(
- 'overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-900 dark:ring-slate-700',
+ 'overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800',
className,
)}
>
@@ -113,10 +130,10 @@ export function ToolsNav({ className }: ToolsNavProps) {
to={tool.href}
className={cn(
'flex items-start gap-3 px-4 py-3 transition-colors',
- index !== 0 && 'border-t border-gray-100 dark:border-slate-700',
+ index !== 0 && 'border-t border-gray-100 dark:border-slate-800',
isActive
- ? 'bg-gray-50 dark:bg-slate-700/50'
- : 'hover:bg-gray-50 dark:hover:bg-slate-700/30',
+ ? 'bg-gray-50 dark:bg-slate-800/50'
+ : 'hover:bg-gray-50 dark:hover:bg-slate-800/30',
)}
>
<Icon
@@ -128,19 +145,17 @@ export function ToolsNav({ className }: ToolsNavProps) {
)}
/>
<div className='min-w-0'>
- <p
- className={cn(
- 'text-sm font-medium',
- isActive
- ? 'text-gray-900 dark:text-white'
- : 'text-gray-600 dark:text-gray-300',
- )}
+ <Text
+ as='p'
+ size='sm'
+ weight='medium'
+ colour={isActive ? 'primary' : 'muted'}
>
{tool.title}
- </p>
- <p className='text-xs text-gray-500 dark:text-gray-400'>
+ </Text>
+ <Text as='p' size='xs' colour='muted'>
{tool.description}
- </p>
+ </Text>
</div>
</Link>
)
@@ -173,12 +188,12 @@ export function ToolsNavMobile({ className }: ToolsNavProps) {
<CurrentIcon className='h-5 w-5 shrink-0 text-gray-900 dark:text-white' />
)}
<div className='text-left'>
- <p className='text-sm font-medium text-gray-900 dark:text-white'>
+ <Text as='p' size='sm' weight='medium' colour='primary'>
{currentTool?.title || 'Tools'}
- </p>
- <p className='text-xs text-gray-500 dark:text-gray-400'>
+ </Text>
+ <Text as='p' size='xs' colour='muted'>
{currentTool?.description || 'Select a tool'}
- </p>
+ </Text>
</div>
</div>
<CaretDownIcon
@@ -207,12 +222,12 @@ export function ToolsNavMobile({ className }: ToolsNavProps) {
>
<Icon className='mt-0.5 h-5 w-5 shrink-0 text-gray-400 dark:text-gray-500' />
<div className='min-w-0'>
- <p className='text-sm font-medium text-gray-600 dark:text-gray-300'>
+ <Text as='p' size='sm' weight='medium' colour='muted'>
{tool.title}
- </p>
- <p className='text-xs text-gray-500 dark:text-gray-400'>
+ </Text>
+ <Text as='p' size='xs' colour='muted'>
{tool.description}
- </p>
+ </Text>
</div>
</Link>
)
diff --git a/web/app/components/marketing/FAQ.tsx b/web/app/components/marketing/FAQ.tsx
index 11cbb86d6..b5095eb57 100644
--- a/web/app/components/marketing/FAQ.tsx
+++ b/web/app/components/marketing/FAQ.tsx
@@ -19,13 +19,16 @@ const FAQ = ({ includeGAQuestions = false }: FAQProps) => {
e.stopPropagation()
}
- const values = {
- lowestPlanEventsAmount:
- PLAN_LIMITS['100k'].monthlyUsageLimit.toLocaleString('en-US'),
- moderatePlanEventsAmount:
- PLAN_LIMITS['500k'].monthlyUsageLimit.toLocaleString('en-US'),
- freeTrialDays: TRIAL_DAYS,
- }
+ const values = useMemo(
+ () => ({
+ lowestPlanEventsAmount:
+ PLAN_LIMITS['100k'].monthlyUsageLimit.toLocaleString('en-US'),
+ moderatePlanEventsAmount:
+ PLAN_LIMITS['500k'].monthlyUsageLimit.toLocaleString('en-US'),
+ freeTrialDays: TRIAL_DAYS,
+ }),
+ [],
+ )
const stripTags = (html: string) =>
sanitizeHtml(html, {
allowedTags: [],
diff --git a/web/app/routes/_index.tsx b/web/app/routes/_index.tsx
index 21b960452..152166d05 100644
--- a/web/app/routes/_index.tsx
+++ b/web/app/routes/_index.tsx
@@ -292,6 +292,7 @@ const LiveDemoPreview = () => {
className='relative h-auto w-full'
width={2328}
height={1666}
+ // eslint-disable-next-line react/no-unknown-property
fetchPriority='high'
alt='Swetrix Analytics dashboard'
/>
diff --git a/web/app/routes/tools._index.tsx b/web/app/routes/tools._index.tsx
index a0003918b..7ff7ef966 100644
--- a/web/app/routes/tools._index.tsx
+++ b/web/app/routes/tools._index.tsx
@@ -34,7 +34,7 @@ export default function Tools() {
<Text as='h1' size='4xl' weight='bold' tracking='tight'>
Free Marketing Tools
</Text>
- <Text as='p' size='lg' colour='muted' className='mt-4'>
+ <Text as='p' size='lg' colour='secondary' className='mt-4'>
Professional marketing calculators and generators to optimize your
campaigns, track performance, and maximize ROI. No sign-up required.
</Text>
@@ -48,10 +48,10 @@ export default function Tools() {
<Link
key={tool.id}
to={tool.href}
- className='group relative flex flex-col justify-between rounded-lg bg-white p-6 ring-1 ring-gray-200 transition-shadow hover:ring-gray-300 dark:bg-slate-950 dark:ring-slate-800 dark:hover:bg-slate-900 dark:hover:ring-slate-700'
+ className='group relative flex flex-col justify-between rounded-lg bg-white p-6 ring-1 ring-gray-200 transition-shadow hover:ring-gray-300 dark:bg-slate-950 dark:ring-slate-900 dark:hover:bg-slate-900 dark:hover:ring-slate-700'
>
<div className='flex items-start gap-4'>
- <div className='flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gray-100 dark:bg-slate-700'>
+ <div className='flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gray-100 dark:bg-slate-800'>
<Icon className='h-5 w-5 text-gray-600 dark:text-gray-300' />
</div>
<div className='min-w-0 flex-1'>
diff --git a/web/app/routes/tools.ab-test-calculator.tsx b/web/app/routes/tools.ab-test-calculator.tsx
index e1a72803e..b5d5fc25b 100644
--- a/web/app/routes/tools.ab-test-calculator.tsx
+++ b/web/app/routes/tools.ab-test-calculator.tsx
@@ -1,5 +1,4 @@
import {
- CaretDownIcon,
CheckCircleIcon,
WarningCircleIcon,
ChartLineUpIcon,
@@ -13,7 +12,9 @@ import { DitchGoogle } from '~/components/marketing/DitchGoogle'
import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import Input from '~/ui/Input'
+import Select from '~/ui/Select'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -196,7 +197,7 @@ export default function ABTestCalculator() {
<div className='space-y-8 lg:col-span-2'>
<div className='grid gap-6 md:grid-cols-2'>
{/* Control Group */}
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-4 text-xl font-semibold text-gray-900 dark:text-white'>
Control (Variant A)
</h2>
@@ -239,7 +240,7 @@ export default function ABTestCalculator() {
</div>
{/* Variant Group */}
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-4 text-xl font-semibold text-gray-900 dark:text-white'>
Variant (Variant B)
</h2>
@@ -282,28 +283,34 @@ export default function ABTestCalculator() {
</div>
</div>
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
- <label className='mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300'>
- Confidence Level
- </label>
- <select
- className='block w-full rounded-md border-gray-300 py-2 pr-10 pl-3 text-base focus:border-indigo-500 focus:ring-indigo-500 focus:outline-none sm:text-sm dark:border-gray-600 dark:bg-slate-700 dark:text-white'
- value={confidenceLevel}
- onChange={(e) =>
- setConfidenceLevel(parseFloat(e.target.value))
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
+ <Select
+ label='Confidence Level'
+ items={[0.9, 0.95, 0.99]}
+ selectedItem={confidenceLevel}
+ title={
+ confidenceLevel === 0.9
+ ? '90% (More false positives)'
+ : confidenceLevel === 0.95
+ ? '95% (Standard, recommended)'
+ : '99% (Highly rigorous)'
}
- >
- <option value={0.9}>90% (More false positives)</option>
- <option value={0.95}>95% (Standard, recommended)</option>
- <option value={0.99}>99% (Highly rigorous)</option>
- </select>
+ onSelect={(val) => setConfidenceLevel(val)}
+ labelExtractor={(val) =>
+ val === 0.9
+ ? '90% (More false positives)'
+ : val === 0.95
+ ? '95% (Standard, recommended)'
+ : '99% (Highly rigorous)'
+ }
+ />
</div>
</div>
{/* Results Section */}
<div className='lg:col-span-1'>
<div className='sticky top-8 space-y-6'>
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
Test Results
</h3>
@@ -475,49 +482,9 @@ export default function ABTestCalculator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.ad-cost-calculator.tsx b/web/app/routes/tools.ad-cost-calculator.tsx
index 97ef817a2..6c8646d26 100644
--- a/web/app/routes/tools.ad-cost-calculator.tsx
+++ b/web/app/routes/tools.ad-cost-calculator.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, CurrencyDollarIcon } from '@phosphor-icons/react'
+import { CurrencyDollarIcon } from '@phosphor-icons/react'
import { useState, useEffect } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
@@ -9,6 +9,7 @@ import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -131,7 +132,7 @@ export default function AdCostCalculator() {
<div className='mt-12 grid gap-8 lg:grid-cols-3'>
{/* Input Section */}
<div className='lg:col-span-2'>
- <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
Campaign Data
</h2>
@@ -215,7 +216,7 @@ export default function AdCostCalculator() {
{/* Results Section */}
<div className='lg:col-span-1'>
<div className='sticky top-8 space-y-6'>
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
Cost Analysis
</h3>
@@ -360,49 +361,9 @@ export default function AdCostCalculator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.ctr-calculator.tsx b/web/app/routes/tools.ctr-calculator.tsx
index 0e7a92e0e..33a1340e7 100644
--- a/web/app/routes/tools.ctr-calculator.tsx
+++ b/web/app/routes/tools.ctr-calculator.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, TrendUpIcon } from '@phosphor-icons/react'
+import { TrendUpIcon } from '@phosphor-icons/react'
import { useState } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
@@ -9,6 +9,7 @@ import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
+import { FAQ } from '~/ui/FAQ'
import { Text } from '~/ui/Text'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -158,7 +159,7 @@ export default function CTRCalculator() {
performance instantly
</Text>
- <div className='mt-12 rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='mt-12 rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='space-y-6'>
<div>
<h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
@@ -372,49 +373,9 @@ export default function CTRCalculator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.ip-lookup.tsx b/web/app/routes/tools.ip-lookup.tsx
index 3d9219b69..082ef3159 100644
--- a/web/app/routes/tools.ip-lookup.tsx
+++ b/web/app/routes/tools.ip-lookup.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, MagnifyingGlassIcon } from '@phosphor-icons/react'
+import { MagnifyingGlassIcon } from '@phosphor-icons/react'
import { useState, useEffect } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect, useFetcher, useLoaderData } from 'react-router'
@@ -13,6 +13,7 @@ import Button from '~/ui/Button'
import Flag from '~/ui/Flag'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Spin from '~/ui/icons/Spin'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -311,7 +312,7 @@ export default function IpLookup() {
{data && (
<div className='mt-6 space-y-8'>
- <section className='overflow-hidden rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <section className='overflow-hidden rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='mb-6 flex items-start gap-4'>
{data.country && (
<Flag
@@ -579,45 +580,10 @@ export default function IpLookup() {
</Text>
<div className='space-y-3'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-slate-700 dark:bg-slate-800'
- >
- <summary className='flex cursor-pointer items-center justify-between px-5 py-4 text-left'>
- <Text weight='medium'>{item.question}</Text>
- <CaretDownIcon className='h-5 w-5 shrink-0 text-gray-400 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-5 py-4 dark:border-slate-700'>
- <Text as='p' colour='muted'>
- {item.answer}
- </Text>
- </div>
- </details>
- ))}
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
</section>
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.ltv-calculator.tsx b/web/app/routes/tools.ltv-calculator.tsx
index 38717807d..144a76357 100644
--- a/web/app/routes/tools.ltv-calculator.tsx
+++ b/web/app/routes/tools.ltv-calculator.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, ChartLineUpIcon } from '@phosphor-icons/react'
+import { ChartLineUpIcon } from '@phosphor-icons/react'
import { useState, useEffect } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
@@ -8,6 +8,7 @@ import { DitchGoogle } from '~/components/marketing/DitchGoogle'
import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import Input from '~/ui/Input'
+import { FAQ } from '~/ui/FAQ'
import { Text } from '~/ui/Text'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -141,7 +142,7 @@ export default function LTVCalculator() {
<div className='mt-12 grid gap-8 lg:grid-cols-3'>
{/* Input Section */}
<div className='lg:col-span-2'>
- <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
Business Metrics
</h2>
@@ -245,7 +246,7 @@ export default function LTVCalculator() {
{/* Results Section */}
<div className='lg:col-span-1'>
<div className='sticky top-8 space-y-6'>
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
LTV Results
</h3>
@@ -364,49 +365,9 @@ export default function LTVCalculator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.meta-tags-generator.tsx b/web/app/routes/tools.meta-tags-generator.tsx
index 8c39573aa..944a74dd1 100644
--- a/web/app/routes/tools.meta-tags-generator.tsx
+++ b/web/app/routes/tools.meta-tags-generator.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, CodeIcon } from '@phosphor-icons/react'
+import { CodeIcon } from '@phosphor-icons/react'
import { useState } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
@@ -7,11 +7,11 @@ import type { SitemapFunction } from 'remix-sitemap'
import { DitchGoogle } from '~/components/marketing/DitchGoogle'
import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
-import Button from '~/ui/Button'
import Input from '~/ui/Input'
import Textarea from '~/ui/Textarea'
import CodeBlock from '~/ui/CodeBlock'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -116,13 +116,13 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
<Text as='h1' size='4xl' weight='bold' tracking='tight'>
Meta Tags & Open Graph Generator
</Text>
- <Text as='p' size='lg' colour='muted' className='mt-4'>
+ <Text as='p' size='lg' colour='secondary' className='mt-4'>
Create perfect SEO and social media meta tags for your website.
</Text>
<div className='mt-12 grid gap-8 lg:grid-cols-2'>
{/* Input Section */}
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
Page Information
</h2>
@@ -234,11 +234,11 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</div>
{/* Social Preview section (Simplified) */}
- <div className='mt-8 rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='mt-8 rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
Social Preview Example (Twitter/X)
</h2>
- <div className='mx-auto max-w-md overflow-hidden rounded-xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-900'>
+ <div className='mx-auto max-w-md overflow-hidden rounded-xl border border-gray-200 bg-white dark:border-slate-800 dark:bg-slate-900'>
{data.imageUrl ? (
<div className='aspect-[1.91/1] w-full overflow-hidden bg-gray-100 dark:bg-slate-800'>
<img
@@ -266,7 +266,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
<span className='text-gray-400'>No image provided</span>
</div>
)}
- <div className='border-t border-gray-200 p-3 dark:border-gray-700'>
+ <div className='border-t border-gray-200 p-3 dark:border-slate-800'>
<p className='truncate text-sm text-gray-500 dark:text-gray-400'>
{data.url
? new URL(
@@ -287,14 +287,14 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</div>
{/* FAQ Section */}
- <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-700'>
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-800'>
<Text as='h2' size='3xl' weight='bold' tracking='tight'>
Free Meta Tags & Open Graph Generator
</Text>
<Text
as='p'
size='lg'
- colour='muted'
+ colour='secondary'
className='mt-4 leading-relaxed'
>
Ensure your website looks professional when shared on social
@@ -310,7 +310,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
<ul className='mt-3 space-y-2'>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Search Engine Optimization
</Text>{' '}
@@ -319,7 +319,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
</li>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Social Sharing
</Text>{' '}
@@ -329,7 +329,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
</li>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Brand Consistency
</Text>{' '}
@@ -345,7 +345,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
<ul className='mt-3 space-y-2'>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Character Limits
</Text>{' '}
@@ -354,7 +354,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
</li>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Image Sizing
</Text>{' '}
@@ -364,7 +364,7 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
</Text>
</li>
<li>
- <Text colour='muted'>
+ <Text colour='secondary'>
<Text as='span' weight='semibold' colour='inherit'>
Compelling Copy
</Text>{' '}
@@ -382,49 +382,9 @@ ${imageUrl ? `<meta property="twitter:image" content="${imageUrl}" />\n` : ''}${
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.qr-code-generator.tsx b/web/app/routes/tools.qr-code-generator.tsx
index 841867e78..7d643ae5f 100644
--- a/web/app/routes/tools.qr-code-generator.tsx
+++ b/web/app/routes/tools.qr-code-generator.tsx
@@ -1,4 +1,4 @@
-import { CaretDownIcon, DownloadIcon } from '@phosphor-icons/react'
+import { DownloadIcon } from '@phosphor-icons/react'
import { useState } from 'react'
import QRCode from 'react-qr-code'
import type { MetaFunction } from 'react-router'
@@ -12,6 +12,7 @@ import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import Textarea from '~/ui/Textarea'
+import { FAQ } from '~/ui/FAQ'
import { Text } from '~/ui/Text'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -101,7 +102,7 @@ export default function QRCodeGenerator() {
<div className='mt-12 grid gap-8 lg:grid-cols-2'>
{/* Input Section */}
- <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
Configuration
</h2>
@@ -165,7 +166,7 @@ export default function QRCodeGenerator() {
</div>
{/* Preview & Download Section */}
- <div className='flex flex-col items-center rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='flex flex-col items-center rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-6 text-xl font-semibold text-gray-900 dark:text-white'>
Preview
</h3>
@@ -305,49 +306,9 @@ export default function QRCodeGenerator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.robots-txt-generator.tsx b/web/app/routes/tools.robots-txt-generator.tsx
new file mode 100644
index 000000000..c2844a572
--- /dev/null
+++ b/web/app/routes/tools.robots-txt-generator.tsx
@@ -0,0 +1,471 @@
+import {
+ CodeIcon,
+ CopyIcon,
+ CheckIcon,
+ DownloadIcon,
+} from '@phosphor-icons/react'
+import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Button from '~/ui/Button'
+import Input from '~/ui/Input'
+import Select from '~/ui/Select'
+import CodeBlock from '~/ui/CodeBlock'
+import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free Robots.txt Generator - Swetrix'),
+ ...getDescription(
+ 'Create and validate robots.txt files for your website instantly. Control how search engines like Googlebot and Bingbot crawl your site.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What is a robots.txt file?',
+ answer:
+ 'A robots.txt file tells search engine crawlers which URLs the crawler can access on your site. This is used mainly to avoid overloading your site with requests; it is not a mechanism for keeping a web page out of Google. To keep a web page out of Google, block indexing with noindex or password-protect the page.',
+ },
+ {
+ question: 'Where should I put my robots.txt file?',
+ answer:
+ 'The robots.txt file must be placed at the root of your website host to which it applies. For example, to control crawling on all URLs below https://www.example.com/, the robots.txt file must be located at https://www.example.com/robots.txt.',
+ },
+ {
+ question: 'What does "User-agent: *" mean?',
+ answer:
+ 'The asterisk (*) is a wildcard that applies the rule to all web crawlers. So "User-agent: *" means the instructions that follow apply to every bot that visits your site.',
+ },
+ {
+ question: 'Can I have multiple sitemaps in my robots.txt?',
+ answer:
+ 'Yes! You can add as many "Sitemap: [URL]" directives as you need anywhere in your robots.txt file. This helps search engines discover all your XML sitemaps efficiently.',
+ },
+]
+
+type RuleType = 'Allow' | 'Disallow'
+
+interface Rule {
+ type: RuleType
+ path: string
+}
+
+interface AgentGroup {
+ userAgent: string
+ rules: Rule[]
+ crawlDelay?: string
+}
+
+export default function RobotsTxtGenerator() {
+ const [copied, setCopied] = useState(false)
+
+ const [agentGroups, setAgentGroups] = useState<AgentGroup[]>([
+ {
+ userAgent: '*',
+ rules: [
+ { type: 'Disallow', path: '/admin/' },
+ { type: 'Disallow', path: '/private/' },
+ ],
+ crawlDelay: '',
+ },
+ ])
+
+ const [sitemapUrl, setSitemapUrl] = useState(
+ 'https://example.com/sitemap.xml',
+ )
+
+ const COMMON_AGENTS = [
+ { value: '*', label: '* (All Crawlers)' },
+ { value: 'Googlebot', label: 'Googlebot' },
+ { value: 'Googlebot-Image', label: 'Googlebot-Image' },
+ { value: 'Bingbot', label: 'Bingbot' },
+ { value: 'Slurp', label: 'Slurp (Yahoo)' },
+ { value: 'DuckDuckBot', label: 'DuckDuckBot' },
+ { value: 'Baiduspider', label: 'Baiduspider' },
+ { value: 'YandexBot', label: 'YandexBot' },
+ { value: 'GPTBot', label: 'GPTBot (OpenAI)' },
+ { value: 'CCBot', label: 'CCBot (Common Crawl)' },
+ ]
+
+ const generateRobotsTxt = () => {
+ let output = ''
+
+ agentGroups.forEach((group, index) => {
+ if (index > 0) output += '\n'
+ output += `User-agent: ${group.userAgent}\n`
+
+ if (group.crawlDelay) {
+ output += `Crawl-delay: ${group.crawlDelay}\n`
+ }
+
+ if (group.rules.length === 0) {
+ output += 'Allow: /\n'
+ } else {
+ group.rules.forEach((rule) => {
+ if (rule.path) {
+ output += `${rule.type}: ${rule.path}\n`
+ }
+ })
+ }
+ })
+
+ if (sitemapUrl) {
+ output += `\nSitemap: ${sitemapUrl}\n`
+ }
+
+ return output
+ }
+
+ const generatedText = generateRobotsTxt()
+
+ const handleCopy = () => {
+ navigator.clipboard.writeText(generatedText)
+ setCopied(true)
+ setTimeout(() => setCopied(false), 2000)
+ }
+
+ const handleDownload = () => {
+ const blob = new Blob([generatedText], { type: 'text/plain' })
+ const url = URL.createObjectURL(blob)
+ const a = document.createElement('a')
+ a.href = url
+ a.download = 'robots.txt'
+ document.body.appendChild(a)
+ a.click()
+ document.body.removeChild(a)
+ URL.revokeObjectURL(url)
+ }
+
+ const addAgentGroup = () => {
+ setAgentGroups([
+ ...agentGroups,
+ { userAgent: '', rules: [{ type: 'Disallow', path: '' }] },
+ ])
+ }
+
+ const updateAgentGroup = (
+ index: number,
+ field: keyof AgentGroup,
+ value: any,
+ ) => {
+ const newGroups = [...agentGroups]
+ newGroups[index] = { ...newGroups[index], [field]: value }
+ setAgentGroups(newGroups)
+ }
+
+ const removeAgentGroup = (index: number) => {
+ setAgentGroups(agentGroups.filter((_, i) => i !== index))
+ }
+
+ const addRule = (groupIndex: number) => {
+ const newGroups = [...agentGroups]
+ newGroups[groupIndex].rules.push({ type: 'Disallow', path: '' })
+ setAgentGroups(newGroups)
+ }
+
+ const updateRule = (
+ groupIndex: number,
+ ruleIndex: number,
+ field: keyof Rule,
+ value: string,
+ ) => {
+ const newGroups = [...agentGroups]
+ newGroups[groupIndex].rules[ruleIndex] = {
+ ...newGroups[groupIndex].rules[ruleIndex],
+ [field]: value,
+ }
+ setAgentGroups(newGroups)
+ }
+
+ const removeRule = (groupIndex: number, ruleIndex: number) => {
+ const newGroups = [...agentGroups]
+ newGroups[groupIndex].rules = newGroups[groupIndex].rules.filter(
+ (_, i) => i !== ruleIndex,
+ )
+ setAgentGroups(newGroups)
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ Robots.txt Generator
+ </Text>
+ <Text as='p' size='lg' colour='secondary' className='mt-4'>
+ Easily generate a robots.txt file to control how search engines
+ crawl your website.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-2'>
+ {/* Input Section */}
+ <div className='space-y-6'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
+ <h2 className='mb-4 text-xl font-semibold text-gray-900 dark:text-white'>
+ Global Settings
+ </h2>
+ <Input
+ type='url'
+ label='Sitemap URL'
+ placeholder='https://example.com/sitemap.xml'
+ value={sitemapUrl}
+ onChange={(e) => setSitemapUrl(e.target.value)}
+ className='w-full'
+ />
+ </div>
+
+ {agentGroups.map((group, groupIndex) => (
+ <div
+ key={groupIndex}
+ className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-900'
+ >
+ <div className='mb-4 flex items-center justify-between'>
+ <h2 className='text-xl font-semibold text-gray-900 dark:text-white'>
+ Crawler Rules {groupIndex + 1}
+ </h2>
+ {agentGroups.length > 1 && (
+ <button
+ type='button'
+ onClick={() => removeAgentGroup(groupIndex)}
+ className='text-sm text-red-500 hover:text-red-600'
+ >
+ Remove Group
+ </button>
+ )}
+ </div>
+
+ <div className='space-y-4'>
+ <div className='grid grid-cols-2 gap-4'>
+ <div className='col-span-2 sm:col-span-1'>
+ <Select
+ label='User Agent'
+ items={COMMON_AGENTS}
+ title={
+ COMMON_AGENTS.find(
+ (a) => a.value === group.userAgent,
+ )?.label || 'Select preset...'
+ }
+ selectedItem={
+ COMMON_AGENTS.find(
+ (a) => a.value === group.userAgent,
+ ) || undefined
+ }
+ onSelect={(agent) => {
+ updateAgentGroup(
+ groupIndex,
+ 'userAgent',
+ agent.value,
+ )
+ }}
+ labelExtractor={(agent) => agent.label}
+ keyExtractor={(agent) => agent.value}
+ />
+ </div>
+ <div className='col-span-2 sm:col-span-1'>
+ <Input
+ type='text'
+ label='Custom / Manual Input'
+ placeholder='CustomBot'
+ value={group.userAgent}
+ onChange={(e) =>
+ updateAgentGroup(
+ groupIndex,
+ 'userAgent',
+ e.target.value,
+ )
+ }
+ className='w-full'
+ />
+ </div>
+ </div>
+
+ <Input
+ type='number'
+ label='Crawl Delay (seconds)'
+ placeholder='Leave empty for default'
+ value={group.crawlDelay}
+ onChange={(e) =>
+ updateAgentGroup(
+ groupIndex,
+ 'crawlDelay',
+ e.target.value,
+ )
+ }
+ className='w-full'
+ min={1}
+ />
+
+ <div className='space-y-2 pt-2'>
+ <span className='block text-sm font-medium text-gray-700 dark:text-gray-300'>
+ Directory Rules
+ </span>
+ {group.rules.map((rule, ruleIndex) => (
+ <div
+ key={ruleIndex}
+ className='flex items-center gap-2'
+ >
+ <div className='w-full'>
+ <Select
+ items={['Disallow', 'Allow']}
+ selectedItem={rule.type}
+ title={rule.type}
+ onSelect={(val) =>
+ updateRule(
+ groupIndex,
+ ruleIndex,
+ 'type',
+ val as RuleType,
+ )
+ }
+ labelExtractor={(val) => val}
+ buttonClassName='!py-2 !px-3'
+ />
+ </div>
+ <div className='flex-1'>
+ <Input
+ type='text'
+ placeholder='/path-to-block/'
+ value={rule.path}
+ onChange={(e) =>
+ updateRule(
+ groupIndex,
+ ruleIndex,
+ 'path',
+ e.target.value,
+ )
+ }
+ className='w-full'
+ />
+ </div>
+ <button
+ type='button'
+ onClick={() => removeRule(groupIndex, ruleIndex)}
+ className='shrink-0 rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 dark:hover:bg-slate-700 dark:hover:text-gray-300'
+ >
+ &times;
+ </button>
+ </div>
+ ))}
+ <Button
+ type='button'
+ secondary
+ onClick={() => addRule(groupIndex)}
+ className='mt-2 w-full text-sm text-gray-900 dark:border-slate-700 dark:bg-slate-800 dark:text-gray-100 dark:hover:bg-slate-700'
+ >
+ + Add path rule
+ </Button>
+ </div>
+ </div>
+ </div>
+ ))}
+
+ <Button
+ type='button'
+ primary
+ onClick={addAgentGroup}
+ className='w-full'
+ >
+ + Add User Agent Group
+ </Button>
+ </div>
+
+ {/* Code Output Section */}
+ <div className='flex h-[600px] flex-col rounded-xl bg-slate-900 p-6 ring-1 ring-slate-800 lg:sticky lg:top-8'>
+ <div className='mb-4 flex flex-wrap items-center justify-between gap-3'>
+ <div className='flex items-center gap-2'>
+ <CodeIcon className='h-5 w-5 text-gray-400' />
+ <h3 className='text-lg font-medium text-white'>
+ robots.txt
+ </h3>
+ </div>
+ <div className='flex items-center gap-2'>
+ <Button
+ secondary
+ onClick={handleCopy}
+ className='h-auto! border-slate-700! bg-slate-800! px-3! py-1.5! text-gray-300! hover:bg-slate-700! hover:text-white!'
+ >
+ {copied ? (
+ <CheckIcon className='mr-1.5 h-4 w-4 text-emerald-400' />
+ ) : (
+ <CopyIcon className='mr-1.5 h-4 w-4' />
+ )}
+ {copied ? 'Copied' : 'Copy'}
+ </Button>
+ <Button
+ secondary
+ onClick={handleDownload}
+ className='h-auto! border-slate-700! bg-slate-800! px-3! py-1.5! text-gray-300! hover:bg-slate-700! hover:text-white!'
+ >
+ <DownloadIcon className='mr-1.5 h-4 w-4' />
+ Download
+ </Button>
+ </div>
+ </div>
+
+ <div className='flex-1 overflow-auto rounded-lg'>
+ <CodeBlock code={generatedText} />
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-800'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ About Robots.txt
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='secondary'
+ className='mt-4 leading-relaxed'
+ >
+ A robots.txt file gives instructions about your site to web
+ robots; this is called The Robots Exclusion Protocol.
+ </Text>
+
+ <div className='mt-12'>
+ <h3 className='mb-8 text-2xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h3>
+
+ <FAQ items={FAQ_ITEMS} withStructuredData />
+ </div>
+ </section>
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.roi-calculator.tsx b/web/app/routes/tools.roi-calculator.tsx
index e26888f43..527e21885 100644
--- a/web/app/routes/tools.roi-calculator.tsx
+++ b/web/app/routes/tools.roi-calculator.tsx
@@ -2,7 +2,6 @@ import {
TrendUpIcon,
CurrencyDollarIcon,
ShoppingCartIcon,
- CaretDownIcon,
} from '@phosphor-icons/react'
import { useState, useEffect } from 'react'
import type { MetaFunction } from 'react-router'
@@ -14,6 +13,7 @@ import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
import { isSelfhosted } from '~/lib/constants'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -231,7 +231,7 @@ export default function ROICalculator() {
<div className='mt-12 grid gap-8 lg:grid-cols-3'>
{/* Input Section */}
<div className='lg:col-span-2'>
- <div className='rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
Campaign Metrics
</h2>
@@ -383,7 +383,7 @@ export default function ROICalculator() {
<div className='lg:col-span-1'>
<div className='sticky top-8 space-y-6'>
{/* Primary Metrics */}
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
Key Performance Metrics
</h3>
@@ -434,7 +434,7 @@ export default function ROICalculator() {
</div>
{/* Secondary Metrics */}
- <div className='rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<h3 className='mb-4 text-lg font-semibold text-gray-900 dark:text-white'>
Detailed Metrics
</h3>
@@ -604,49 +604,9 @@ export default function ROICalculator() {
Frequently Asked Questions
</h2>
- <div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
- </div>
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.schema-markup-generator.tsx b/web/app/routes/tools.schema-markup-generator.tsx
new file mode 100644
index 000000000..317e97c20
--- /dev/null
+++ b/web/app/routes/tools.schema-markup-generator.tsx
@@ -0,0 +1,517 @@
+import { CodeIcon, CopyIcon, CheckIcon } from '@phosphor-icons/react'
+import { useState } from 'react'
+import type { MetaFunction } from 'react-router'
+import { redirect } from 'react-router'
+import type { SitemapFunction } from 'remix-sitemap'
+
+import { DitchGoogle } from '~/components/marketing/DitchGoogle'
+import { ToolsNav, ToolsNavMobile } from '~/components/ToolsNav'
+import { isSelfhosted } from '~/lib/constants'
+import Button from '~/ui/Button'
+import Input from '~/ui/Input'
+import Select from '~/ui/Select'
+import Textarea from '~/ui/Textarea'
+import CodeBlock from '~/ui/CodeBlock'
+import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
+import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
+
+export const meta: MetaFunction = () => {
+ return [
+ ...getTitle('Free Schema Markup (JSON-LD) Generator - Swetrix'),
+ ...getDescription(
+ 'Generate valid JSON-LD schema markup for your website to get rich snippets in Google search results. Supports Article, FAQ, Local Business, and more.',
+ ),
+ ...getPreviewImage(),
+ ]
+}
+
+export const sitemap: SitemapFunction = () => ({
+ priority: 0.8,
+ exclude: isSelfhosted,
+})
+
+export async function loader() {
+ if (isSelfhosted) {
+ return redirect('/login', 302)
+ }
+
+ return null
+}
+
+const FAQ_ITEMS = [
+ {
+ question: 'What is Schema Markup?',
+ answer:
+ 'Schema markup (also known as structured data) is a standardized format for providing information about a page and classifying the page content. It helps search engines like Google understand the context of your page, which can lead to rich snippets in search results.',
+ },
+ {
+ question: 'What is JSON-LD?',
+ answer:
+ 'JSON-LD (JavaScript Object Notation for Linked Data) is a lightweight Linked Data format. It is the format recommended by Google for implementing schema markup because it is easy to read, write, and maintain compared to other formats like Microdata or RDFa.',
+ },
+ {
+ question: 'How do I add JSON-LD to my website?',
+ answer:
+ 'Once you generate the JSON-LD code using this tool, simply copy and paste it into the <head> or <body> section of the HTML of the page you want the structured data to apply to.',
+ },
+ {
+ question: 'Will schema markup guarantee rich snippets?',
+ answer:
+ 'No, adding schema markup does not guarantee that search engines will display rich snippets for your pages. However, it is a prerequisite. Google decides when to show rich snippets based on various factors including relevance and site quality.',
+ },
+]
+
+type SchemaType = 'Article' | 'FAQPage' | 'Organization'
+
+export default function SchemaMarkupGenerator() {
+ const [schemaType, setSchemaType] = useState<SchemaType>('Article')
+ const [copied, setCopied] = useState(false)
+
+ // Article state
+ const [articleData, setArticleData] = useState({
+ type: 'Article',
+ headline: 'Understanding Web Analytics in 2026',
+ image: 'https://example.com/analytics-banner.jpg',
+ authorType: 'Person',
+ authorName: 'John Doe',
+ publisherName: 'Swetrix',
+ publisherLogo: 'https://swetrix.com/logo.png',
+ datePublished: new Date().toISOString().slice(0, 16),
+ dateModified: new Date().toISOString().slice(0, 16),
+ })
+
+ // Organization state
+ const [orgData, setOrgData] = useState({
+ name: 'Swetrix',
+ url: 'https://swetrix.com',
+ logo: 'https://swetrix.com/logo.png',
+ description: 'Privacy-focused, cookie-less web analytics platform.',
+ })
+
+ // FAQ state
+ const [faqData, setFaqData] = useState([
+ {
+ question: 'Is Swetrix GDPR compliant?',
+ answer:
+ 'Yes, Swetrix is built from the ground up to be fully GDPR, CCPA, and PECR compliant. We do not use cookies or collect any personal data.',
+ },
+ ])
+
+ const generateJSONLD = () => {
+ let schema: any = {
+ '@context': 'https://schema.org',
+ }
+
+ if (schemaType === 'Article') {
+ schema['@type'] = articleData.type
+ if (articleData.headline) schema.headline = articleData.headline
+ if (articleData.image) schema.image = [articleData.image]
+ if (articleData.datePublished)
+ schema.datePublished = new Date(articleData.datePublished).toISOString()
+ if (articleData.dateModified)
+ schema.dateModified = new Date(articleData.dateModified).toISOString()
+
+ if (articleData.authorName) {
+ schema.author = [
+ {
+ '@type': articleData.authorType,
+ name: articleData.authorName,
+ },
+ ]
+ }
+
+ if (articleData.publisherName) {
+ schema.publisher = {
+ '@type': 'Organization',
+ name: articleData.publisherName,
+ ...(articleData.publisherLogo && {
+ logo: {
+ '@type': 'ImageObject',
+ url: articleData.publisherLogo,
+ },
+ }),
+ }
+ }
+ } else if (schemaType === 'Organization') {
+ schema['@type'] = 'Organization'
+ if (orgData.name) schema.name = orgData.name
+ if (orgData.url) schema.url = orgData.url
+ if (orgData.logo) schema.logo = orgData.logo
+ if (orgData.description) schema.description = orgData.description
+ } else if (schemaType === 'FAQPage') {
+ schema['@type'] = 'FAQPage'
+ schema.mainEntity = faqData
+ .filter((q) => q.question && q.answer)
+ .map((q) => ({
+ '@type': 'Question',
+ name: q.question,
+ acceptedAnswer: {
+ '@type': 'Answer',
+ text: q.answer,
+ },
+ }))
+ }
+
+ return `<script type="application/ld+json">\n${JSON.stringify(schema, null, 2)}\n</script>`
+ }
+
+ const generatedCode = generateJSONLD()
+
+ const handleCopy = () => {
+ navigator.clipboard.writeText(generatedCode)
+ setCopied(true)
+ setTimeout(() => setCopied(false), 2000)
+ }
+
+ return (
+ <div className='min-h-screen bg-gray-50 dark:bg-slate-950'>
+ <main className='mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8'>
+ <ToolsNavMobile className='mb-6 xl:hidden' />
+
+ <div className='xl:flex xl:items-start xl:gap-8'>
+ <div className='min-w-0 xl:flex-1'>
+ <Text as='h1' size='4xl' weight='bold' tracking='tight'>
+ Schema Markup Generator
+ </Text>
+ <Text as='p' size='lg' colour='secondary' className='mt-4'>
+ Generate valid JSON-LD structured data to improve your SEO and get
+ rich snippets.
+ </Text>
+
+ <div className='mt-12 grid gap-8 lg:grid-cols-2'>
+ {/* Input Section */}
+ <div className='rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
+ <div className='mb-6'>
+ <Select
+ label='Schema Type'
+ selectedItem={schemaType}
+ title={
+ schemaType === 'Article'
+ ? 'Article / Blog Post'
+ : schemaType === 'FAQPage'
+ ? 'FAQ Page'
+ : 'Organization / Brand'
+ }
+ onSelect={(val) => setSchemaType(val as SchemaType)}
+ labelExtractor={(val) =>
+ val === 'Article'
+ ? 'Article / Blog Post'
+ : val === 'FAQPage'
+ ? 'FAQ Page'
+ : 'Organization / Brand'
+ }
+ items={['Article', 'FAQPage', 'Organization']}
+ />
+ </div>
+
+ <div className='space-y-4'>
+ {schemaType === 'Article' && (
+ <>
+ <div className='grid grid-cols-2 gap-4'>
+ <Select
+ label='Article Type'
+ selectedItem={articleData.type}
+ title={
+ articleData.type === 'NewsArticle'
+ ? 'News Article'
+ : articleData.type === 'BlogPosting'
+ ? 'Blog Post'
+ : 'Article'
+ }
+ onSelect={(val) =>
+ setArticleData((p) => ({
+ ...p,
+ type: val as string,
+ }))
+ }
+ labelExtractor={(val) =>
+ val === 'NewsArticle'
+ ? 'News Article'
+ : val === 'BlogPosting'
+ ? 'Blog Post'
+ : 'Article'
+ }
+ items={['Article', 'NewsArticle', 'BlogPosting']}
+ />
+ <Input
+ type='text'
+ label='Headline'
+ value={articleData.headline}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ headline: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ </div>
+
+ <Input
+ type='text'
+ label='Image URL'
+ value={articleData.image}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ image: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+
+ <div className='grid grid-cols-2 gap-4'>
+ <Select
+ label='Author Type'
+ selectedItem={articleData.authorType}
+ title={articleData.authorType}
+ onSelect={(val) =>
+ setArticleData((p) => ({
+ ...p,
+ authorType: val as string,
+ }))
+ }
+ items={['Person', 'Organization']}
+ />
+ <Input
+ type='text'
+ label='Author Name'
+ value={articleData.authorName}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ authorName: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ </div>
+
+ <div className='grid grid-cols-2 gap-4'>
+ <Input
+ type='text'
+ label='Publisher Name'
+ value={articleData.publisherName}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ publisherName: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ <Input
+ type='text'
+ label='Publisher Logo URL'
+ value={articleData.publisherLogo}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ publisherLogo: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ </div>
+
+ <div className='grid grid-cols-2 gap-4'>
+ <Input
+ type='datetime-local'
+ label='Date Published'
+ value={articleData.datePublished}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ datePublished: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ <Input
+ type='datetime-local'
+ label='Date Modified'
+ value={articleData.dateModified}
+ onChange={(e) =>
+ setArticleData((p) => ({
+ ...p,
+ dateModified: e.target.value,
+ }))
+ }
+ className='w-full'
+ />
+ </div>
+ </>
+ )}
+
+ {schemaType === 'Organization' && (
+ <>
+ <Input
+ type='text'
+ label='Organization Name'
+ value={orgData.name}
+ onChange={(e) =>
+ setOrgData((p) => ({ ...p, name: e.target.value }))
+ }
+ className='w-full'
+ />
+ <Input
+ type='url'
+ label='Website URL'
+ value={orgData.url}
+ onChange={(e) =>
+ setOrgData((p) => ({ ...p, url: e.target.value }))
+ }
+ className='w-full'
+ />
+ <Input
+ type='url'
+ label='Logo URL'
+ value={orgData.logo}
+ onChange={(e) =>
+ setOrgData((p) => ({ ...p, logo: e.target.value }))
+ }
+ className='w-full'
+ />
+ <Textarea
+ label='Description'
+ value={orgData.description}
+ onChange={(e) =>
+ setOrgData((p) => ({
+ ...p,
+ description: e.target.value,
+ }))
+ }
+ rows={3}
+ />
+ </>
+ )}
+
+ {schemaType === 'FAQPage' && (
+ <div className='space-y-6'>
+ {faqData.map((faq, index) => (
+ <div
+ key={index}
+ className='space-y-4 rounded-lg border border-gray-200 p-4 dark:border-slate-700'
+ >
+ <div className='flex items-center justify-between'>
+ <Text weight='semibold'>Question {index + 1}</Text>
+ {faqData.length > 1 && (
+ <button
+ type='button'
+ onClick={() =>
+ setFaqData((p) =>
+ p.filter((_, i) => i !== index),
+ )
+ }
+ className='text-sm text-red-500 hover:text-red-600'
+ >
+ Remove
+ </button>
+ )}
+ </div>
+ <Input
+ type='text'
+ label='Question'
+ value={faq.question}
+ onChange={(e) => {
+ const newData = [...faqData]
+ newData[index].question = e.target.value
+ setFaqData(newData)
+ }}
+ className='w-full'
+ />
+ <Textarea
+ label='Answer'
+ value={faq.answer}
+ onChange={(e) => {
+ const newData = [...faqData]
+ newData[index].answer = e.target.value
+ setFaqData(newData)
+ }}
+ rows={2}
+ />
+ </div>
+ ))}
+ <Button
+ type='button'
+ secondary
+ onClick={() =>
+ setFaqData((p) => [
+ ...p,
+ { question: '', answer: '' },
+ ])
+ }
+ className='w-full text-gray-900 dark:border-slate-700 dark:bg-slate-800 dark:text-gray-100 dark:hover:bg-slate-700'
+ >
+ Add Question
+ </Button>
+ </div>
+ )}
+ </div>
+ </div>
+
+ {/* Code Output Section */}
+ <div className='flex h-[600px] flex-col rounded-xl bg-slate-900 p-6 ring-1 ring-slate-800'>
+ <div className='mb-4 flex items-center justify-between'>
+ <div className='flex items-center gap-2'>
+ <CodeIcon className='h-5 w-5 text-gray-400' />
+ <h3 className='text-lg font-medium text-white'>
+ Generated JSON-LD
+ </h3>
+ </div>
+ <Button
+ secondary
+ onClick={handleCopy}
+ className='h-auto! border-slate-700! bg-slate-800! px-3! py-1.5! text-gray-300! hover:bg-slate-700! hover:text-white!'
+ >
+ {copied ? (
+ <CheckIcon className='mr-1.5 h-4 w-4 text-emerald-400' />
+ ) : (
+ <CopyIcon className='mr-1.5 h-4 w-4' />
+ )}
+ {copied ? 'Copied' : 'Copy'}
+ </Button>
+ </div>
+
+ <div className='flex-1 overflow-auto rounded-lg'>
+ <CodeBlock code={generatedCode} />
+ </div>
+ </div>
+ </div>
+
+ {/* FAQ Section */}
+ <section className='mt-20 border-t border-gray-200 pt-16 dark:border-slate-800'>
+ <Text as='h2' size='3xl' weight='bold' tracking='tight'>
+ About Schema Markup
+ </Text>
+ <Text
+ as='p'
+ size='lg'
+ colour='secondary'
+ className='mt-4 leading-relaxed'
+ >
+ Schema markup is code that you put on your website to help the
+ search engines return more informative results for users.
+ </Text>
+
+ <div className='mt-12'>
+ <h3 className='mb-8 text-2xl font-bold text-gray-900 dark:text-white'>
+ Frequently Asked Questions
+ </h3>
+
+ <FAQ items={FAQ_ITEMS} withStructuredData />
+ </div>
+ </section>
+
+ <DitchGoogle />
+ </div>
+
+ <aside className='hidden xl:sticky xl:top-12 xl:block xl:w-64 xl:shrink-0 xl:self-start'>
+ <ToolsNav />
+ </aside>
+ </div>
+ </main>
+ </div>
+ )
+}
diff --git a/web/app/routes/tools.sitemap-validator.tsx b/web/app/routes/tools.sitemap-validator.tsx
index ebcb325f8..6059d9fa6 100644
--- a/web/app/routes/tools.sitemap-validator.tsx
+++ b/web/app/routes/tools.sitemap-validator.tsx
@@ -1,5 +1,4 @@
import {
- CaretDownIcon,
MagnifyingGlassIcon,
CheckCircleIcon,
WarningOctagonIcon,
@@ -18,6 +17,7 @@ import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
export const meta: MetaFunction = () => {
@@ -692,7 +692,7 @@ export default function SitemapValidator() {
{result && (
<div className='mt-8 space-y-6'>
- <section className='overflow-hidden rounded-xl bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <section className='overflow-hidden rounded-lg bg-white p-6 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='mb-6 flex items-center gap-4'>
{result.isValid ? (
<div className='flex h-12 w-12 items-center justify-center rounded-full bg-emerald-100 dark:bg-emerald-900/30'>
@@ -820,7 +820,7 @@ export default function SitemapValidator() {
</section>
{result.urls.length > 0 && (
- <section className='overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <section className='overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='border-b border-gray-200 px-6 py-4 dark:border-slate-700'>
<Text weight='medium'>
URL Preview ({result.urls.length} of {result.urlCount})
@@ -867,7 +867,7 @@ export default function SitemapValidator() {
)}
{result.sitemaps && result.sitemaps.length > 0 && (
- <section className='overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <section className='overflow-hidden rounded-xl bg-white ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='border-b border-gray-200 px-6 py-4 dark:border-slate-700'>
<Text weight='medium'>
Referenced Sitemaps ({result.sitemaps.length})
@@ -1058,45 +1058,10 @@ export default function SitemapValidator() {
</Text>
<div className='space-y-3'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-slate-700 dark:bg-slate-800'
- >
- <summary className='flex cursor-pointer items-center justify-between px-5 py-4 text-left'>
- <Text weight='medium'>{item.question}</Text>
- <CaretDownIcon className='h-5 w-5 shrink-0 text-gray-400 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-5 py-4 dark:border-slate-700'>
- <Text as='p' colour='muted'>
- {item.answer}
- </Text>
- </div>
- </details>
- ))}
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
</section>
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/routes/tools.utm-generator.tsx b/web/app/routes/tools.utm-generator.tsx
index 31a0f01c1..f2533476d 100644
--- a/web/app/routes/tools.utm-generator.tsx
+++ b/web/app/routes/tools.utm-generator.tsx
@@ -1,4 +1,4 @@
-import { CopyIcon, CaretDownIcon } from '@phosphor-icons/react'
+import { CopyIcon } from '@phosphor-icons/react'
import { useState } from 'react'
import type { MetaFunction } from 'react-router'
import { redirect } from 'react-router'
@@ -10,6 +10,7 @@ import { isSelfhosted } from '~/lib/constants'
import Button from '~/ui/Button'
import Input from '~/ui/Input'
import { Text } from '~/ui/Text'
+import { FAQ } from '~/ui/FAQ'
import Tooltip from '~/ui/Tooltip'
import { getDescription, getPreviewImage, getTitle } from '~/utils/seo'
@@ -217,7 +218,7 @@ export default function UTMGenerator() {
marketing campaigns effectively
</Text>
- <div className='mt-12 rounded-xl bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-800 dark:ring-slate-700'>
+ <div className='mt-12 rounded-lg bg-white p-8 ring-1 ring-gray-200 dark:bg-slate-950 dark:ring-slate-800'>
<div className='space-y-6'>
<div>
<h2 className='mb-6 text-2xl font-semibold text-gray-900 dark:text-white'>
@@ -485,48 +486,10 @@ export default function UTMGenerator() {
</h2>
<div className='space-y-4'>
- {FAQ_ITEMS.map((item, index) => (
- <details
- key={index}
- className='group rounded-lg border border-gray-200 bg-white dark:border-gray-700 dark:bg-slate-800'
- >
- <summary className='flex w-full cursor-pointer items-center justify-between px-6 py-4 text-left hover:bg-gray-50 dark:hover:bg-slate-700/50'>
- <h3 className='text-lg font-medium text-gray-900 dark:text-white'>
- {item.question}
- </h3>
- <CaretDownIcon className='h-5 w-5 text-gray-500 transition-transform group-open:rotate-180' />
- </summary>
- <div className='border-t border-gray-200 px-6 py-4 dark:border-gray-700'>
- <p className='text-gray-600 dark:text-gray-400'>
- {item.answer}
- </p>
- </div>
- </details>
- ))}
+ <FAQ items={FAQ_ITEMS} withStructuredData />
</div>
</div>
- {/* FAQ Structured Data */}
- <script
- type='application/ld+json'
- dangerouslySetInnerHTML={{
- __html: JSON.stringify({
- '@context': 'https://schema.org',
- '@type': 'FAQPage',
- mainEntity: FAQ_ITEMS.map((item) => ({
- '@type': 'Question',
- name: item.question,
- acceptedAnswer: {
- '@type': 'Answer',
- text: item.answer,
- },
- })),
- })
- .replace(/</g, '\\u003c')
- .replace(/\u2028|\u2029/g, ''),
- }}
- />
-
<DitchGoogle />
</div>
diff --git a/web/app/utils/routes.ts b/web/app/utils/routes.ts
index fb2e37d08..cdf21e1d5 100644
--- a/web/app/utils/routes.ts
+++ b/web/app/utils/routes.ts
@@ -50,6 +50,8 @@ const routes = Object.freeze({
meta_tags_generator: '/tools/meta-tags-generator',
ad_cost_calculator: '/tools/ad-cost-calculator',
qr_code_generator: '/tools/qr-code-generator',
+ schema_markup_generator: '/tools/schema-markup-generator',
+ robots_txt_generator: '/tools/robots-txt-generator',
// Marketing pages
gaAlternative: '/google-analytics-alternative',