Urgent.News

What's breaking now, across thousands of outlets.

Tech

Checking hreflang on a bilingual static site with a 35-line Node script

My pension calculator has two language versions, English at / and Hindi at /hi/ , and most pages exist twice. I had always treated hreflang as a tag you paste once and forget. The problem is that it fails silently: nothing breaks in the browser, and search engines simply ignore alternate tags that don't agree with each other. So today I wrote a checker instead of trusting my build script. What…

A bilingual static website has two language versions, English at the root and Hindi at /hi/. Most pages exist in both languages, but hreflang tags were treated as something to paste once and forget. The author wrote a checker script to ensure the hreflang tags are consistent and correctly implemented, rather than relying on the build script.

The hreflang contract requires reciprocal links: if the English page points to the Hindi page, the Hindi page must also point back to the English page and list itself. The script checks for missing trailing slashes, self-reference, and return links. It confirmed that all 76 pages with hreflang passed the checks. The language switcher includes the same attributes for accessibility.

The author plans to test the script further by intentionally breaking a page and verifying it gets flagged.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

CVE-2026-118773: CVE-2026-118773: Asynchronous Control Flow Bypass and Uncontrolled Resource Consumption in node-glob

CVE-2026-118773: Asynchronous Control Flow Bypass and Uncontrolled Resource Consumption in node-glob Vulnerability ID: CVE-2026-118773 CVSS Score: 6.3 Published: 2026-10-30 CVE-2026-118773…

  • CVE-2026-118773 affects node-glob versions 9.0.0 to 14.0.1
  • Missing return statements in AbortSignal check logic cause CPU, event loop, and disk I/O exhaustion
  • Upgrading to glob version 14.0.2 resolves the issue

CSS gap decorations: lines between grid items

This note has an interactive demo. Try it in the original Drawing a line between grid cells has always been a hack: borders on half the items, :nth-child() rules to remove the extra ones, or a…

Toolbox talks shouldn't take your whole morning

I run a small safety software company, and I talk to a lot of small construction and trade crews. Almost every one of them tells me the same thing: the safety meeting itself isn't the hard part.

  • Toolbox talks should be limited to one topic and 10 minutes
  • Brief talks improve retention and attendance tracking
  • SMS reminders and immediate attendance recording streamline process

More from Saturday 31 October →