Skip to content

Commit ae1f9a3

Browse files
committed
Merge branch 'copilot/fix-404-privacy-terms-pages'
2 parents 30c4de4 + c4e876b commit ae1f9a3

4 files changed

Lines changed: 258 additions & 0 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"date-fns": "^4.1.0",
5252
"dotenv": "^16.4.7",
5353
"drizzle-orm": "^0.41.0",
54+
"gray-matter": "^4.0.3",
5455
"immer": "^10.1.1",
5556
"inngest": "^4.1.0",
5657
"jotai": "^2.12.2",

src/app/pages/[slug]/page.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import BaseLayout from "@/components/layout/BaseLayout";
2+
import Markdown from "@/lib/markdown/Markdown";
3+
import { existsSync, readFileSync } from "fs";
4+
import { join } from "path";
5+
import { Metadata } from "next";
6+
import { notFound } from "next/navigation";
7+
import matter from "gray-matter";
8+
9+
interface Props {
10+
params: Promise<{ slug: string }>;
11+
}
12+
13+
interface PageData {
14+
content: string;
15+
title: string;
16+
}
17+
18+
async function getPageData(slug: string): Promise<PageData | null> {
19+
"use cache";
20+
const filePath = join(process.cwd(), "src/content", `${slug}.md`);
21+
if (!existsSync(filePath)) return null;
22+
const raw = readFileSync(filePath, "utf-8");
23+
const { content, data } = matter(raw);
24+
const title =
25+
typeof data.title === "string" && data.title
26+
? data.title
27+
: slug
28+
.split("-")
29+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
30+
.join(" ");
31+
return { content, title };
32+
}
33+
34+
export async function generateMetadata({ params }: Props): Promise<Metadata> {
35+
const { slug } = await params;
36+
const page = await getPageData(slug);
37+
return { title: page?.title ?? slug };
38+
}
39+
40+
const StaticMarkdownPage = async ({ params }: Props) => {
41+
const { slug } = await params;
42+
const page = await getPageData(slug);
43+
44+
if (!page) notFound();
45+
46+
return (
47+
<BaseLayout>
48+
<div className="max-w-3xl mx-auto my-10 px-4">
49+
<div className="content-typography">
50+
<Markdown content={page.content} />
51+
</div>
52+
</div>
53+
</BaseLayout>
54+
);
55+
};
56+
57+
export default StaticMarkdownPage;

