Skip to content

Commit 60b165a

Browse files
committed
Refactor FAQ to server-side rendering for better SEO
Critical SEO Fix: - Move FAQ data from client-side script to server-side frontmatter - Generate Schema.org JSON-LD at build time, not runtime - Ensure search engines always see structured data Benefits: - Search engine crawlers see FAQ schema immediately (no JavaScript required) - Single source of truth for FAQ content in frontmatter - Eliminates fragile DOM parsing logic - No risk of duplicate entries from hardcoded data Implementation: - Define faqEntries array in frontmatter with all Q&A pairs - FAQPageJSONLD.astro now accepts entries prop and renders at build time - FAQ section HTML generated from same faqEntries data using .map() - Supports HTML formatting in answers (links, bold text)
1 parent 8b32d3a commit 60b165a

File tree

2 files changed

+52
-65
lines changed

2 files changed

+52
-65
lines changed

src/pages/defguard-vs-fortinet.astro

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,33 @@ const sections = [
4444
{ id: "bottom-line", title: "The Bottom Line" },
4545
{ id: "faq", title: "FAQ" },
4646
];
47+
48+
const faqEntries = [
49+
{
50+
question: "Why is Defguard a more resilient alternative to Fortinet's VPN solution?",
51+
answer: "Defguard is more resilient due to its modern microservice architecture that separates control and data planes, minimizing the attack surface. Unlike <strong>FortiGate's</strong> monolithic design, which has proven vulnerable to persistent threats like COATHANGER that survive patching, Defguard's open-source, decentralized model is designed to contain threats and prevent deep network compromise."
52+
},
53+
{
54+
question: "What are the benefits of WireGuard® over Fortinet's IPsec/SSL VPN?",
55+
answer: "WireGuard® is a faster, more modern, and less complex protocol than IPsec/SSL VPN. It has a significantly smaller codebase, making it easier to audit and secure. This results in higher performance, lower latency, and a reduced attack surface compared to the legacy protocols used by <strong>Fortinet's VPN solution</strong>, which have a history of critical vulnerabilities."
56+
},
57+
{
58+
question: "How difficult is it to migrate from Fortinet to Defguard?",
59+
answer: "Migration to Defguard is designed to be straightforward. As Defguard is a software-only solution with no hardware dependencies, it can be deployed quickly in any environment using simple one-line installs or infrastructure-as-code tools like Docker and Terraform. This eliminates the complex <strong>FortiGate</strong> hardware setup and <strong>FortiClient EMS</strong> management overhead associated with <strong>Fortinet's VPN solution</strong>."
60+
},
61+
{
62+
question: "Can Defguard integrate with our existing identity provider like Microsoft Entra ID?",
63+
answer: "Yes. Defguard natively integrates with any OpenID Connect (OIDC) compliant identity provider, including Microsoft Entra ID (Azure AD), Okta, Google Workspace, and more. This integration is included out-of-the-box, unlike <strong>Fortinet</strong>, which often requires additional costly components like <strong>FortiAuthenticator</strong> for full SSO capabilities."
64+
},
65+
{
66+
question: "Is Defguard more cost-effective than Fortinet?",
67+
answer: "Yes, for most organizations, Defguard offers a lower Total Cost of Ownership (TCO). Our <a href=\"https://defguard.net/pricing\" target=\"_blank\" rel=\"noopener noreferrer\">pricing is transparent</a> and all-inclusive, covering all features like MFA and SSO integration in a single subscription. <strong>Fortinet's</strong> model often involves numerous hidden costs, including separate licenses for <strong>FortiGate</strong> hardware, <strong>FortiClient</strong> endpoint clients, MFA tokens (FortiToken), and SSO integration (FortiAuthenticator)."
68+
},
69+
{
70+
question: "Why does being open-source make Defguard more secure than a closed-source solution like Fortinet's?",
71+
answer: "Defguard's open-source codebase allows for public scrutiny and independent audits by security experts worldwide. This transparency means vulnerabilities are often found and fixed faster than in a closed-source environment like Fortinet's, where users must blindly trust the vendor. Verifiable security builds a higher level of trust."
72+
}
73+
];
4774
---
4875

