diff --git a/frontend/app/sitemap.ts b/frontend/app/sitemap.ts index ff834bd..845fa9e 100644 --- a/frontend/app/sitemap.ts +++ b/frontend/app/sitemap.ts @@ -1,5 +1,6 @@ import { MetadataRoute } from "next"; import { supportedLocales } from "@/constants/i18n-config"; +import { getAllPosts } from "@/lib/blog"; export default async function sitemap(): Promise { const baseUrl = "https://www.privydrop.app"; @@ -37,5 +38,23 @@ export default async function sitemap(): Promise { }); }); + // Add blog posts for each language + for (const lang of languages) { + try { + const posts = await getAllPosts(lang); + + posts.forEach((post) => { + urls.push({ + url: `${baseUrl}/${lang}/blog/${post.slug}`, + lastModified: new Date(post.frontmatter.date), + changeFrequency: "monthly", + priority: 0.7, + }); + }); + } catch (error) { + console.warn(`Failed to load blog posts for language ${lang}:`, error); + } + } + return urls; } diff --git a/frontend/content/blog/resumable-transfers-en.mdx b/frontend/content/blog/resumable-transfers-en.mdx index 2d0990b..661aeb4 100644 --- a/frontend/content/blog/resumable-transfers-en.mdx +++ b/frontend/content/blog/resumable-transfers-en.mdx @@ -55,13 +55,25 @@ Before receiving a file, you must click **"Set Save Directory"**. This step is c Network fluctuations, accidentally closing the tab, your computer going to sleep... when interruptions inevitably happen, stay calm. Your file progress is safe. -**Step 3: Lock in Your Progress (The Key Action)** +**Step 3: Smart Protection with Double Insurance** -To **lock in and securely save** the file fragments you've already received, you need to **refresh or close the current page**. +PrivyDrop provides **dual protection mechanisms** for your file transfers: -This is where PrivyDrop's carefully designed **Exit Protection Mechanism** comes into play. Normally, if a page with an active download is suddenly closed, the browser might discard the incomplete temporary file, leading to data loss. +**Active Protection: Smart "Safe Save" Button** -We've engineered a solution: when you refresh or close the page, PrivyDrop's code intercepts this action. Instead of letting the browser abandon the file, it acts like a responsible archivist, **gracefully closing the disk write stream to finalize and save the data already received**. This action transforms the temporary file into a stable "save point" ready for the next transfer attempt. +During file transmission, you'll see a green **"Safe Save"** button in the interface. This is our specially designed "lifeboat" feature for dealing with network instability. + +- **When it appears**: After selecting a save directory, this button appears whenever files are being transmitted +- **When to use it**: Network feeling slow? Worried about an imminent disconnection? Need to leave temporarily? Click it anytime +- **What it does**: Immediately saves received file fragments to disk, preparing for the next resumption attempt + +**💡 Pro Tip**: If you don't have time to click the "Safe Save" button, simply closing or refreshing the webpage has the same protective effect! The exit protection mechanism will automatically save your progress. + +**Passive Protection: Exit Protection Mechanism** + +Beyond the active safe save button, we've designed an **Exit Protection Mechanism**. When you must refresh or close the page, PrivyDrop's code intercepts this action, acting like a responsible archivist to **gracefully close the disk write stream and finalize the data already received**. This transforms the temporary file into a stable "save point" ready for the next transfer attempt. + +Normally, if a page with an active download is suddenly closed, the browser might discard the incomplete temporary file, leading to data loss. PrivyDrop ensures your efforts are never wasted. **Step 4: Seamless Resumption** diff --git a/frontend/content/blog/resumable-transfers-zh.mdx b/frontend/content/blog/resumable-transfers-zh.mdx index 8b76abe..680422c 100644 --- a/frontend/content/blog/resumable-transfers-zh.mdx +++ b/frontend/content/blog/resumable-transfers-zh.mdx @@ -48,13 +48,25 @@ status: "published" 网络波动、手滑关闭页面、电脑意外休眠……当中断不可避免地发生时,请保持冷静,你的文件进度是安全的。 -**第三步:锁定进度 (关键操作)** +**第三步:智能保护,双重保险** -为了**锁定并安全保存**已接收的文件片段,你需要**刷新或关闭当前页面**。 +PrivyDrop 为你的文件传输提供了**双重保护机制**: -这里正是 PrivyDrop 精心设计的**退出保护机制 (Exit Protection Mechanism)** 发挥作用的地方。通常情况下,若一个有活跃下载的页面被突然关闭,浏览器可能会直接丢弃未完成的临时文件,导致数据丢失。 +**主动保存:智能"安全保存"按钮** -而我们为此设计了解决方案:当你刷新或关闭页面时,PrivyDrop 的代码会拦截这个行为,它不会任由浏览器放弃文件,而是像一个负责任的档案管理员,**优雅地关闭磁盘写入流,将已经接收的数据进行最终确认和保存**。这个动作,确保了临时文件被转化为一个稳定、可供下次续传的“存档点”。 +当文件正在传输过程中,你会在界面上看到一个绿色的**"安全保存"**按钮。这是我们为应对网络不稳定而特别设计的"救生艇"功能。 + +- **何时出现**:选择保存目录后,只要有文件正在传输,这个按钮就会出现 +- **何时使用**:感觉网络变慢?担心即将断网?或者需要临时离开?随时点击它 +- **点击效果**:立即将已接收的文件片段安全保存到磁盘,为下次续传做好准备 + +**💡 小贴士**:如果来不及点击"安全保存"按钮,直接关闭或刷新网页也有同样的保护效果!退出保护机制会自动为你保存进度。 + +**被动保护:退出保护机制 (Exit Protection Mechanism)** + +除了主动的安全保存按钮,我们还设计了**退出保护机制**。当你不得不刷新或关闭页面时,PrivyDrop 的代码会拦截这个行为,像一个负责任的档案管理员,**优雅地关闭磁盘写入流,将已经接收的数据进行最终确认和保存**。这个动作,确保了临时文件被转化为一个稳定、可供下次续传的"存档点"。 + +通常情况下,若一个有活跃下载的页面被突然关闭,浏览器可能会直接丢弃未完成的临时文件,导致数据丢失。而 PrivyDrop 绝不会让你的努力白费。 **第四步:无缝续传**