src/content/privacy.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
title: Privacy Policy
3+
---
4+
5+
# Privacy Policy
6+
7+
*Last updated: April 2025*
8+
9+
Welcome to **TechDiary** (techdiary.dev). We are committed to protecting your personal information and your right to privacy. This Privacy Policy explains how we collect, use, and safeguard your information when you visit our website.
10+
11+
---
12+
13+
## 1. Information We Collect
14+
15+
We may collect the following types of information:
16+
17+
- **Account information** — When you register via GitHub or WorkOS (Google, etc.), we receive your name, email address, and profile picture from the OAuth provider.
18+
- **Content you create** — Articles, gists, comments, and reactions that you publish on the platform.
19+
- **Usage data** — Pages you visit, features you use, and other interactions with the site, collected via analytics tools (Google Analytics, Hotjar).
20+
- **Cookies** — Small data files placed on your device to remember your preferences and session. See our Cookie section below.
21+
22+
---
23+
24+
## 2. How We Use Your Information
25+
26+
We use the information we collect to:
27+
28+
- Provide, operate, and improve the TechDiary platform.
29+
- Authenticate you and maintain your session.
30+
- Display your public profile, articles, and gists.
31+
- Send transactional notifications (if enabled).
32+
- Analyse usage patterns to improve user experience.
33+
- Comply with legal obligations.
34+
35+
We **do not sell** your personal information to third parties.
36+
37+
---
38+
39+
## 3. Cookies
40+
41+
We use the following types of cookies:
42+
43+
- **Strictly necessary cookies** — Required for authentication and session management. Cannot be disabled.
44+
- **Analytics cookies** — Used by Google Analytics and Hotjar to understand how visitors interact with the site. You can opt out via your browser settings or the cookie consent banner.
45+
46+
You can control cookie preferences through your browser settings. Note that disabling certain cookies may affect site functionality.
47+
48+
---
49+
50+
## 4. Third-Party Services
51+
52+
TechDiary integrates with third-party services that have their own privacy policies:
53+
54+
- **WorkOS** — Authentication (workos.com/privacy)
55+
- **GitHub** — OAuth login (docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement)
56+
- **Google Analytics** — Usage analytics (policies.google.com/privacy)
57+
- **Cloudflare** — Content delivery and storage (cloudflare.com/privacypolicy)
58+
- **MeilSearch** — Search functionality
59+
60+
---
61+
62+
## 5. Data Retention
63+
64+
We retain your account data for as long as your account is active. You may request deletion of your account and associated data by contacting us. Certain data may be retained as required by law.
65+
66+
---
67+
68+
## 6. Security
69+
70+
We implement reasonable technical and organisational measures to protect your information. However, no method of transmission over the internet is 100% secure, and we cannot guarantee absolute security.
71+
72+
---
73+
74+
## 7. Children's Privacy
75+
76+
TechDiary is not directed at children under the age of 13. We do not knowingly collect personal information from children.
77+
78+
---
79+
80+
## 8. Changes to This Policy
81+
82+
We may update this Privacy Policy from time to time. The updated version will be indicated by a revised "Last updated" date at the top of this page. We encourage you to review this policy periodically.
83+
84+
---
85+
86+
## 9. Contact Us
87+
88+
If you have any questions or concerns about this Privacy Policy, please reach out to us at:
89+
90+
**Email:** support@techdiary.dev
91+
**Website:** [techdiary.dev](https://www.techdiary.dev)
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
---
2+
title: Terms and Conditions
3+
---
4+
5+
# Terms and Conditions
6+
7+
*Last updated: April 2025*
8+
9+
Welcome to **TechDiary** (techdiary.dev). By accessing or using our website and services, you agree to be bound by these Terms and Conditions. Please read them carefully before using the platform.
10+
11+
---
12+
13+
## 1. Acceptance of Terms
14+
15+
By creating an account or otherwise using TechDiary, you acknowledge that you have read, understood, and agree to these Terms and Conditions and our [Privacy Policy](/pages/privacy). If you do not agree, please do not use the platform.
16+
17+
---
18+
19+
## 2. Who Can Use TechDiary
20+
21+
TechDiary is intended for users who are at least 13 years of age. By using the platform, you represent that you meet this age requirement.
22+
23+
---
24+
25+
## 3. User Accounts
26+
27+
- You are responsible for maintaining the confidentiality of your account credentials.
28+
- You are responsible for all activity that occurs under your account.
29+
- You must notify us immediately of any unauthorised use of your account.
30+
- We reserve the right to suspend or terminate accounts that violate these Terms.
31+
32+
---
33+
34+
## 4. Content You Publish
35+
36+
When you post articles, gists, comments, or other content on TechDiary:
37+
38+
- You retain ownership of the content you create.
39+
- You grant TechDiary a non-exclusive, royalty-free, worldwide licence to display, distribute, and promote your content on the platform.
40+
- You are solely responsible for ensuring your content does not infringe any third-party rights or violate any laws.
41+
42+
### Prohibited Content
43+
44+
You agree **not** to post content that:
45+
46+
- Is unlawful, defamatory, harassing, abusive, or fraudulent.
47+
- Infringes intellectual property rights of others.
48+
- Contains malware, viruses, or harmful code.
49+
- Is spam or unsolicited promotional material.
50+
- Violates the privacy of others.
51+
52+
TechDiary reserves the right to remove any content that violates these Terms without prior notice.
53+
54+
---
55+
56+
## 5. Intellectual Property
57+
58+
All trademarks, logos, and content owned by TechDiary are protected by intellectual property law. You may not copy, reproduce, distribute, or create derivative works without our explicit written permission.
59+
60+
---
61+
62+
## 6. Open Source
63+
64+
Portions of the TechDiary platform are open source. Please refer to the relevant repository for licence information.
65+
66+
---
67+
68+
## 7. Privacy
69+
70+
Your use of TechDiary is also governed by our [Privacy Policy](/pages/privacy), which is incorporated into these Terms by reference.
71+
72+
---
73+
74+
## 8. Third-Party Links
75+
76+
TechDiary may contain links to third-party websites. We are not responsible for the content or privacy practices of those sites. Accessing third-party links is at your own risk.
77+
78+
---
79+
80+
## 9. Disclaimer of Warranties
81+
82+
TechDiary is provided on an **"as is"** and **"as available"** basis without warranties of any kind, either express or implied. We do not warrant that the service will be uninterrupted, error-free, or free of harmful components.
83+
84+
---
85+
86+
## 10. Limitation of Liability
87+
88+
To the maximum extent permitted by law, TechDiary and its team shall not be liable for any indirect, incidental, special, consequential, or punitive damages arising out of or related to your use of the platform.
89+
90+
---
91+
92+
## 11. Changes to These Terms
93+
94+
We reserve the right to modify these Terms at any time. Changes will take effect immediately upon posting to this page with a revised "Last updated" date. Continued use of the platform after changes constitutes your acceptance of the new Terms.
95+
96+
---
97+
98+
## 12. Governing Law
99+
100+
These Terms shall be governed by and construed in accordance with the laws of Bangladesh, without regard to its conflict-of-law provisions.
101+
102+
---
103+
104+
## 13. Contact Us
105+
106+
If you have any questions about these Terms and Conditions, please contact us at:
107+
108+
**Email:** support@techdiary.dev
109+
**Website:** [techdiary.dev](https://www.techdiary.dev)

0 commit comments

Comments
 (0)