single.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. {{ define "main" }}
  2. {{ if eq .Params.layout "1" }}
  3. <!-- featured post -->
  4. <section class="overflow-hidden">
  5. <div class="container-fluid p-sm-0">
  6. <div class="row featured-post-slider">
  7. {{ range (where site.RegularPages "Type" "featured")}}
  8. <div class="col-lg-3 col-sm-6 mb-2 mb-lg-0 px-1">
  9. <article class="card bg-dark text-center text-white border-0 rounded-0">
  10. <img class="card-img rounded-0 img-fluid w-100" src="{{.Params.Image | absURL}}" alt="post-thumb">
  11. <div class="card-img-overlay">
  12. <div class="card-content">
  13. <p class="text-uppercase">{{range .Params.Categories}}{{. | humanize}}{{end}}</p>
  14. <h4 class="card-title mb-4"><a class="text-white" href="{{.Permalink}}">{{.Title}}</a></h4>
  15. <a class="btn btn-outline-light" href="{{.Permalink}}">了解更多</a>
  16. </div>
  17. </div>
  18. </article>
  19. </div>
  20. {{ end }}
  21. </div>
  22. </div>
  23. </section>
  24. <!-- /featured post -->
  25. {{ else if (eq .Params.layout "2")}}
  26. <!-- hero area -->
  27. <section class="hero-section">
  28. <div class="container">
  29. <div class="row">
  30. <div class="col-lg-6 align-self-end">
  31. <h1 class="mb-0">Welcome</h1>
  32. <h2 class="mb-100 title-border-lg">to <i>{{site.Params.author}} Blog</i></h2>
  33. <p class="mb-80 mr-5">{{site.Params.bio | markdownify }}</p>
  34. <span class="font-secondary text-dark mr-3 mr-sm-5">Follow me :</span>
  35. <ul class="list-inline d-inline-block mb-5">
  36. {{ range site.Params.social }}
  37. <li class="list-inline-item mx-3"><a href="{{.URL}}" class="text-dark"><i class="{{.icon}}"></i></a></li>
  38. {{ end }}
  39. </ul>
  40. </div>
  41. <div class="col-lg-6 text-right">
  42. <img class="img-fluid" src="{{site.Params.author_image | absURL}}" alt="banner-image">
  43. </div>
  44. </div>
  45. </div>
  46. </section>
  47. <!-- /hero area -->
  48. {{ else }}
  49. <section class="section">
  50. <div class="container text-center">
  51. <h1>Please Enter A Valid Homepage Layout Number <br> (1 or 2)</h1>
  52. </div>
  53. </section>
  54. {{ end }}
  55. <!-- blog post -->
  56. <section class="section">
  57. <div class="container">
  58. {{ if eq .Params.layout "1" }}
  59. <div class="row masonry-container">
  60. {{ range site.RegularPages }}
  61. <div class="col-lg-4 col-sm-6 mb-5">
  62. <article class="text-center">
  63. <img class="img-fluid mb-4" src="{{.Params.Image | absURL }}" alt="post-thumb">
  64. <p class="text-uppercase mb-2">{{range .Params.Categories}}{{. | humanize}}{{end}}</p>
  65. <h4 class="title-border"><a class="text-dark" href="{{.Permalink}}">{{.Title}}</a></h4>
  66. <p>{{.Summary}}</p>
  67. <a href="{{.Permalink}}" class="btn btn-transparent">了解更多</a>
  68. </article>
  69. </div>
  70. {{ end }}
  71. </div>
  72. {{ else if (eq .Params.layout "2")}}
  73. <div class="row">
  74. {{ range $i,$p := (where site.RegularPages "Type" "post") }}
  75. <div class="col-12 mb-100">
  76. <article data-file="{{.Permalink}}" data-target="article"
  77. class="article-full-width {{if not (modBool $i 2)}} article-right {{ end }}">
  78. <div class="post-image">
  79. <img class="img-fluid" src="{{ .Params.Image | absURL }}" alt="post-thumb">
  80. </div>
  81. <div class="post-content">
  82. <ul class="list-inline d-flex justify-content-between border-bottom post-meta pb-2 mb-4">
  83. <li class="list-inline-item"><i class="ti-calendar mr-2"></i>{{ .PublishDate.Format "Jan 02, 2006" }}</li>
  84. <li class="list-inline-item"><i class="ti-alarm-clock mr-2"></i><span class="eta"></span> read</li>
  85. </ul>
  86. <h4 class="mb-4"><a href="{{.Permalink}}" class="text-dark">{{ .Title }}</a></h4>
  87. <p class="mb-0 post-summary">{{.Summary }}</p>
  88. <a class="btn btn-transparent mb-4" href="{{.Permalink}}">Continue...</a>
  89. </div>
  90. </article>
  91. </div>
  92. {{ end }}
  93. </div>
  94. {{ end }}
  95. </div>
  96. </section>
  97. <!-- /blog post -->
  98. {{partial "instafeed.html" . }}
  99. {{ end }}