4976
<ProductLayout
@@ -57,7 +84,7 @@ const sections = [
5784
>
5885
<OrganizationJSONLD slot="schema" title={title} description={description} url={url} tags={tags} />
5986
<TechArticleJSONLD slot="schema" title={title} description={description} url={url} />
60-
<FAQPageJSONLD slot="schema" />
87+
<FAQPageJSONLD slot="schema" entries={faqEntries} />
6188
<Navigation activeSlug="/defguard-vs-fortinet/" />
6289

6390
<main id="fortinet-comparison" class="with-sidebar-nav">
@@ -399,30 +426,12 @@ const sections = [
399426
<ProductSection padding="small">
400427
<section id="faq">
401428
<h2>Frequently Asked Questions</h2>
402-
<details>
403-
<summary>Why is Defguard a more resilient alternative to Fortinet's VPN solution?</summary>
404-
<p>Defguard is more resilient due to its modern microservice architecture that separates control and data planes, minimizing the attack surface. Unlike <strong>FortiGate's</strong> monolithic design, which has proven vulnerable to persistent threats like COATHANGER that survive patching, Defguard's open-source, decentralized model is designed to contain threats and prevent deep network compromise.</p>
405-
</details>
406-
<details>
407-
<summary>What are the benefits of WireGuard® over Fortinet's IPsec/SSL VPN?</summary>
408-
<p>WireGuard® is a faster, more modern, and less complex protocol than IPsec/SSL VPN. It has a significantly smaller codebase, making it easier to audit and secure. This results in higher performance, lower latency, and a reduced attack surface compared to the legacy protocols used by <strong>Fortinet's VPN solution</strong>, which have a history of critical vulnerabilities.</p>
409-
</details>
410-
<details>
411-
<summary>How difficult is it to migrate from Fortinet to Defguard?</summary>
412-
<p>Migration to Defguard is designed to be straightforward. As Defguard is a software-only solution with no hardware dependencies, it can be deployed quickly in any environment using simple one-line installs or infrastructure-as-code tools like Docker and Terraform. This eliminates the complex <strong>FortiGate</strong> hardware setup and <strong>FortiClient EMS</strong> management overhead associated with <strong>Fortinet's VPN solution</strong>.</p>
413-
</details>
414-
<details>
415-
<summary>Can Defguard integrate with our existing identity provider like Microsoft Entra ID?</summary>
416-
<p>Yes. Defguard natively integrates with any OpenID Connect (OIDC) compliant identity provider, including Microsoft Entra ID (Azure AD), Okta, Google Workspace, and more. This integration is included out-of-the-box, unlike <strong>Fortinet</strong>, which often requires additional costly components like <strong>FortiAuthenticator</strong> for full SSO capabilities.</p>
417-
</details>
418-
<details>
419-
<summary>Is Defguard more cost-effective than Fortinet?</summary>
420-
<p>Yes, for most organizations, Defguard offers a lower Total Cost of Ownership (TCO). Our <a href="https://defguard.net/pricing" target="_blank" rel="noopener noreferrer">pricing is transparent</a> and all-inclusive, covering all features like MFA and SSO integration in a single subscription. <strong>Fortinet's</strong> model often involves numerous hidden costs, including separate licenses for <strong>FortiGate</strong> hardware, <strong>FortiClient</strong> endpoint clients, MFA tokens (FortiToken), and SSO integration (FortiAuthenticator).</p>
421-
</details>
422-
<details>
423-
<summary>Why does being open-source make Defguard more secure than a closed-source solution like Fortinet's?</summary>
424-
<p>Defguard's open-source codebase allows for public scrutiny and independent audits by security experts worldwide. This transparency means vulnerabilities are often found and fixed faster than in a closed-source environment like Fortinet's, where users must blindly trust the vendor. Verifiable security builds a higher level of trust.</p>
425-
</details>
429+
{faqEntries.map((entry) => (
430+
<details>
431+
<summary>{entry.question}</summary>
432+
<p set:html={entry.answer} />
433+
</details>
434+
))}
426435
</section>
427436
</ProductSection>
428437
</div>

src/scripts/FAQPageJSONLD.astro

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,24 @@
11
---
2+
export interface FAQEntry {
3+
question: string;
4+
answer: string;
5+
}
6+
export interface Props {
7+
entries: FAQEntry[];
8+
}
9+
const { entries } = Astro.props;
10+
211
const faqSchema = {
312
"@context": "https://schema.org",
413
"@type": "FAQPage",
5-
"mainEntity": []
14+
"mainEntity": entries.map(entry => ({
15+
"@type": "Question",
16+
"name": entry.question,
17+
"acceptedAnswer": {
18+
"@type": "Answer",
19+
"text": entry.answer
20+
}
21+
}))
622
};
723
---
8-
<script type="application/ld+json" set:html={JSON.stringify(faqSchema)} id="faq-schema-template" />
9-
<script>
10-
document.addEventListener('DOMContentLoaded', () => {
11-
const faqContainer = document.getElementById('faq');
12-
if (!faqContainer) return;
13-
const questions = faqContainer.querySelectorAll('details');
14-
const mainEntity = [];
15-
questions.forEach(q => {
16-
const questionText = q.querySelector('summary')?.innerText;
17-
const answerText = q.querySelector('p')?.innerText;
18-
if (questionText && answerText) {
19-
mainEntity.push({
20-
"@type": "Question",
21-
"name": questionText,
22-
"acceptedAnswer": {
23-
"@type": "Answer",
24-
"text": answerText
25-
}
26-
});
27-
}
28-
});
29-
const schemaScript = document.getElementById('faq-schema-template');
30-
if (schemaScript) {
31-
const currentSchema = JSON.parse(schemaScript.textContent || '{}');
32-
currentSchema.mainEntity = mainEntity;
33-
// Add the new open-source question manually if it's not picked up by the script
34-
mainEntity.push({
35-
"@type": "Question",
36-
"name": "Why does being open-source make Defguard more secure than a closed-source solution like Fortinet's?",
37-
"acceptedAnswer": {
38-
"@type": "Answer",
39-
"text": "Defguard's open-source codebase allows for public scrutiny and independent audits by security experts worldwide. This transparency means vulnerabilities are often found and fixed faster than in a closed-source environment like Fortinet's, where users must blindly trust the vendor. Verifiable security builds a higher level of trust."
40-
}
41-
});
42-
schemaScript.textContent = JSON.stringify(currentSchema);
43-
}
44-
});
45-
</script>
46-
24+
<script type="application/ld+json" set:html={JSON.stringify(faqSchema)} />

0 commit comments

Comments
 (0)