Hello everyone!, I’m excited to share a progress report on my Outreachy internship with the Debian community. As I reach the halfway point of this journey, I want to reflect on what I’ve accomplished so far and outline my modified goals for the second half of the internship.
In truth, there wasn’t a strict timeline for my project—migrating Debian webpage content to Hugo—because the original repository contained thousands of pages. The initial goal was to develop a proof of concept for:
- A backward compatible deployment setup
- Migration of static text content pages
- Migration of dynamic pages (Incorporating existing perl scripts)
- Redirection for contents moved permanently (301)
Thanks to our daily standups, where we brainstorm and revise contributions, we’ve made significant progress. The wiki documentation discussing the technical decisions taken to meet these goals is currently in progress here.
During the first half of my internship, I have improved and refined my skills in several areas. I learned new Markdown syntaxes, studied and utilized Apache's mod_rewrite, and halfway studied GNU Make to use Perl scripts for processing data for dynamic content. I recommend Managing Projects with GNU Make by Robert Mecklenburg—it's a great book for beginners!
While I didn’t get stuck on any particular goal, the most challenging aspect was adding Hugo aliases to help with Apache's multilingual content negotiation. The way the webwml repository generates multilingual content differs from debianhugo. For instance, in webwml, the structure looks like this: english/index.wml -> /index.en.html (with a symlink from index.html to index.en.html)
and french/index.wml -> /index.fr.html
. In contrast, debianhugo uses en/_index.md -> /index.html
and fr/_index.md -> /fr/index.html
.
Apache's multilingual content negotiation checks for index.<user preferred lang code>.html
in the current directory, which works well with webwml since all related translations are generated in the same directory. However, with debianhugo using subdirectories for languages other than English, we had to set up aliases for every other language page to be generated in the frontmatter. For example, in fr/_index.md
, we added this to the front matter:
...
aliases:
- /index.fr.html
...
This setup allows Hugo to generate multilingual HTML files in the initial home directory solely for the purpose of setting up a 301 redirect to the same page in the language subdirectory. However, if the client sets their preferred language to English, Apache content negotiation tries to find /index.en.html
. If it doesn’t find it, it defaults to any other language-suffixed file, which can lead to unexpected behavior. For example, if English is set as the preferred language, accessing the site may serve /index.fr.html
, which then redirects to /fr/index.html
. This was a significant challenge, and you can see a demo of this hosted here.
If I were to start the project over, I would document every decision as I make them in the wiki, no matter how rough the documentation turns out. Waiting until the midpoint of the project to document was not a good idea.
As I move into the second half of my internship, the goals we’ve set include improving our project wiki documentation and continuing the migration process while enhancing the user experience of complicated sections. I’m looking forward to making even more progress and sharing my journey with you all. Happy coding! 🌟
Top comments (0)