index.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. {{ partial "header.html" . }}
  2. {{ partial "navbar.html" . }}
  3. <!-- Flag for jQuery -->
  4. <span id="homepage" style="display: none"></span>
  5. <!-- Biography Section -->
  6. {{ range where .Data.Pages "Type" "home" }}
  7. {{ if eq .Title "about" }}
  8. <section id="bio" class="home-section">
  9. <div class="container">
  10. {{ partial "home_biography" . }}
  11. </div>
  12. </section>
  13. {{ end }}
  14. {{ end }}
  15. <!-- Selected Publications Section -->
  16. {{ $pubs_selected_len := len (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
  17. {{ if gt $pubs_selected_len 0 }}
  18. <section id="publications" class="home-section">
  19. <div class="container">
  20. <div class="row">
  21. <div class="col-xs-12 col-md-4 section-heading">
  22. <h1>{{ with .Site.Params.publications_selected.title }}{{ . | markdownify }}{{ end }}</h1>
  23. {{ with .Site.Params.publications_selected.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  24. </div>
  25. <div class="col-xs-12 col-md-8">
  26. {{ if .Site.Params.publications_selected.detailed_list }}
  27. {{ range (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
  28. {{ partial "publication_li_detailed" . }}
  29. {{ end }}
  30. {{ else }}
  31. <ul class="fa-ul">
  32. {{ range (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
  33. {{ partial "publication_li_simple" . }}
  34. {{ end }}
  35. </ul>
  36. {{ end }}
  37. </div>
  38. </div>
  39. </div>
  40. </section>
  41. {{ end }}
  42. <!-- Publications Section -->
  43. {{ $pubs_len := len (where .Data.Pages "Type" "publication") }}
  44. {{ if gt $pubs_len 0 }}
  45. <section {{ if eq $pubs_selected_len 0 }}id="publications" {{ end }}class="home-section">
  46. <div class="container">
  47. <div class="row">
  48. <div class="col-xs-12 col-md-4 section-heading">
  49. <h1>{{ with .Site.Params.publications.title }}{{ . | markdownify }}{{ end }}</h1>
  50. {{ with .Site.Params.publications.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  51. {{ if gt $pubs_len .Site.Params.publications.count }}
  52. <p class="view-all">
  53. <a href="{{ .Site.BaseURL }}publication/">
  54. {{ with .Site.Params.publications.str_all }}{{ . | markdownify }}{{ end }}
  55. <i class="fa fa-angle-double-right"></i>
  56. </a>
  57. </p>
  58. {{ end }}
  59. </div>
  60. <div class="col-xs-12 col-md-8">
  61. {{ if .Site.Params.publications.detailed_list }}
  62. {{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }}
  63. {{ partial "publication_li_detailed" . }}
  64. {{ end }}
  65. {{ else }}
  66. <ul class="fa-ul">
  67. {{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }}
  68. {{ partial "publication_li_simple" . }}
  69. {{ end }}
  70. </ul>
  71. {{ end }}
  72. </div>
  73. </div>
  74. </div>
  75. </section>
  76. {{ end }}
  77. <!-- Blog Posts Section -->
  78. {{ $posts_len := len (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
  79. {{ if gt $posts_len 0 }}
  80. <section id="posts" class="home-section">
  81. <div class="container">
  82. <div class="row">
  83. <div class="col-xs-12 col-md-4 section-heading">
  84. <h1>{{ with .Site.Params.posts.title }}{{ . | markdownify }}{{ end }}</h1>
  85. {{ with .Site.Params.posts.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  86. {{ if gt $posts_len .Site.Params.posts.count }}
  87. <p class="view-all">
  88. <a href="{{ .Site.BaseURL }}post/">
  89. {{ with .Site.Params.posts.str_all }}{{ . | markdownify }}{{ end }}
  90. <i class="fa fa-angle-double-right"></i>
  91. </a>
  92. </p>
  93. {{ end }}
  94. </div>
  95. <div class="col-xs-12 col-md-8">
  96. {{ range first .Site.Params.posts.count (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
  97. <div class="article-list-item" itemscope itemprop="blogPost">
  98. {{ if .Params.image }}
  99. <a href="{{ .Permalink }}">
  100. <img src="{{ $.Site.BaseURL }}img/{{ .Params.image }}" class="article-banner" itemprop="image">
  101. </a>
  102. {{end}}
  103. <h3 class="article-title" itemprop="name"><a href="{{ .Permalink }}" itemprop="url">{{ .Title }}</a></h3>
  104. {{ partial "article_metadata" (dict "content" . "is_list" 1) }}
  105. <p class="article-style" itemprop="articleBody">
  106. {{ if .Truncated }}
  107. {{ .Summary }}
  108. {{ else }}
  109. {{ .Content }}
  110. {{ end }}
  111. </p>
  112. <p class="read-more">
  113. <a href="{{ .Permalink }}" class="btn btn-primary btn-outline">
  114. {{ with .Site.Params.posts.str_read_more }}{{ . | markdownify }}{{ end }}
  115. </a>
  116. </p>
  117. </div>
  118. {{ end }}
  119. </div>
  120. </div>
  121. </div>
  122. </section>
  123. {{ end }}
  124. <!-- Projects Section -->
  125. {{ $projects_len := len (where .Data.Pages "Type" "project") }}
  126. {{ if gt $projects_len 0 }}
  127. <section id="projects" class="home-section">
  128. <div class="container">
  129. <div class="row">
  130. <div class="col-xs-12 col-md-4 section-heading">
  131. <h1>{{ with .Site.Params.projects.title }}{{ . | markdownify }}{{ end }}</h1>
  132. {{ with .Site.Params.projects.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  133. </div>
  134. <div class="col-xs-12 col-md-8">
  135. <ul class="fa-ul">
  136. {{ range where .Data.Pages "Type" "project" }}
  137. <li>
  138. <span class="project-title">
  139. {{ if .Content }}<a href="{{ .Permalink }}">{{ else }}{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}{{ end }}
  140. <i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
  141. {{ .Title }}
  142. {{ if .Content }}</a >{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
  143. </span>
  144. {{ with .Params.summary }}<p class="project-summary">{{ . }}</p>{{ end }}
  145. {{ if isset .Params "tags" }}
  146. {{ $tagsLen := len .Params.tags }}
  147. {{ if gt $tagsLen 0 }}
  148. <div class="project-tags">
  149. <i class="fa fa-tags"></i>
  150. {{ range $k, $v := .Params.tags }}
  151. {{ . }}{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
  152. {{ end }}
  153. </div>
  154. {{ end }}
  155. {{ end }}
  156. </li>
  157. {{ end }}
  158. </ul>
  159. </div>
  160. </div>
  161. </div>
  162. </section>
  163. {{ end }}
  164. <!-- Custom Sections -->
  165. {{ range $index, $page := where .Data.Pages "Type" "home" }}
  166. {{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
  167. {{ $title_words := split $page.Title " " }}
  168. <section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section">
  169. <div class="container">
  170. <div class="row">
  171. <div class="col-xs-12 col-md-4 section-heading">
  172. <h1>{{ title $page.Title }}</h1>
  173. {{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  174. </div>
  175. <div class="col-xs-12 col-md-8">
  176. {{ $page.Content }}
  177. </div>
  178. </div>
  179. </div>
  180. </section>
  181. {{ end }}
  182. {{ end }}
  183. <!-- Contact Section -->
  184. {{ if .Site.Params.contact.enable }}
  185. <section id="contact" class="home-section">
  186. <div class="container">
  187. <div class="row">
  188. <div class="col-xs-12 col-md-4 section-heading">
  189. <h1>{{ with .Site.Params.contact.title }}{{ . | markdownify }}{{ end }}</h1>
  190. {{ with .Site.Params.contact.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
  191. </div>
  192. <div class="col-xs-12 col-md-8">
  193. {{ partial "home_contact.html" . }}
  194. </div>
  195. </div>
  196. </div>
  197. </section>
  198. {{ end }}
  199. <!-- Page Footer -->
  200. {{ partial "footer_container.html" . }}
  201. {{ partial "footer.html" . }}