index.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. <h2>Recent Publications</h2>
  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>
  29. <i class="fa-li fa fa-file-text-o pub-icon" aria-hidden="true"></i>
  30. <span style="padding-right: 8px">{{ .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. <h2>Posts</h2>
  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 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. <h2>Projects</h2>
  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. {{ if .Content }}<a href="{{ .Permalink }}">{{ else }}{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}{{ end }}
  86. <i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
  87. <span style="padding-right: 8px">{{ .Title }}</span>
  88. {{ if .Content }}</a >{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
  89. {{ with .Params.summary }}<p>{{ . }}</p>{{ end }}
  90. </li>
  91. {{ end }}
  92. </ul>
  93. </div>
  94. </div>
  95. </div>
  96. </section>
  97. {{ end }}
  98. <!-- Custom Sections -->
  99. {{ range $index, $page := where .Data.Pages "Type" "home" }}
  100. {{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
  101. {{ $title_words := split $page.Title " " }}
  102. <section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section">
  103. <div class="container">
  104. <div class="row">
  105. <div class="col-xs-12 col-md-4">
  106. <h2>{{ title $page.Title }}</h2>
  107. </div>
  108. <div class="col-xs-12 col-md-8">
  109. {{ $page.Content }}
  110. </div>
  111. </div>
  112. </div>
  113. </section>
  114. {{ end }}
  115. {{ end }}
  116. <!-- Contact Section -->
  117. <section id="contact" class="home-section">
  118. <div class="container">
  119. <div class="row">
  120. <div class="col-xs-12 col-md-4">
  121. <h2>Contact</h2>
  122. </div>
  123. <div class="col-xs-12 col-md-8">
  124. {{ partial "home_contact.html" . }}
  125. </div>
  126. </div>
  127. </div>
  128. </section>
  129. <!-- Page Footer -->
  130. {{ partial "footer_container.html" . }}
  131. {{ partial "footer.html" . }}