diff --git a/app.js b/app.js index 0ca6db3..69936d8 100644 --- a/app.js +++ b/app.js @@ -36,14 +36,20 @@ function loadMenuItems() { const menuItems = []; const titleRegex = //g; const urlRegex = //g; + const openNewPageRegex = //g; let titleMatch; let urlMatch; + let openNewPageMatch; + // Use a loop to find and process each menu item while ((titleMatch = titleRegex.exec(content)) && (urlMatch = urlRegex.exec(content))) { + openNewPageMatch = openNewPageRegex.exec(content); + menuItems.push({ title: titleMatch[1], - url: urlMatch[1] + url: urlMatch[1], + openNewPage: openNewPageMatch !== null // If openNewPage exists, set it to true }); } diff --git a/views/about.ejs b/views/about.ejs index 9c13469..5634d3f 100644 --- a/views/about.ejs +++ b/views/about.ejs @@ -34,7 +34,7 @@ diff --git a/views/blog-post.ejs b/views/blog-post.ejs index add1fba..b780b7d 100644 --- a/views/blog-post.ejs +++ b/views/blog-post.ejs @@ -32,7 +32,7 @@ diff --git a/views/contact.ejs b/views/contact.ejs index c7d922d..7400058 100644 --- a/views/contact.ejs +++ b/views/contact.ejs @@ -37,7 +37,7 @@ diff --git a/views/index.ejs b/views/index.ejs index 08385c7..e6a74a9 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -20,7 +20,7 @@