diff --git a/.gitignore b/.gitignore index ab94bdd..76ecc98 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ # production /build +/.open-next/ # misc .DS_Store diff --git a/next.config.mjs b/next.config.mjs index 64065bf..e1b45d2 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -16,6 +16,7 @@ const docSections = [ /** @type {import('next').NextConfig} */ const nextConfig = { + output: 'standalone', images: { remotePatterns: [ { diff --git a/open-next.config.ts b/open-next.config.ts new file mode 100644 index 0000000..ce80d42 --- /dev/null +++ b/open-next.config.ts @@ -0,0 +1,3 @@ +import { defineCloudflareConfig } from '@opennextjs/cloudflare' + +export default defineCloudflareConfig({}) diff --git a/package.json b/package.json index c59682d..f9f8727 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,11 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build", + "build": "next build && opennextjs-cloudflare build --skipNextBuild", + "build:next": "next build", + "build:worker": "opennextjs-cloudflare build --skipNextBuild", + "deploy": "opennextjs-cloudflare build --skipNextBuild && opennextjs-cloudflare deploy", + "upload": "opennextjs-cloudflare build --skipNextBuild && opennextjs-cloudflare upload", "start": "next start", "lint": "next lint", "prepare": "husky install", @@ -40,6 +44,7 @@ "autoprefixer": "^10.4.23", "commitizen": "^4.3.1", "cz-conventional-changelog": "^3.3.0", + "@opennextjs/cloudflare": "^1.8.0", "eslint": "^9.39.2", "eslint-config-next": "16.1.1", "eslint-config-prettier": "^10.1.8", @@ -48,6 +53,7 @@ "lint-staged": "^16.2.7", "postcss": "^8", "prettier": "^3.7.4", + "wrangler": "^4.77.0", "tailwindcss": "^4.1.18", "typescript": "^5" }, diff --git a/src/components/ui/organisms/LegalPage.tsx b/src/components/ui/organisms/LegalPage.tsx index 31129e9..30dbf6d 100644 --- a/src/components/ui/organisms/LegalPage.tsx +++ b/src/components/ui/organisms/LegalPage.tsx @@ -1,20 +1,12 @@ -import fs from 'fs/promises' -import path from 'path' import ReactMarkdown from 'react-markdown' +import { legalPages, type LegalPageFileName } from '@/content/legal-pages' type LegalPageProps = { - fileName: string + fileName: LegalPageFileName } -const contentDir = path.join(process.cwd(), 'src/content') - -async function readMarkdownFile(fileName: string) { - const filePath = path.join(contentDir, fileName) - return fs.readFile(filePath, 'utf8') -} - -export default async function LegalPage({ fileName }: LegalPageProps) { - const markdown = await readMarkdownFile(fileName) +export default function LegalPage({ fileName }: LegalPageProps) { + const markdown = legalPages[fileName] return (
diff --git a/src/content/legal-pages.ts b/src/content/legal-pages.ts new file mode 100644 index 0000000..3183f9d --- /dev/null +++ b/src/content/legal-pages.ts @@ -0,0 +1,150 @@ +export const legalPages = { + 'privacy-policy.md': `# Privacy Policy + +**Effective Date:** March 18, 2026 + +We respect your privacy. This Privacy Policy explains how we collect, use, disclose, and protect information when you visit our website or use our services. + +## Information We Collect + +We may collect the following types of information: + +- **Information you provide directly:** such as your name, email address, company name, or any message you submit through forms. +- **Usage information:** such as pages visited, time spent on pages, device type, browser type, and referring pages. +- **Cookies and similar technologies:** used to improve performance, understand usage, and personalize the experience. + +## How We Use Information + +We may use your information to: + +- provide, maintain, and improve our website and services +- respond to inquiries and support requests +- send important updates or service-related notices +- analyze usage trends and improve performance +- protect against fraud, abuse, and security issues + +## Sharing of Information + +We do not sell your personal information. We may share information only in the following cases: + +- with service providers that help us operate our website +- when required by law, regulation, or legal process +- to protect our rights, users, or systems +- in connection with a business transfer, merger, or acquisition + +## Cookies + +We may use cookies and similar technologies for: + +- essential site functionality +- analytics and performance measurement +- remembering preferences + +You can usually control cookies through your browser settings. + +## Data Retention + +We keep personal information only as long as needed for the purposes described in this policy, unless a longer retention period is required by law. + +## Data Security + +We use reasonable technical and organizational safeguards to protect information. However, no method of transmission or storage is completely secure. + +## Your Choices + +Depending on your location and applicable law, you may have rights to: + +- access your personal information +- correct inaccurate information +- request deletion +- object to or restrict certain processing +- withdraw consent where applicable + +To exercise these rights, contact us using the details below. + +## Third-Party Services + +Our website may contain links to third-party websites or services. We are not responsible for the privacy practices of those third parties. + +## Children’s Privacy + +Our website and services are not intended for children under 13, and we do not knowingly collect personal information from children under 13. + +## Changes to This Policy + +We may update this Privacy Policy from time to time. The updated version will be posted on this page with a revised effective date. + +## Contact Us + +If you have any questions about this Privacy Policy, please contact us at: + +**Email:** privacy@example.com +**Website:** https://example.com`, + 'terms-and-conditions.md': `# Terms & Conditions + +**Effective Date:** March 18, 2026 + +These Terms & Conditions govern your access to and use of our website and services. By using our website, you agree to these terms. + +## Acceptance of Terms + +By accessing or using this website, you confirm that you have read, understood, and agree to be bound by these Terms & Conditions and any additional policies referenced here. + +## Use of the Website + +You agree to use the website only for lawful purposes and in a way that does not: + +- violate any applicable law or regulation +- infringe on the rights of others +- interfere with the security or operation of the website +- attempt unauthorized access to systems or data + +## Intellectual Property + +All content on this website, including text, graphics, logos, images, design elements, and code, is owned by us or our licensors and is protected by applicable intellectual property laws. + +You may not copy, reproduce, modify, distribute, or create derivative works without prior written permission, except where allowed by law. + +## Services and Availability + +We may modify, suspend, or discontinue any part of the website or services at any time without prior notice. We are not responsible if the website is unavailable for any period of time. + +## User Submissions + +If you submit information, feedback, or other materials through our website, you grant us the right to use that submission for operating, improving, and supporting our services, subject to our Privacy Policy. + +You are responsible for ensuring that any content you submit is accurate and does not violate any law or third-party rights. + +## Third-Party Links + +Our website may include links to third-party websites or services. We do not control and are not responsible for those third-party sites, their content, or their practices. + +## Disclaimer + +The website and services are provided on an “as is” and “as available” basis. We make no warranties, express or implied, regarding availability, accuracy, or suitability for a particular purpose. + +## Limitation of Liability + +To the fullest extent permitted by law, we are not liable for any indirect, incidental, special, consequential, or punitive damages arising out of your use of the website or services. + +## Indemnification + +You agree to indemnify and hold us harmless from claims, liabilities, damages, losses, and expenses arising from your misuse of the website or violation of these Terms. + +## Changes to These Terms + +We may update these Terms & Conditions from time to time. Continued use of the website after changes are posted means you accept the updated terms. + +## Governing Law + +These Terms will be governed by and interpreted in accordance with the laws applicable in the jurisdiction where our business is operated, unless otherwise required by law. + +## Contact Us + +If you have any questions about these Terms & Conditions, please contact us at: + +**Email:** legal@example.com +**Website:** https://example.com` +} as const + +export type LegalPageFileName = keyof typeof legalPages diff --git a/wrangler.jsonc b/wrangler.jsonc new file mode 100644 index 0000000..e76ed24 --- /dev/null +++ b/wrangler.jsonc @@ -0,0 +1,23 @@ +{ + "$schema": "node_modules/wrangler/config-schema.json", + "main": ".open-next/worker.js", + "name": "site", + "compatibility_date": "2024-12-30", + "compatibility_flags": [ + "nodejs_compat", + "global_fetch_strictly_public" + ], + "assets": { + "directory": ".open-next/assets", + "binding": "ASSETS" + }, + "services": [ + { + "binding": "WORKER_SELF_REFERENCE", + "service": "site" + } + ], + "images": { + "binding": "IMAGES" + } +}