ASP Classic blog framework - BrainOrdure
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

154 satır
5.8KB

  1. <%
  2. Dim featuredPost, homePostIter, homePostItem, homeRecentCount
  3. homeRecentCount = 0
  4. Set homePostIter = posts.Iterator()
  5. If posts.Count > 0 Then
  6. Set featuredPost = homePostIter.GetNext()
  7. End If
  8. %>
  9. <div class="hero mb-5">
  10. <div class="d-flex flex-column flex-lg-row justify-content-between gap-4 align-items-lg-end">
  11. <div class="home-hero-copy">
  12. <div class="eyebrow mb-3">The magazine</div>
  13. <h1 class="display-5 fw-bold mb-3">BrainOrdure</h1>
  14. <p class="lede mb-4">A tidy, opinionated front page for notes, essays, and reader discussion.</p>
  15. <div class="d-flex flex-wrap gap-2">
  16. <a href="<%= PostsUrl() %>" class="btn btn-primary px-4">Read the issue</a>
  17. <a href="<%= CategoriesUrl() %>" class="btn btn-outline-secondary px-4">Browse sections</a>
  18. </div>
  19. </div>
  20. <div class="home-sidebar card shadow-sm">
  21. <div class="card-body">
  22. <div class="eyebrow mb-2">Inside this issue</div>
  23. <h2 class="h5 mb-3">Latest coverage</h2>
  24. <% If posts.Count = 0 Then %>
  25. <p class="text-muted mb-0">No published stories yet.</p>
  26. <% Else %>
  27. <ul class="list-unstyled editorial-list mb-0">
  28. <%
  29. Set homePostIter = posts.Iterator()
  30. Do While homePostIter.HasNext And homeRecentCount < 3
  31. Set homePostItem = homePostIter.GetNext()
  32. homeRecentCount = homeRecentCount + 1
  33. %>
  34. <li class="mb-3">
  35. <a class="text-decoration-none d-block" href="<%= PostUrl(homePostItem.Slug) %>">
  36. <span class="small text-uppercase text-muted d-block mb-1">Story <%= homeRecentCount %></span>
  37. <strong><%= H(homePostItem.Title) %></strong>
  38. </a>
  39. </li>
  40. <%
  41. Loop
  42. %>
  43. </ul>
  44. <% End If %>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="row g-4">
  50. <div class="col-lg-8">
  51. <div class="d-flex align-items-center justify-content-between mb-3">
  52. <div>
  53. <div class="eyebrow mb-2">Featured story</div>
  54. <h2 class="page-title h3 mb-0">From the editor's desk</h2>
  55. </div>
  56. </div>
  57. <% If posts.Count = 0 Then %>
  58. <div class="alert alert-secondary">No published posts are available yet.</div>
  59. <% Else %>
  60. <article class="card shadow-sm mb-4 feature-article">
  61. <div class="card-body p-4 p-lg-5">
  62. <div class="magazine-label mb-3">Cover story</div>
  63. <h3 class="display-6 mb-3"><a class="text-decoration-none" href="<%= PostUrl(featuredPost.Slug) %>"><%= H(featuredPost.Title) %></a></h3>
  64. <%
  65. Dim featuredPublishedText
  66. featuredPublishedText = ""
  67. If IsDate(featuredPost.PublishedDate) Then
  68. If CDate(featuredPost.PublishedDate) > #1/1/1970# Then
  69. featuredPublishedText = FormatDateTime(featuredPost.PublishedDate, vbLongDate)
  70. End If
  71. End If
  72. If Len(featuredPublishedText) > 0 Then
  73. %>
  74. <p class="article-meta mb-3"><%= H(featuredPublishedText) %></p>
  75. <%
  76. End If
  77. %>
  78. <p class="lede mb-4"><%= H(featuredPost.Summary) %></p>
  79. <a class="btn btn-primary" href="<%= PostUrl(featuredPost.Slug) %>">Read the feature</a>
  80. </div>
  81. </article>
  82. <div class="row g-4 magazine-list">
  83. <%
  84. Dim latestPostIter, latestPostItem, latestIndex
  85. latestIndex = 0
  86. Set latestPostIter = posts.Iterator()
  87. If latestPostIter.HasNext Then Set latestPostItem = latestPostIter.GetNext()
  88. Do While latestPostIter.HasNext And latestIndex < 4
  89. Set latestPostItem = latestPostIter.GetNext()
  90. latestIndex = latestIndex + 1
  91. %>
  92. <div class="col-md-6">
  93. <article class="card shadow-sm h-100">
  94. <div class="card-body">
  95. <div class="magazine-label mb-3">Issue note</div>
  96. <h3 class="h4 mb-2">
  97. <a href="<%= PostUrl(latestPostItem.Slug) %>" class="text-decoration-none"><%= H(latestPostItem.Title) %></a>
  98. </h3>
  99. <p class="text-muted mb-3 prose"><%= H(latestPostItem.Summary) %></p>
  100. <a class="btn btn-sm btn-outline-primary" href="<%= PostUrl(latestPostItem.Slug) %>">Continue reading</a>
  101. </div>
  102. </article>
  103. </div>
  104. <%
  105. Loop
  106. %>
  107. </div>
  108. <% End If %>
  109. </div>
  110. <div class="col-lg-4">
  111. <div class="card shadow-sm mb-4">
  112. <div class="card-body">
  113. <div class="eyebrow mb-2">Sections</div>
  114. <h2 class="h5 mb-3">Browse the paper</h2>
  115. <% If categories.Count = 0 Then %>
  116. <p class="text-muted mb-0">No categories are available yet.</p>
  117. <% Else %>
  118. <ul class="list-unstyled editorial-list mb-0">
  119. <%
  120. Dim homeCategoryIter, homeCategoryItem
  121. Set homeCategoryIter = categories.Iterator()
  122. Do While homeCategoryIter.HasNext
  123. Set homeCategoryItem = homeCategoryIter.GetNext()
  124. %>
  125. <li class="mb-2">
  126. <a href="<%= CategoryUrl(homeCategoryItem.CategoryID) %>" class="text-decoration-none d-flex justify-content-between align-items-center">
  127. <span><%= H(homeCategoryItem.Name) %></span>
  128. <i class="bi bi-arrow-right-short"></i>
  129. </a>
  130. </li>
  131. <%
  132. Loop
  133. %>
  134. </ul>
  135. <% End If %>
  136. </div>
  137. </div>
  138. <div class="card shadow-sm">
  139. <div class="card-body">
  140. <div class="eyebrow mb-2">Reader note</div>
  141. <h2 class="h5 mb-3">Why it feels different</h2>
  142. <p class="text-muted mb-0">The layout now leans into a front-page magazine structure with a feature story, supporting briefs, and a quieter sidebar for section navigation.</p>
  143. </div>
  144. </div>
  145. </div>
  146. </div>

Powered by TurnKey Linux.