Do not mark subdomains as external links
This commit is contained in:
parent
7b5590f9ea
commit
6ed587c54a
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@fwdekker/template",
|
"name": "@fwdekker/template",
|
||||||
"version": "2.1.0",
|
"version": "2.1.1",
|
||||||
"description": "The base template for pages on fwdekker.com.",
|
"description": "The base template for pages on fwdekker.com.",
|
||||||
"author": "Felix W. Dekker",
|
"author": "Felix W. Dekker",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -90,7 +90,7 @@ const nav = function(highlightPath = "") {
|
||||||
*/
|
*/
|
||||||
const unpackEntry = function(entry, path = "/", highlightPath = "") {
|
const unpackEntry = function(entry, path = "/", highlightPath = "") {
|
||||||
const shouldHighlight = highlightPath.startsWith(`${path + entry.name}/`);
|
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;
|
const formattedName = (isExternalLink ? "⎋ " : "") + entry.name;
|
||||||
|
|
||||||
if (entry.entries.length === 0)
|
if (entry.entries.length === 0)
|
||||||
|
|
Loading…
Reference in New Issue