<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sa9ne</title>
    <description>The latest articles on DEV Community by Sa9ne (@sa9ne).</description>
    <link>https://dev.to/sa9ne</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4246982%2Fa65138c0-c4ad-44d2-a103-78632d5a0e37.jpg</url>
      <title>DEV Community: Sa9ne</title>
      <link>https://dev.to/sa9ne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sa9ne"/>
    <language>en</language>
    <item>
      <title>Moving My Bilingual Portfolio to Astro and Cloudflare Workers</title>
      <dc:creator>Sa9ne</dc:creator>
      <pubDate>Mon, 16 Nov 2026 05:59:09 +0000</pubDate>
      <link>https://dev.to/sa9ne/moving-my-bilingual-portfolio-to-astro-and-cloudflare-workers-5h4a</link>
      <guid>https://dev.to/sa9ne/moving-my-bilingual-portfolio-to-astro-and-cloudflare-workers-5h4a</guid>
      <description>&lt;p&gt;&lt;strong&gt;Moving My Bilingual Portfolio to Astro and Cloudflare Workers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My portfolio sells website development and SEO services. As I added service pages and articles, maintaining separate HTML pages and translations became repetitive.&lt;/p&gt;

&lt;p&gt;I recently moved it to Astro, keeping a static build and using a Cloudflare Worker for redirects and response headers. Here is how the project is organised and a couple of details I corrected after the migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Routes, views, and content have separate jobs&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The project now has this structure:&lt;/p&gt;

&lt;p&gt;src/&lt;br&gt;
  pages/              # English routes and /ru routes&lt;br&gt;
  views/              # Shared page templates&lt;br&gt;
  layouts/            # Head metadata and page shell&lt;br&gt;
  content/&lt;br&gt;
    news/en/          # English articles&lt;br&gt;
    news/ru/          # Russian articles&lt;br&gt;
    services/en/      # English services&lt;br&gt;
    services/ru/      # Russian services&lt;br&gt;
  i18n/               # Interface translations&lt;br&gt;
  lib/                # Content helpers and structured data&lt;br&gt;
worker/index.js       # Redirects and response headers&lt;/p&gt;

&lt;p&gt;Route files pass a language into a shared view. Article and service content lives in Markdown, with schemas validating the frontmatter during the build.&lt;/p&gt;

&lt;p&gt;That lets me change a template once while keeping editorial content separate from layout code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Render each language at its own URL&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;English pages live at the root, and Russian pages use &lt;code&gt;/ru&lt;/code&gt;. Both versions are generated as HTML.&lt;/p&gt;

&lt;p&gt;The shared layout builds canonical URLs and language alternates. For articles, the code checks whether a translated article with the same slug exists before linking the two versions. Most of my articles currently exist only in Russian, so this check matters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Keep old links working&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Changing the source structure also changed some public paths. The Worker maps old paths such as &lt;code&gt;/pages/websites.html&lt;/code&gt; to &lt;code&gt;/website&lt;/code&gt; with permanent redirects.&lt;/p&gt;

&lt;p&gt;Astro uses &lt;code&gt;build.format: 'file'&lt;/code&gt;, and Cloudflare serves the clean URLs. The Worker also normalises &lt;code&gt;.html&lt;/code&gt; URLs and trailing slashes, with an exception for search-engine verification files.&lt;/p&gt;

&lt;p&gt;Keeping those verification paths intact was a detail worth checking separately from ordinary page redirects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preserve query parameters when switching languages&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The site has a browser-language redirect for a first visit to an English page with a Russian equivalent. I found that it preserved the hash but dropped the query string.&lt;/p&gt;

&lt;p&gt;This preserves campaign parameters when a visitor switches to the Russian URL. The page also has an explicit language switch, and a saved language choice takes precedence over the automatic redirect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Avoid using the build date as a content update date&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My first sitemap implementation used the current build date for static pages and services. A deployment would therefore make unchanged pages look newly updated.&lt;/p&gt;

&lt;p&gt;I removed that fallback. Articles still use their explicit publication or update date; pages without a known content update date omit &lt;code&gt;lastmod&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build and check the output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Deployment runs the Astro build and uploads the static assets with Wrangler. After the latest changes, I checked that all 46 sitemap URLs had corresponding generated pages, then checked the deployed sitemap, an updated article, and the language redirect.&lt;/p&gt;

&lt;p&gt;The migration gives me a more manageable content structure. It is too early to claim a search traffic improvement: after roughly two months without organic visits, I have only recently seen the first one.&lt;/p&gt;

&lt;p&gt;My next step is to collect query and page data before deciding which content to expand.&lt;/p&gt;

&lt;p&gt;The portfolio is live at tretiakov.pro&lt;/p&gt;

&lt;p&gt;If you maintain a multilingual static site, how do you track meaningful content update dates across shared templates and individual pages?&lt;/p&gt;

</description>
      <category>astro</category>
      <category>jamstack</category>
      <category>seo</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
