|
- <%
- Dim featuredPost, homePostIter, homePostItem, homeHeroBackground, homePublishedText, homeReadTime, homeCardImage
- homeHeroBackground = ""
- Set homePostIter = posts.Iterator()
- If posts.Count > 0 Then
- Set featuredPost = homePostIter.GetNext()
- homeHeroBackground = ExtractFirstImageSrc(featuredPost.Body)
- End If
- %>
-
- <header class="masthead masthead-home<% If Len(homeHeroBackground) > 0 Then %> masthead-has-image<% End If %>"<% If Len(homeHeroBackground) > 0 Then %> style="background-image: url('<%= H(homeHeroBackground) %>')"<% End If %>>
- <div class="overlay"></div>
- <div class="container">
- <div class="row">
- <div class="col-lg-8 col-md-10 mx-auto">
- <div class="page-heading text-center">
- <h1>BrainOrdure</h1>
- <span class="subheading">A cleaner front page for essays, notes, and reader discussion.</span>
- </div>
- </div>
- </div>
- </div>
- </header>
-
- <div class="row gy-4">
- <div class="col-lg-8">
- <% If posts.Count = 0 Then %>
- <div class="alert alert-secondary">No published posts are available yet.</div>
- <% Else %>
- <div class="card shadow-sm post-card post-card-featured mb-4">
- <% If Len(homeHeroBackground) > 0 Then %>
- <a class="post-card-image" href="<%= PostUrl(featuredPost.Slug) %>" style="background-image: url('<%= H(homeHeroBackground) %>')"></a>
- <% End If %>
- <div class="card-body">
- <div class="magazine-label mb-3">Featured story</div>
- <h2 class="post-title"><a href="<%= PostUrl(featuredPost.Slug) %>"><%= H(featuredPost.Title) %></a></h2>
- <p class="post-subtitle"><%= H(featuredPost.Summary) %></p>
- <%
- homePublishedText = ""
- If IsDate(featuredPost.PublishedDate) Then
- If CDate(featuredPost.PublishedDate) > #1/1/1970# Then
- homePublishedText = FormatDateTime(featuredPost.PublishedDate, vbLongDate)
- End If
- End If
- homeReadTime = EstimateReadTime(featuredPost.Body)
- %>
- <div class="post-meta-inline">
- <span>By BrainOrdure</span>
- <% If Len(homePublishedText) > 0 Then %><span class="meta-sep">•</span><span><%= H(homePublishedText) %></span><% End If %>
- <% If Len(homeReadTime) > 0 Then %><span class="meta-sep">•</span><span><%= H(homeReadTime) %></span><% End If %>
- </div>
- </div>
- </div>
-
- <h2 class="h4 mb-3">Latest stories</h2>
- <%
- Dim homePreviewCount
- homePreviewCount = 0
- Do While homePostIter.HasNext And homePreviewCount < 4
- Set homePostItem = homePostIter.GetNext()
- homePreviewCount = homePreviewCount + 1
- homePublishedText = ""
- If IsDate(homePostItem.PublishedDate) Then
- If CDate(homePostItem.PublishedDate) > #1/1/1970# Then
- homePublishedText = FormatDateTime(homePostItem.PublishedDate, vbLongDate)
- End If
- End If
- homeReadTime = EstimateReadTime(homePostItem.Body)
- homeCardImage = ExtractFirstImageSrc(homePostItem.Body)
- %>
- <article class="card shadow-sm post-card mb-4">
- <% If Len(homeCardImage) > 0 Then %>
- <a class="post-card-image" href="<%= PostUrl(homePostItem.Slug) %>" style="background-image: url('<%= H(homeCardImage) %>')"></a>
- <% End If %>
- <div class="card-body">
- <div class="eyebrow mb-2">Issue <%= homePreviewCount + 1 %></div>
- <h3 class="post-title h4"><a href="<%= PostUrl(homePostItem.Slug) %>"><%= H(homePostItem.Title) %></a></h3>
- <p class="post-subtitle mb-2"><%= H(homePostItem.Summary) %></p>
- <div class="post-meta-inline">
- <span>By BrainOrdure</span>
- <% If Len(homePublishedText) > 0 Then %><span class="meta-sep">•</span><span><%= H(homePublishedText) %></span><% End If %>
- <% If Len(homeReadTime) > 0 Then %><span class="meta-sep">•</span><span><%= H(homeReadTime) %></span><% End If %>
- </div>
- </div>
- </article>
- <%
- Loop
- %>
-
- <div class="clearfix mb-5">
- <a class="btn btn-primary float-end" href="<%= PostsUrl() %>">View All Posts →</a>
- </div>
- <% End If %>
- </div>
-
- <div class="col-lg-4">
- <aside class="story-aside">
- <div class="card shadow-sm">
- <div class="card-body">
- <div class="magazine-label mb-3">Inside this issue</div>
- <h2 class="h4">Browse by section</h2>
- <div class="topic-chip-grid mt-3">
- <%
- Dim homeCategoryIter, homeCategoryItem
- Set homeCategoryIter = categories.Iterator()
- If categories.Count = 0 Then
- %>
- <span class="text-muted small">No categories yet.</span>
- <%
- Else
- Do While homeCategoryIter.HasNext
- Set homeCategoryItem = homeCategoryIter.GetNext()
- %>
- <a class="topic-chip" href="<%= CategoryUrl(homeCategoryItem.CategoryID) %>"><%= H(homeCategoryItem.Name) %></a>
- <%
- Loop
- End If
- %>
- </div>
- </div>
- </div>
-
- <div class="card shadow-sm">
- <div class="card-body">
- <div class="magazine-label mb-3">About</div>
- <p class="mb-0 text-muted">BrainOrdure is now styled like a modern editorial blog with cleaner reading flow, stronger story hierarchy, and better navigation.</p>
- </div>
- </div>
- </aside>
- </div>
- </div>
|