ASP Classic blog framework - BrainOrdure
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

97 行
4.0KB

  1. <%
  2. Dim postIter, postItem, featuredPost, featuredImage, featuredPublishedText, featuredReadTime
  3. Set postIter = posts.Iterator()
  4. featuredImage = ""
  5. If posts.Count > 0 Then
  6. Set featuredPost = postIter.GetNext()
  7. featuredImage = ExtractFirstImageSrc(featuredPost.Body)
  8. End If
  9. %>
  10. <header class="masthead masthead-page">
  11. <div class="overlay"></div>
  12. <div class="container">
  13. <div class="row">
  14. <div class="col-lg-8 col-md-10 mx-auto">
  15. <div class="page-heading text-center">
  16. <h1>Posts</h1>
  17. <span class="subheading">Published articles from BrainOrdure.</span>
  18. </div>
  19. </div>
  20. </div>
  21. </div>
  22. </header>
  23. <div class="row">
  24. <div class="col-lg-8 mx-auto">
  25. <div class="d-flex justify-content-end mb-4">
  26. <a class="btn btn-primary" href="<%= PostNewUrl() %>">New Post</a>
  27. </div>
  28. <% If posts.Count = 0 Then %>
  29. <div class="alert alert-secondary">No published posts are available yet.</div>
  30. <% Else %>
  31. <article class="card shadow-sm post-card post-card-featured mb-4">
  32. <% If Len(featuredImage) > 0 Then %>
  33. <a class="post-card-image" href="<%= PostUrl(featuredPost.Slug) %>" style="background-image: url('<%= H(featuredImage) %>')"></a>
  34. <% End If %>
  35. <div class="card-body">
  36. <div class="magazine-label mb-3">Top story</div>
  37. <h2 class="post-title"><a href="<%= PostUrl(featuredPost.Slug) %>"><%= H(featuredPost.Title) %></a></h2>
  38. <p class="post-subtitle"><%= H(featuredPost.Summary) %></p>
  39. <%
  40. featuredPublishedText = ""
  41. If IsDate(featuredPost.PublishedDate) Then
  42. If CDate(featuredPost.PublishedDate) > #1/1/1970# Then
  43. featuredPublishedText = FormatDateTime(featuredPost.PublishedDate, vbLongDate)
  44. End If
  45. End If
  46. featuredReadTime = EstimateReadTime(featuredPost.Body)
  47. %>
  48. <div class="post-meta-inline">
  49. <span>By BrainOrdure</span>
  50. <% If Len(featuredPublishedText) > 0 Then %><span class="meta-sep">•</span><span><%= H(featuredPublishedText) %></span><% End If %>
  51. <% If Len(featuredReadTime) > 0 Then %><span class="meta-sep">•</span><span><%= H(featuredReadTime) %></span><% End If %>
  52. </div>
  53. </div>
  54. </article>
  55. <h2 class="h4 mb-3">More stories</h2>
  56. <%
  57. Dim shownCount, publishedText, readTimeText, cardImage, articleLabel
  58. shownCount = 0
  59. Do While postIter.HasNext And shownCount < 19
  60. Set postItem = postIter.GetNext()
  61. shownCount = shownCount + 1
  62. publishedText = ""
  63. If IsDate(postItem.PublishedDate) Then
  64. If CDate(postItem.PublishedDate) > #1/1/1970# Then
  65. publishedText = FormatDateTime(postItem.PublishedDate, vbLongDate)
  66. End If
  67. End If
  68. readTimeText = EstimateReadTime(postItem.Body)
  69. cardImage = ExtractFirstImageSrc(postItem.Body)
  70. articleLabel = "Issue " & CStr(shownCount + 1)
  71. %>
  72. <article class="card shadow-sm post-card mb-4">
  73. <% If Len(cardImage) > 0 Then %>
  74. <a class="post-card-image" href="<%= PostUrl(postItem.Slug) %>" style="background-image: url('<%= H(cardImage) %>')"></a>
  75. <% End If %>
  76. <div class="card-body">
  77. <div class="eyebrow mb-2"><%= H(articleLabel) %></div>
  78. <h3 class="post-title h4"><a href="<%= PostUrl(postItem.Slug) %>"><%= H(postItem.Title) %></a></h3>
  79. <p class="post-subtitle mb-2"><%= H(postItem.Summary) %></p>
  80. <div class="post-meta-inline">
  81. <span>By BrainOrdure</span>
  82. <% If Len(publishedText) > 0 Then %><span class="meta-sep">•</span><span><%= H(publishedText) %></span><% End If %>
  83. <% If Len(readTimeText) > 0 Then %><span class="meta-sep">•</span><span><%= H(readTimeText) %></span><% End If %>
  84. </div>
  85. </div>
  86. </article>
  87. <%
  88. Loop
  89. %>
  90. <% End If %>
  91. </div>
  92. </div>

Powered by TurnKey Linux.