index.html 5.7 KB

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