index.html 7.7 KB

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