Do not mark subdomains as external links

This commit is contained in:
Florine W. Dekker 2021-04-22 18:59:41 +02:00
parent 7b5590f9ea
commit 6ed587c54a
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@fwdekker/template",
"version": "2.1.0",
"version": "2.1.1",
"description": "The base template for pages on fwdekker.com.",
"author": "Felix W. Dekker",
"license": "MIT",

View File

@ -90,7 +90,7 @@ const nav = function(highlightPath = "") {
*/
const unpackEntry = function(entry, path = "/", highlightPath = "") {
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
const isExternalLink = !entry.link.startsWith("https://fwdekker.com/") && entry.link !== "#";
const isExternalLink = !(/^https:\/\/.*fwdekker.com/.test(entry.link)) && entry.link !== "#";
const formattedName = (isExternalLink ? "⎋ " : "") + entry.name;
if (entry.entries.length === 0)