Add menu system built using MD
This commit is contained in:
@ -7,12 +7,6 @@
|
||||
<title><%= title %></title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<%= process.env.HOST_URL %>/css/styles.css">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="<%= process.env.HOST_URL %>/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="<%= process.env.HOST_URL %>/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<%= process.env.HOST_URL %>/favicon-16x16.png">
|
||||
<link rel="manifest" href="<%= process.env.HOST_URL %>/site.webmanifest">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Navbar -->
|
||||
@ -24,20 +18,17 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="<%= process.env.HOST_URL %>">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%= process.env.HOST_URL %>/about">About Me</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%= process.env.HOST_URL %>/contact">Contact</a>
|
||||
</li>
|
||||
<% menuItems.forEach(item => { %>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="<%= item.url %>"><%= item.title %></a>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<!-- Main Content -->
|
||||
<header class="py-5">
|
||||
<div class="container text-center">
|
||||
<h1><%= process.env.FRONT_PAGE_TITLE %></h1>
|
||||
@ -50,21 +41,20 @@
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Search form -->
|
||||
<!-- Blog Content -->
|
||||
<section class="py-5">
|
||||
<div class="container">
|
||||
|
||||
<!-- Blog post list -->
|
||||
<% if (noResults) { %>
|
||||
<p><CENTER>Sorry, no blog posts found matching "<%= searchQuery %>"</CENTER></p>
|
||||
<p><center>Sorry, no blog posts found matching "<%= searchQuery %>"</center></p>
|
||||
<% } else { %>
|
||||
<h2><%= searchQuery ? 'Search results for "' + searchQuery + '"' : 'Recent Posts' %></h2>
|
||||
<h2><%= searchQuery ? 'Search results for "' + searchQuery + '"' : 'Recent Posts' %></h2>
|
||||
<% } %>
|
||||
<ul class="list-group list-group-flush">
|
||||
<% blogPosts.forEach(post => { %>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center py-4">
|
||||
<div>
|
||||
<h5 class="mb-1"><a href="<%= process.env.BLOG_URL %><%= post.slug %>"> <%= post.title %> </a></h5>
|
||||
<h5 class="mb-1"><a href="<%= process.env.BLOG_URL %><%= post.slug %>"><%= post.title %></a></h5>
|
||||
<p class="mb-1 text-muted">Posted on
|
||||
<%= new Date(post.dateCreated).toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
@ -86,13 +76,13 @@
|
||||
<a class="page-link" href="?page=<%= currentPage - 1 %>">Previous</a>
|
||||
</li>
|
||||
<% } %>
|
||||
|
||||
|
||||
<% for (let i = 1; i <= totalPages; i++) { %>
|
||||
<li class="page-item <%= currentPage === i ? 'active' : '' %>">
|
||||
<a class="page-link" href="?page=<%= i %>"><%= i %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
|
||||
|
||||
<% if (currentPage < totalPages) { %>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page=<%= currentPage + 1 %>">Next</a>
|
||||
@ -105,35 +95,10 @@
|
||||
|
||||
<footer class="text-white text-center py-4">
|
||||
<div class="container">
|
||||
<h4 class="footer-logo mb-3"><%= process.env.FOOTER_TAGLINE %></h4>
|
||||
<p class="footer-links mb-3">
|
||||
<a href="/" class="text-white text-decoration-none me-3">Home</a>
|
||||
<a href="/about" class="text-white text-decoration-none me-3">About</a>
|
||||
<a href="/contact" class="text-white text-decoration-none me-3">Contact</a>
|
||||
<a href="<%= process.env.HOST_URL %>/sitemap.xml" class="text-white text-decoration-none me-3">Sitemap</a>
|
||||
<a href="<%= process.env.HOST_URL %>/rss" class="text-white text-decoration-none">RSS Feed</a>
|
||||
</p>
|
||||
<p class="mb-0">© 2024 <%= process.env.OWNER_NAME %>. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
let typingTimer; // Timer identifier
|
||||
const doneTypingInterval = 500; // Time in ms, adjust for desired delay
|
||||
|
||||
const searchInput = document.getElementById('search-input');
|
||||
|
||||
searchInput.addEventListener('input', function() {
|
||||
clearTimeout(typingTimer);
|
||||
typingTimer = setTimeout(function() {
|
||||
searchInput.form.submit();
|
||||
}, doneTypingInterval);
|
||||
});
|
||||
|
||||
searchInput.addEventListener('keydown', function() {
|
||||
clearTimeout(typingTimer);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user