Эх сурвалжийг харах

Merge https://github.com/gcushen/hugo-academic

Pull updates from upstream
Xi Ruoyao 6 жил өмнө
parent
commit
c4358cde4d
100 өөрчлөгдсөн 2559 нэмэгдсэн , 747 устгасан
  1. 1 0
      .gitignore
  2. 1 1
      LICENSE.md
  3. 29 9
      README.md
  4. BIN
      academic.png
  5. 8 5
      archetypes/default.md
  6. 25 0
      archetypes/docs.md
  7. 1 1
      archetypes/home.md
  8. 0 24
      archetypes/post.md
  9. 31 0
      archetypes/post/index.md
  10. 0 31
      archetypes/project.md
  11. 46 0
      archetypes/project/index.md
  12. 21 15
      archetypes/publication/index.md
  13. 15 0
      archetypes/slides.md
  14. 23 14
      archetypes/talk/index.md
  15. 31 0
      assets/css/reveal.css
  16. 0 0
      assets/css/reveal_custom.css
  17. 32 21
      assets/js/academic-search.js
  18. 77 9
      assets/js/academic.js
  19. 72 0
      assets/js/algolia-search.js
  20. 6 0
      assets/js/mathjax-config.js
  21. 1 1
      data/academic.toml
  22. 17 13
      data/assets.toml
  23. 2 0
      data/i18n/languages.yaml
  24. 20 0
      data/themes/apogee.toml
  25. 20 0
      data/themes/cupcake.toml
  26. 4 4
      data/themes/default.toml
  27. 1 1
      demo.sh
  28. 55 35
      exampleSite/config.toml
  29. 5 0
      exampleSite/content/home/contact.md
  30. 45 0
      exampleSite/content/home/experience.md
  31. 10 25
      exampleSite/content/home/hero.md
  32. 1 1
      exampleSite/content/home/hero_carousel.md
  33. 2 1
      exampleSite/content/home/posts.md
  34. 8 1
      exampleSite/content/home/projects.md
  35. 2 1
      exampleSite/content/home/publications.md
  36. 1 0
      exampleSite/content/home/publications_selected.md
  37. 0 12
      exampleSite/content/home/search.md
  38. 30 13
      exampleSite/content/home/skills.md
  39. 2 1
      exampleSite/content/home/talks.md
  40. 1 0
      exampleSite/content/home/talks_selected.md
  41. 2 3
      exampleSite/content/post/_index.md
  42. BIN
      exampleSite/content/post/getting-started/featured.jpg
  43. BIN
      exampleSite/content/post/getting-started/gallery/theme-1950s.png
  44. BIN
      exampleSite/content/post/getting-started/gallery/theme-apogee.png
  45. BIN
      exampleSite/content/post/getting-started/gallery/theme-coffee-playfair.png
  46. BIN
      exampleSite/content/post/getting-started/gallery/theme-cupcake.png
  47. BIN
      exampleSite/content/post/getting-started/gallery/theme-dark.png
  48. BIN
      exampleSite/content/post/getting-started/gallery/theme-default.png
  49. BIN
      exampleSite/content/post/getting-started/gallery/theme-forest.png
  50. BIN
      exampleSite/content/post/getting-started/gallery/theme-ocean.png
  51. 65 18
      exampleSite/content/post/getting-started/index.md
  52. 1 1
      exampleSite/content/privacy.md
  53. BIN
      exampleSite/content/project/external-project/featured.jpg
  54. 11 9
      exampleSite/content/project/external-project/index.md
  55. BIN
      exampleSite/content/project/internal-project/featured.jpg
  56. 31 15
      exampleSite/content/project/internal-project/index.md
  57. 1 2
      exampleSite/content/publication/_index.md
  58. 0 0
      exampleSite/content/publication/clothing-search/cite.bib
  59. BIN
      exampleSite/content/publication/clothing-search/featured.jpg
  60. 14 13
      exampleSite/content/publication/clothing-search/index.md
  61. BIN
      exampleSite/content/publication/person-re-id/featured.jpg
  62. 21 12
      exampleSite/content/publication/person-re-id/index.md
  63. 159 0
      exampleSite/content/slides/example-slides.md
  64. 2 3
      exampleSite/content/talk/_index.md
  65. 0 56
      exampleSite/content/talk/example-talk.md
  66. BIN
      exampleSite/content/talk/example/featured.jpg
  67. 78 0
      exampleSite/content/talk/example/index.md
  68. 27 0
      exampleSite/content/tutorial/_index.md
  69. 26 0
      exampleSite/content/tutorial/example.md
  70. BIN
      exampleSite/static/img/bubbles.jpg
  71. BIN
      exampleSite/static/img/headers/getting-started.png
  72. 160 0
      i18n/ca.yaml
  73. 95 2
      i18n/de.yaml
  74. 31 3
      i18n/en.yaml
  75. 74 3
      i18n/it.yaml
  76. 169 0
      i18n/ja.yaml
  77. 36 3
      i18n/zh.yaml
  78. BIN
      images/theme-apogee.png
  79. BIN
      images/theme-cupcake.png
  80. 4 4
      layouts/404.html
  81. 3 7
      layouts/_default/list.html
  82. 0 16
      layouts/_default/list.search.json
  83. 2 4
      layouts/_default/single.html
  84. 1 0
      layouts/docs/list.html
  85. 1 0
      layouts/docs/single.html
  86. 28 0
      layouts/index.json
  87. 1 1
      layouts/partials/cookie_consent.html
  88. 450 161
      layouts/partials/css/academic.css
  89. 12 0
      layouts/partials/css/parse_theme.css
  90. 53 0
      layouts/partials/docs_layout.html
  91. 37 0
      layouts/partials/docs_sidebar.html
  92. 0 0
      layouts/partials/docs_toc_foot.html
  93. 59 78
      layouts/partials/footer.html
  94. 13 36
      layouts/partials/footer_container.html
  95. 25 0
      layouts/partials/footer_section.html
  96. 27 14
      layouts/partials/header.html
  97. 0 12
      layouts/partials/header_image.html
  98. 52 32
      layouts/partials/navbar.html
  99. 45 0
      layouts/partials/page_author.html
  100. 97 0
      layouts/partials/page_header.html

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 # IDE specific
 .idea/
 .vscode/
+resources/

+ 1 - 1
LICENSE.md

@@ -1,6 +1,6 @@
 The MIT License (MIT)
 
-Copyright (c) 2016 George Cushen
+Copyright (c) 2016-present George Cushen
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the "Software"), to deal in

+ 29 - 9
README.md

@@ -1,12 +1,26 @@
+<p align="center"><a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener"><img src="https://sourcethemes.com/academic/img/logo_200px.png" alt="Academic logo"></a></p>
+
 # Academic: the website designer for [Hugo](https://gohugo.io)
 
-**Academic** is a framework to help you create a beautiful website quickly. Perfect for personal sites, blogs, or business/project sites. [Check out the latest demo](https://themes.gohugo.io/theme/academic/) of what you'll get in less than 10 minutes. Then head on over to the [Quick Start guide](https://sourcethemes.com/academic/docs/) or take a look at the [Release Notes](https://sourcethemes.com/academic/updates/).
+**Academic** makes it easy to create a beautiful website for free using Markdown. Customize anything on your site with widgets, themes, and language packs.
+
+Follow our easy [step by step guide](https://sourcethemes.com/academic/docs/install/) to learn how to build your own free website with Academic. [Check out the personal demo](https://themes.gohugo.io/theme/academic/) or the [business demo](https://sourcethemes.com/academic/) of what you'll get in less than 10 minutes.
+
+- [View the documentation](https://sourcethemes.com/academic/docs/)
+- [Ask a question](http://discuss.gohugo.io/)
+- [Request a feature or report a bug](https://github.com/gcushen/hugo-academic/issues)
+- Updating? View the [Update Guide](https://sourcethemes.com/academic/docs/update/) and [Release Notes](https://sourcethemes.com/academic/updates/)
+- Support development of Academic:
+  - [Donate a coffee](https://paypal.me/cushen)
+  - [Become a backer on Patreon](https://www.patreon.com/cushen)
+  - [Decorate your laptop or journal with an Academic sticker](https://www.redbubble.com/people/neutreno/works/34387919-academic)
+  - [Wear the T-shirt](https://academic.threadless.com/)
 
 [![Screenshot](https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png)](https://github.com/gcushen/hugo-academic/)
 
-Key features:
+**Key features:**
 
-- Easily manage various content including homepage, blog posts, publications, talks, and projects
+- Easily manage various content including homepage, blog posts, publications, talks, slides, and projects
 - Extensible via **color themes** and **widgets/plugins**
 - Write in [Markdown](https://sourcethemes.com/academic/docs/writing-markdown-latex/) for easy formatting and code highlighting, with [LaTeX](https://en.wikibooks.org/wiki/LaTeX/Mathematics) for mathematical expressions
 - Social/academic network linking, [Google Analytics](https://analytics.google.com), and [Disqus](https://disqus.com) comments
@@ -18,13 +32,19 @@ Key features:
 
 Academic is available in different color themes and font themes.
 
-| `default` | `ocean` | `dark` |
-| --- | --- | --- |
-| ![default theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-default.png) | ![ocean theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-ocean.png) | ![dark theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-dark.png) |
+| `default` | `ocean` | `forest` | `dark` |
+| --- | --- | --- | --- |
+| ![default theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-default.png) | ![ocean theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-ocean.png) | ![forest theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-forest.png) | ![dark theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-dark.png) |
+
+| `apogee` | `1950s` | `coffee` | `cupcake` |
+| --- | --- | --- | --- |
+| ![apogee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-apogee.png) | ![1950s theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-1950s.png) | ![coffee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png) | ![cupcake theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-cupcake.png) |
+
+## Ecosystem
 
-| `forest` | `coffee` + `playfair` font | `1950s` |
-| --- | --- | --- |
-| ![forest theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-forest.png) | ![coffee theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png) | ![1950s theme](https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-1950s.png) |
+* **[Academic Admin](https://github.com/sourcethemes/academic-admin):** An admin tool to import publications from BibTeX or import assets for an offline site
+* **[Academic Scripts](https://github.com/sourcethemes/academic-scripts):** Scripts to help migrate content to new versions of Academic
+* **[Project KickstartR](https://github.com/sourcethemes/project-kickstart-r):** Create a Project, Team, or Conference **Landing Page** and **Knowledge Sharing Platform** with (R) Markdown
 
 ## Install
 

BIN
academic.png


+ 8 - 5
archetypes/default.md

@@ -1,5 +1,5 @@
 +++
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
+title = "{{ replace .Name "-" " " | title }}"
 date = {{ .Date }}
 draft = false
 
@@ -9,9 +9,12 @@ tags = []
 categories = []
 
 # Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = ""
-caption = ""
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = ""
 
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
 +++

+ 25 - 0
archetypes/docs.md

@@ -0,0 +1,25 @@
++++
+title = "{{ replace .Name "-" " " | title }}"
+date = {{ .Date }}
+draft = false
+type = "docs"  # Do not modify.
+
+# Show table of contents? true/false
+toc = true
+
+# Add menu entry to sidebar.
+
+# Uncomment to customize menu title, e.g. to abbreviate page title.
+# linktitle = "Example"
+
+# Substitute `tutorial` with the name of your tutorials folder.
+[menu.tutorial]
+  # Define a parent ID if this page is a parent.
+  name = "YourParentID"
+  
+  # Reference a parent ID if this page is a child.
+  # parent = "YourParentID"
+  
+  # Order that this page appears in the menu.
+  weight = 1
++++

+ 1 - 1
archetypes/home.md

@@ -5,7 +5,7 @@ active = true
 date = {{ .Date }}
 
 # Note: a full width section format can be enabled by commenting out the `title` and `subtitle` with a `#`.
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
+title = "{{ replace .Name "-" " " | title }}"
 subtitle = ""
 
 # Order that this section will appear in.

+ 0 - 24
archetypes/post.md

@@ -1,24 +0,0 @@
-+++
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
-date = {{ .Date }}
-draft = false
-
-# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
-authors = []
-
-# Tags and categories
-# For example, use `tags = []` for no tags, or the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
-tags = []
-categories = []
-
-# Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-# Use `caption` to display an image caption.
-#   Markdown linking is allowed, e.g. `caption = "[Image credit](http://example.org)"`.
-# Set `preview` to `false` to disable the thumbnail in listings.
-[header]
-image = ""
-caption = ""
-preview = true
-
-+++

+ 31 - 0
archetypes/post/index.md

@@ -0,0 +1,31 @@
++++
+title = "{{ replace .Name "-" " " | title }}"
+date = {{ .Date }}
+draft = false
+
+# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
+authors = []
+
+# Tags and categories
+# For example, use `tags = []` for no tags, or the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
+tags = []
+categories = []
+
+# Projects (optional).
+#   Associate this post with one or more of your projects.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
+#   Otherwise, set `projects = []`.
+# projects = ["internal-project"]
+
+# Featured image
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = ""
+
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
++++

+ 0 - 31
archetypes/project.md

@@ -1,31 +0,0 @@
-+++
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
-date = {{ .Date }}
-draft = false
-
-# Tags: can be used for filtering projects.
-# Example: `tags = ["machine-learning", "deep-learning"]`
-tags = []
-
-# Project summary to display on homepage.
-summary = ""
-
-# Optional image to display on homepage.
-image_preview = ""
-
-# Optional external URL for project (replaces project detail page).
-external_link = ""
-
-# Does the project detail page use math formatting?
-math = false
-
-# Does the project detail page use source code highlighting?
-highlight = true
-
-# Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = ""
-caption = ""
-
-+++

+ 46 - 0
archetypes/project/index.md

@@ -0,0 +1,46 @@
++++
+title = "{{ replace .Name "-" " " | title }}"
+date = {{ .Date }}
+draft = false
+
+# Tags: can be used for filtering projects.
+# Example: `tags = ["machine-learning", "deep-learning"]`
+tags = []
+
+# Project summary to display on homepage.
+summary = ""
+
+# Slides (optional).
+#   Associate this page with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = ""
+
+# Optional external URL for project (replaces project detail page).
+external_link = ""
+
+# Links (optional).
+url_pdf = ""
+url_code = ""
+url_dataset = ""
+url_project = ""
+url_slides = ""
+url_video = ""
+url_poster = ""
+
+# Custom links (optional).
+#   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
+# url_custom = [{icon_pack = "fab", icon="twitter", name="Follow", url = "https://twitter.com"}]
+
+# Featured image
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = ""
+
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
++++

+ 21 - 15
archetypes/publication.md → archetypes/publication/index.md

@@ -1,5 +1,5 @@
 +++
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
+title = "{{ replace .Name "-" " " | title }}"
 date = {{ .Date }}
 draft = false
 
@@ -25,19 +25,25 @@ publication_short = ""
 abstract = ""
 abstract_short = ""
 
-# Featured image thumbnail (optional)
-image_preview = ""
-
 # Is this a selected publication? (true/false)
 selected = false
 
 # Projects (optional).
 #   Associate this publication with one or more of your projects.
-#   Simply enter your project's filename without extension.
-#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
 #   Otherwise, set `projects = []`.
 projects = []
 
+# Slides (optional).
+#   Associate this page with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = ""
+
 # Tags (optional).
 #   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
 tags = []
@@ -57,16 +63,16 @@ url_source = ""
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 # url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
-# Does this page contain LaTeX math? (true/false)
-math = false
-
-# Does this page require source code highlighting? (true/false)
-highlight = true
+# Digital Object Identifier (DOI)
+doi = ""
 
 # Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = ""
-caption = ""
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = ""
 
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
 +++

+ 15 - 0
archetypes/slides.md

@@ -0,0 +1,15 @@
++++
+title = "{{ replace .Name "-" " " | title }}"
+
+[slides]
+# Choose a theme from https://github.com/hakimel/reveal.js#theming
+theme = "black"
++++
+
+# Title
+
+Author Name
+
+---
+
+## Slide 2

+ 23 - 14
archetypes/talk.md → archetypes/talk/index.md

@@ -1,5 +1,5 @@
 +++
-title = "{{ replace .TranslationBaseName "-" " " | title }}"
+title = "{{ replace .Name "-" " " | title }}"
 date = {{ .Date }}  # Schedule page publish date.
 draft = false
 
@@ -8,6 +8,9 @@ draft = false
 time_start = {{ .Date }}
 time_end = {{ .Date }}
 
+# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
+authors = []
+
 # Abstract and optional shortened version.
 abstract = ""
 abstract_short = ""
@@ -24,11 +27,20 @@ selected = false
 
 # Projects (optional).
 #   Associate this talk with one or more of your projects.
-#   Simply enter your project's filename without extension.
-#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
 #   Otherwise, set `projects = []`.
 projects = []
 
+# Slides (optional).
+#   Associate this page with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = ""
+
 # Tags (optional).
 #   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
 tags = []
@@ -39,16 +51,13 @@ url_slides = ""
 url_video = ""
 url_code = ""
 
-# Does the content use math formatting?
-math = false
-
-# Does the content use source code highlighting?
-highlight = true
-
 # Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = ""
-caption = ""
-
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = ""
+
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
 +++

+ 31 - 0
assets/css/reveal.css

@@ -0,0 +1,31 @@
+/*************************************************
+ *  Reveal JS
+ **************************************************/
+
+/* This is a copy of MathJax's `.mjx-chtml` with font-family added to override `.reveal span`. */
+/* See https://github.com/hakimel/reveal.js/issues/1924 */
+.reveal span.mjx-chtml {
+  display: inline-block;
+  line-height: 0;
+  text-indent: 0;
+  text-align: left;
+  text-transform: none;
+  font-style: normal;
+  font-weight: normal;
+  font-size: 100%;
+  font-size-adjust: none;
+  letter-spacing: normal;
+  word-wrap: normal;
+  word-spacing: normal;
+  white-space: nowrap;
+  float: none;
+  direction: ltr;
+  max-width: none;
+  max-height: none;
+  min-width: 0;
+  min-height: 0;
+  border: 0;
+  margin: 0;
+  padding: 1px 0;
+  font-family: MJXc-TeX-math-I,MJXc-TeX-math-Ix,MJXc-TeX-math-Iw;
+}

+ 0 - 0
assets/css/reveal_custom.css


+ 32 - 21
static/js/search.js → assets/js/academic-search.js

@@ -1,6 +1,8 @@
 /*************************************************
- *  Academic: the website framework for Hugo.
+ *  Academic
  *  https://github.com/gcushen/hugo-academic
+ *
+ *  In-built Fuse based search algorithm.
  **************************************************/
 
 /* ---------------------------------------------------------------------------
@@ -49,8 +51,9 @@ function initSearch(force, fuse) {
   let query = $("#search-query").val();
 
   // If query deleted, clear results.
-  if ( query.length < 1)
+  if ( query.length < 1) {
     $('#search-hits').empty();
+  }
 
   // Check for timer event (enter key not pressed) and query less than minimum length required.
   if (!force && query.length < fuseOptions.minMatchCharLength)
@@ -67,7 +70,9 @@ function initSearch(force, fuse) {
 function searchAcademic(query, fuse) {
   let results = fuse.search(query);
   // console.log({"results": results});
+
   if (results.length > 0) {
+    $('#search-hits').append('<h3 class="mt-0">' + results.length + ' ' + i18n.results + '</h3>');
     parseResults(query, results);
   } else {
     $('#search-hits').append('<div class="search-no-results">' + i18n.no_results + '</div>');
@@ -102,7 +107,7 @@ function parseResults(query, results) {
     var template = $('#search-hit-fuse-template').html();
 
     // Localize content types.
-    let content_key = value.item.type;
+    let content_key = value.item.section;
     if (content_key in content_type) {
       content_key = content_type[content_key];
     }
@@ -141,25 +146,31 @@ function render(template, data) {
 * Initialize.
 * --------------------------------------------------------------------------- */
 
+// If Academic's in-built search is enabled and Fuse loaded, then initialize it.
+if (typeof Fuse === 'function') {
 // Wait for Fuse to initialize.
-$.getJSON( search_index_filename, function( search_index ) {
-  let fuse = new Fuse(search_index, fuseOptions);
-
-  // On page load, check for search query in URL.
-  if (query = getSearchQuery('q')) {
-    $("#search-query").val(query);
-    initSearch(true, fuse);
-  }
-
-  // On search box key up, process query.
-  $('#search-query').keyup(function (e) {
-    clearTimeout($.data(this, 'searchTimer')); // Ensure only one timer runs!
-    if (e.keyCode == 13) {
+  $.getJSON(search_index_filename, function (search_index) {
+    let fuse = new Fuse(search_index, fuseOptions);
+
+    // On page load, check for search query in URL.
+    if (query = getSearchQuery('q')) {
+      $("body").addClass('searching');
+      $('.search-results').css({opacity: 0, visibility: "visible"}).animate({opacity: 1},200);
+      $("#search-query").val(query);
+      $("#search-query").focus();
       initSearch(true, fuse);
-    } else {
-      $(this).data('searchTimer', setTimeout(function () {
-        initSearch(false, fuse);
-      }, 250));
     }
+
+    // On search box key up, process query.
+    $('#search-query').keyup(function (e) {
+      clearTimeout($.data(this, 'searchTimer')); // Ensure only one timer runs!
+      if (e.keyCode == 13) {
+        initSearch(true, fuse);
+      } else {
+        $(this).data('searchTimer', setTimeout(function () {
+          initSearch(false, fuse);
+        }, 250));
+      }
+    });
   });
-});
+}

+ 77 - 9
static/js/hugo-academic.js → assets/js/academic.js

@@ -1,6 +1,8 @@
 /*************************************************
- *  Academic: the personal website framework for Hugo.
+ *  Academic
  *  https://github.com/gcushen/hugo-academic
+ *
+ *  Core JS functions and initialization.
  **************************************************/
 
 (function($){
@@ -10,7 +12,7 @@
    * --------------------------------------------------------------------------- */
 
   // Dynamically get responsive navigation bar offset.
-  let $navbar = $('.navbar-header');
+  let $navbar = $('.navbar');
   let navbar_offset = $navbar.innerHeight();
 
   /**
@@ -41,7 +43,7 @@
     let $body = $('body');
     let data = $body.data('bs.scrollspy');
     if (data) {
-      data.options.offset = navbar_offset;
+      data._config.offset = navbar_offset;
       $body.data('bs.scrollspy', data);
       $body.scrollspy('refresh');
     }
@@ -54,7 +56,7 @@
    * Add smooth scrolling to all links inside the main navbar.
    * --------------------------------------------------------------------------- */
 
-  $('#navbar-main li.nav-item a').on('click', function(event) {
+  $('#navbar-main li.nav-item a.nav-link').on('click', function(event) {
     // Store requested URL hash.
     let hash = this.hash;
 
@@ -88,7 +90,7 @@
    * Hide mobile collapsable menu on clicking a link.
    * --------------------------------------------------------------------------- */
 
-  $(document).on('click', '.navbar-collapse.in', function(e) {
+  $(document).on('click', '.navbar-collapse.show', function(e) {
     //get the <a> element that was clicked, even if the <span> element that is inside the <a> element is e.target
     let targetElement = $(e.target).is('a') ? $(e.target) : $(e.target).parent();
 
@@ -184,7 +186,7 @@
       let zoom = parseInt($('#map-zoom').val());
       let address = $('#map-dir').val();
       let api_key = $('#map-api-key').val();
-      
+
       if ( map_provider == 1 ) {
         let map = new GMaps({
           div: '#map',
@@ -235,6 +237,35 @@
     }
   }
 
+  /* ---------------------------------------------------------------------------
+   * GitHub API.
+   * --------------------------------------------------------------------------- */
+
+  function printLatestRelease(selector, repo) {
+    $.getJSON('https://api.github.com/repos/' + repo + '/tags').done(function (json) {
+      let release = json[0];
+      $(selector).append(release.name);
+    }).fail(function( jqxhr, textStatus, error ) {
+      let err = textStatus + ", " + error;
+      console.log( "Request Failed: " + err );
+    });
+  }
+
+  /* ---------------------------------------------------------------------------
+  * Toggle search dialog.
+  * --------------------------------------------------------------------------- */
+
+  function toggleSearchDialog() {
+    if ($('body').hasClass('searching')) {
+      $('[id=search-query]').blur();
+      $('body').removeClass('searching');
+    } else {
+      $('body').addClass('searching');
+      $('.search-results').css({opacity: 0, visibility: 'visible'}).animate({opacity: 1}, 200);
+      $('#search-query').focus();
+    }
+  }
+
   /* ---------------------------------------------------------------------------
    * On window load.
    * --------------------------------------------------------------------------- */
@@ -244,8 +275,11 @@
       // When accessing homepage from another page and `#top` hash is set, show top of page (no hash).
       if (window.location.hash == "#top") {
         window.location.hash = ""
-      } else {
-        // If URL contains a hash, scroll to target ID taking into account responsive offset.
+      } else if (!$('.projects-container').length) {
+        // If URL contains a hash and there are no dynamically loaded images on the page,
+        // immediately scroll to target ID taking into account responsive offset.
+        // Otherwise, wait for `imagesLoaded()` to complete before scrolling to hash to prevent scrolling to wrong
+        // location.
         scrollToAnchor();
       }
     }
@@ -277,6 +311,7 @@
           layoutMode: layout,
           filter: $section.find('.default-project-filter').text()
         });
+
         // Filter items when filter link is clicked.
         $section.find('.project-filters a').click(function() {
           let selector = $(this).attr('data-filter');
@@ -284,6 +319,15 @@
           $(this).removeClass('active').addClass('active').siblings().removeClass('active all');
           return false;
         });
+
+        // If window hash is set, scroll to hash.
+        // Placing this within `imagesLoaded` prevents scrolling to the wrong location due to dynamic image loading
+        // affecting page layout and position of the target anchor ID.
+        // Note: If there are multiple project widgets on a page, ideally only perform this once after images
+        // from *all* project widgets have finished loading.
+        if (window.location.hash) {
+          scrollToAnchor();
+        }
       });
     });
 
@@ -299,7 +343,7 @@
       e.preventDefault();
       let filename = $(this).attr('data-filename');
       let modal = $('#modal');
-      modal.find('.modal-body').load( filename , function( response, status, xhr ) {
+      modal.find('.modal-body code').load( filename , function( response, status, xhr ) {
         if ( status == 'error' ) {
           let msg = "Error: ";
           $('#modal-error').html( msg + xhr.status + " " + xhr.statusText );
@@ -330,6 +374,30 @@
 
     // Initialise Google Maps if necessary.
     initMap();
+
+    // Fix Hugo's inbuilt Table of Contents.
+    $('#TableOfContents > ul > li > ul').unwrap().unwrap();
+
+    // Print latest Academic version if necessary.
+    if ($('#academic-release').length > 0)
+      printLatestRelease('#academic-release', $('#academic-release').data('repo'));
+
+    // On search icon click toggle search dialog.
+    $('.js-search').click(function(e) {
+      e.preventDefault();
+      toggleSearchDialog();
+    });
+    $(document).on('keydown', function(e){
+      if (e.which == 27) {
+        if ($('body').hasClass('searching')) {
+          toggleSearchDialog();
+        }
+      } else if (e.which == 191) {
+        e.preventDefault();
+        toggleSearchDialog();
+      }
+    });
+
   });
 
 })(jQuery);

+ 72 - 0
assets/js/algolia-search.js

@@ -0,0 +1,72 @@
+/*************************************************
+ *  Academic
+ *  https://github.com/gcushen/hugo-academic
+ *
+ *  Algolia based search algorithm.
+ **************************************************/
+
+if ((typeof instantsearch === 'function') && $('#search-box').length) {
+  function getTemplate(templateName) {
+    return document.querySelector(`#${templateName}-template`).innerHTML;
+  }
+
+  const options = {
+    appId: algoliaConfig.appId,
+    apiKey: algoliaConfig.apiKey,
+    indexName: algoliaConfig.indexName,
+    routing: true,
+    searchParameters: {
+      hitsPerPage: 10
+    },
+    searchFunction: function (helper) {
+      let searchResults = document.querySelector('#search-hits')
+      if (helper.state.query === '') {
+        searchResults.style.display = 'none';
+        return;
+      }
+      helper.search();
+      searchResults.style.display = 'block';
+    }
+  };
+
+  const search = instantsearch(options);
+
+  // Initialize search box.
+  search.addWidget(
+    instantsearch.widgets.searchBox({
+      container: '#search-box',
+      autofocus: false,
+      reset: true,
+      poweredBy: algoliaConfig.poweredBy,
+      placeholder: i18n.placeholder
+    })
+  );
+
+  // Initialize search results.
+  search.addWidget(
+    instantsearch.widgets.infiniteHits({
+      container: '#search-hits',
+      escapeHits: true,
+      templates: {
+        empty: '<div class="search-no-results">' + i18n.no_results + '</div>',
+        item: getTemplate('search-hit-algolia')
+      },
+      cssClasses: {
+        showmoreButton: 'btn btn-outline-primary'
+      }
+    })
+  );
+
+  // On render search results, localize the content type metadata.
+  search.on('render', function () {
+    $('.search-hit-type').each(function (index) {
+      let content_key = $(this).text();
+      if (content_key in content_type) {
+        $(this).text(content_type[content_key]);
+      }
+    });
+  });
+
+  // Start search.
+  search.start();
+}

+ 6 - 0
assets/js/mathjax-config.js

@@ -0,0 +1,6 @@
+window.MathJax = {
+  CommonHTML: { linebreaks: { automatic: true } },
+  tex2jax: { inlineMath: [ ['$', '$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[', '\\]'] ], processEscapes: false },
+  TeX: { noUndefined: { attributes: { mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%' } } },
+  messageStyle: 'none'
+};

+ 1 - 1
data/academic.toml

@@ -1,3 +1,3 @@
 # Academic
 
-version = "2.4.0"
+version = "3.1.1"

+ 17 - 13
data/assets.toml

@@ -8,12 +8,12 @@
 # JavaScript
 
 [js.jQuery]
-  version = "3.2.1"
-  sri = "sha512-3P8rXCuGJdNZOnUx/03c1jOTnMn3rP63nBip5gOP2qmUh5YAdVAvFZ1E+QLZZbC1rtMrQb+mah3AfYW11RUrWA=="
+  version = "3.3.1"
+  sri = "sha512-+NqPlbbtM1QqiK8ZAo4Yrj2c4lNQoGv8P79DPtKzj++l5jnN39rHA/xsqn8zE9l0uSoxaCdrOgFs6yjyfbBxSg=="
   url = "https://cdnjs.cloudflare.com/ajax/libs/jquery/%s/jquery.min.js"
 [js.bootstrap]
-  version = "3.3.7"
-  sri = "sha512-iztkobsvnjKfAtTNdHkGVjAYTrrtlC7mGp/54c40wowO7LhURYl3gVzzcEqGl/qKXQltJ2HwMrdLcNUdo+N/RQ=="
+  version = "4.1.3"
+  sri = "sha256-VsEqElsCHSGmnmHXGQzvoWjWwoznFSZc6hs7ARLRacQ="
   url = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/%s/js/bootstrap.min.js"
 [js.highlight]
   version = "9.12.0"
@@ -56,20 +56,24 @@
   sri = "sha256-4HLtjeVgH0eIB3aZ9mLYF6E8oU5chNdjU6p6rrXpl9U="
   url = "https://cdnjs.cloudflare.com/ajax/libs/mark.js/%s/jquery.mark.min.js"
 [js.instantsearch]
-  version = "2.9.0"
-  sri = "sha256-cJXigylnJlxvAdfFNHeS+IiMcKWS3Rf/cy3bl9bb0ng="
+  version = "2.10.2"
+  sri = "sha256-gFCtPk/sonctyfwYOgjrPoWApQ0rqB6ezBBZ7p32yGc="
   url = "https://cdnjs.cloudflare.com/ajax/libs/instantsearch.js/%s/instantsearch.min.js"
+[js.anchor]
+  version = "4.1.1"
+  sri = "sha256-pB/deHc9CGfFpJRjC43imB29Rse8tak+5eXqntO94ck="
+  url = "https://cdnjs.cloudflare.com/ajax/libs/anchor-js/%s/anchor.min.js"
 
 # CSS
 
 [css.bootstrap]
-  version = "3.3.7"
-  sri = "sha512-6MXa8B6uaO18Hid6blRMetEIoPqHf7Ux1tnyIQdpt9qI5OACx7C+O3IVTr98vwGnlcg0LOLa02i9Y1HpVhlfiw=="
+  version = "4.1.3"
+  sri = "sha256-eSi1q2PG6J7g7ib17yAaWMcrr5GrtohYChqibrV7PBE="
   url = "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/%s/css/bootstrap.min.css"
 [css.fontAwesome]
-  version = "4.7.0"
-  sri = "sha512-SfTiTlX6kk+qitfevl/7LibUOeJWlt9rbyDn92a1DqWOw9vWG2MFoays0sgObmWazO5BQPiFucnnEAjpAB+/Sw=="
-  url = "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/%s/css/font-awesome.min.css"
+  version = "5.4.1"
+  sri = "sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz"
+  url = "https://use.fontawesome.com/releases/v%s/css/all.css"
 [css.academicons]
   version = "1.8.6"
   sri = "sha256-uFVgMKfistnJAfoCUQigIl+JfUaP47GrRKjf6CTPVmw="
@@ -87,8 +91,8 @@
   sri = "sha256-ZtmLe16p4jS4/2wPwwH6NzJt460SJzgLmhKrYo5yn7g="
   url = "https://cdnjs.cloudflare.com/ajax/libs/instantsearch.js/%s/instantsearch.min.css"
 [css.instantsearchTheme]
-  version = "2.9.0"
-  sri = "sha256-0vcZrdMQksHcHrY60tPnVK71jnB3wX/JpMcah5BffjA="
+  version = "2.10.2"
+  sri = "sha256-uL8LUd3zkI/lXvc/Hv/oOu8ld6RJcOZiUY/8c+I+3/o="
   url = "https://cdnjs.cloudflare.com/ajax/libs/instantsearch.js/%s/instantsearch-theme-algolia.min.css"
 [css.highlight]
   version = "9.12.0"

+ 2 - 0
data/i18n/languages.yaml

@@ -1,3 +1,4 @@
+"ca": "Català"
 "de": "Deutsch"
 "el": "Ελληνικά"
 "en": "English"
@@ -6,6 +7,7 @@
 "fr": "Français"
 "id": "Bahasa Indonesia"
 "it": "Italiano"
+"ja": "日本語"
 "ko": "한국어"
 "nl": "Nederlands"
 "pl": "Polski"

+ 20 - 0
data/themes/apogee.toml

@@ -0,0 +1,20 @@
+# Theme metadata
+name = "Apogee"
+
+# Is theme light or dark?
+light = false
+
+# Primary
+primary = "#EAF04E"
+primary_light = "#F8FD74"
+primary_dark = "#D7DE26"
+
+# Menu
+menu_primary = "#312450"
+menu_text = "#F2BE4E"
+menu_text_active = "#FFE1A0"
+menu_title = "#E0A526"
+
+# Home sections
+home_section_odd = "#5e42a6"
+home_section_even = "#5e42a6"

+ 20 - 0
data/themes/cupcake.toml

@@ -0,0 +1,20 @@
+# Theme metadata
+name = "Cupcake"
+
+# Is theme light or dark?
+light = true
+
+# Primary
+primary = "#EC407A"
+primary_light = "#F793B5"
+primary_dark = "#CD0045"
+
+# Menu
+menu_primary = "#BE37C7"
+menu_text = "#FFB298"
+menu_text_active = "#fff"
+menu_title = "#FFB298"
+
+# Home sections
+home_section_odd = "#FFB298"
+home_section_even = "#FFB298"

+ 4 - 4
data/themes/default.toml

@@ -5,14 +5,14 @@ name = "Default"
 light = true
 
 # Primary
-primary = "#0095eb"
-primary_light = "#6ec6ff"
-primary_dark = "#0069c0"
+primary = "#2962ff"
+primary_light = "#768fff"
+primary_dark = "#0039cb"
 
 # Menu
 menu_primary = "#fff"
 menu_text = "#34495e"
-menu_text_active = "#0095eb"
+menu_text_active = "#2962ff"
 menu_title = "#2b2b2b"
 
 # Home sections

+ 1 - 1
demo.sh

@@ -1,4 +1,4 @@
 #!/usr/bin/env bash
 
 cd exampleSite
-hugo -t academic --themesDir ../.. -p 1315 --i18n-warnings server
+hugo -t "academic" --themesDir ../../ -p 1315 --i18n-warnings server

+ 55 - 35
exampleSite/config.toml

@@ -37,15 +37,9 @@ defaultContentLanguageInSubdir = false
 enableGitInfo = false
 
 [outputs]
-  home = [ "HTML", "CSS", "RSS", "search" ]
+  home = [ "HTML", "CSS", "RSS", "JSON" ]
   section = [ "HTML", "RSS" ]
 
-[outputFormats.search]
-  baseName = "search"
-  isPlainText = true
-  mediaType = "application/json"
-  notAlternative = true
-
 # Configure BlackFriday Markdown rendering.
 #   See: https://gohugo.io/getting-started/configuration/#configure-blackfriday
 [blackfriday]
@@ -54,13 +48,7 @@ enableGitInfo = false
   smartypants = true  # `false` disables all smart punctuation substitutions (e.g. smart quotes, dashes, fractions).
 
 [params]
-  # Color theme.
-  #   Choose from `default`, `ocean`, `forest`, `coffee`, `dark`, or `1950s`.
-  color_theme = "default"
-
-  # Font style.
-  #   Choose from `default`, `classic`, or `playfair`.
-  font = "default"
+  # AUTHOR SETUP
 
   # Your details.
   name = "Lena Smith"
@@ -72,24 +60,20 @@ enableGitInfo = false
 
   gravatar = false  # Get your avatar from Gravatar.com? (true/false)
   avatar = "portrait.jpg"  # Specify an avatar image (in `static/img/` folder) or delete value to disable avatar.
+
+  # Details for the Contact Widget
   email = "test@example.org"
   address = "Building 1 Room 1, Stanford University, California, 90210, USA"
   office_hours = "Monday 10:00 to 13:00 or email for appointment"
   phone = "888 888 88 88"
   skype = "echo123"
   telegram = ""
-
-  # Enable Keybase in Contact widget by entering your keybase.io username.
-  keybase = ""
+  keybase = ""  # Your keybase.io username.
 
   # Discussion link (e.g. link to a forum, mailing list, or chat).
   #   Uncomment line below to use.
   #   discussion = { name = "Discuss", url = "https://discourse.gohugo.io" }
 
-  # Diplay a logo in navigation bar rather than title (optional).
-  #   To enable, place an image in `static/img/` and reference its filename below. To disable, set the value to "".
-  logo = ""
-
   # Enable/disable map in Contact widget.
   # To show your address on a map in the contact widget, you need to enter your latitude, longitude and choose
   # a map provider below.
@@ -111,6 +95,29 @@ enableGitInfo = false
   longitude = "-122.1697"
   zoom = 15
 
+  # SITE SETUP
+
+  # Color theme.
+  #   Choose from `default`, `ocean`, `forest`, `dark`, `apogee`, `1950s`, `coffee`, `cupcake`.
+  color_theme = "default"
+
+  # Font style.
+  #   Choose from `default`, `classic`, or `playfair`.
+  font = "default"
+
+  # Description for social sharing and search engines. If undefined, author role is used in place.
+  description = ""
+
+  # Default image for social sharing and search engines. Place image in `static/img/` folder and specify image name here.
+  sharing_image = ""
+
+  # Twitter username (without @). Used when a vistor shares your site on Twitter.
+  twitter = ""
+
+  # Diplay a logo in navigation bar rather than title (optional).
+  #   To enable, place an image in `static/img/` and reference its filename below. To disable, set the value to "".
+  logo = ""
+
   # Date and time format (refer to https://sourcethemes.com/academic/docs/customization/#date-format )
   #   Examples: "Mon, Jan 2, 2006" or "2006-01-02"
   date_format = "Jan 2, 2006"
@@ -205,40 +212,53 @@ enableGitInfo = false
     # List publications and talks related to the project?
     list_children = true
 
+    # Post list format.
+    #   0 = Simple
+    #   1 = Detailed
+    #   2 = Stream
+    post_format = 2
+
     # Publication list format.
     #   0 = Simple
     #   1 = Detailed
     #   2 = APA
     #   3 = MLA
-    publication_format = 3
+    #   4 = Stream
+    publication_format = 4
+
+    # Talk list format.
+    #   0 = Simple
+    #   1 = Detailed
+    #   2 = Stream
+    talk_format = 2
 
   # Social/Academic Networking
   #
-  # Icon pack "fa" includes the following social network icons:
+  # Icon pack "fab" includes the following social network icons:
   #
   #   twitter, weibo, linkedin, github, facebook, pinterest, google-plus,
   #   youtube, instagram, soundcloud
   #
-  #   For email icon, use "fa" icon pack, "envelope" icon, and
+  #   For email icon, use "fas" icon pack, "envelope" icon, and
   #   "mailto:your@email.com" as the link.
   #
-  #   Full list: https://fortawesome.github.io/Font-Awesome/icons/
+  #   Full list: https://fontawesome.com/icons
   #
-  # Icon pack "ai" includes the following academic network icons:
+  # Icon pack "ai" includes the following academic icons:
   #
-  #   google-scholar, arxiv, orcid, researchgate, mendeley
+  #   cv, google-scholar, arxiv, orcid, researchgate, mendeley
   #
   #   Full list: https://jpswalsh.github.io/academicons/
 
   [[params.social]]
     icon = "envelope"
-    icon_pack = "fa"
-    link = "mailto:test@example.org"
+    icon_pack = "fas"
+    link = "#contact"  # For a direct email link, use "mailto:test@example.org".
 
   [[params.social]]
     icon = "twitter"
-    icon_pack = "fa"
-    link = "//twitter.com/GeorgeCushen"
+    icon_pack = "fab"
+    link = "https://twitter.com/GeorgeCushen"
 
   [[params.social]]
     icon = "google-scholar"
@@ -247,8 +267,8 @@ enableGitInfo = false
 
   [[params.social]]
     icon = "github"
-    icon_pack = "fa"
-    link = "//github.com/gcushen"
+    icon_pack = "fab"
+    link = "https://github.com/gcushen"
 
   # Link to a PDF of your resume/CV from the About widget.
   # To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
@@ -286,8 +306,8 @@ enableGitInfo = false
   weight = 4
 
 [[menu.main]]
-  name = "Teaching"
-  url = "#teaching"
+  name = "Tutorials"
+  url = "/tutorial/"
   weight = 5
 
 [[menu.main]]

+ 5 - 0
exampleSite/content/home/contact.md

@@ -13,5 +13,10 @@ weight = 70
 # Automatically link email and phone?
 autolink = true
 
+# Email form provider
+#   0: Disable email form
+#   1: Netlify (requires that the site is hosted by Netlify)
+#   2: formspree.io
+email_form = 2
 +++
 

+ 45 - 0
exampleSite/content/home/experience.md

@@ -0,0 +1,45 @@
++++
+# Experience widget.
+widget = "experience"  # Do not modify this line!
+active = true  # Activate this widget? true/false
+
+title = "Experience"
+subtitle = ""
+
+# Order that this section will appear in.
+weight = 8
+
+# Date format for experience
+#   Refer to https://sourcethemes.com/academic/docs/customization/#date-format
+date_format = "January 2006"
+
+# Experiences.
+#   Add/remove as many `[[experience]]` blocks below as you like.
+#   Required fields are `title`, `company`, and `date_start`.
+#   Leave `date_end` empty if it's your current employer.
+#   Begin/end multi-line descriptions with 3 quotes `"""`.
+[[experience]]
+  title = "CEO"
+  company = "GenCoin"
+  company_url = ""
+  location = "California"
+  date_start = "2017-01-01"
+  date_end = ""
+  description = """
+  Responsibilities include:
+  
+  * Analysing
+  * Modelling
+  * Deploying
+  """
+
+[[experience]]
+  title = "Professor"
+  company = "University X"
+  company_url = ""
+  location = "California"
+  date_start = "2016-01-01"
+  date_end = "2016-12-31"
+  description = """Taught electronic engineering and researched semiconductor physics."""
+
++++

+ 10 - 25
exampleSite/content/home/hero.md

@@ -21,31 +21,16 @@ weight = 3
 #   Deactivate by commenting out parameters, prefixing lines with `#`.
 [cta]
   url = "./post/getting-started/"
-  label = '<i class="fa fa-download"></i> Install Now'
+  label = '<i class="fas fa-download"></i> Install Now'
 +++
 
 The highly flexible website framework for Hugo with an extensible plugin mechanism. Create a beautifully simple site in under 10 minutes :rocket:
-<br>
-<small><a id="academic-release" href="https://sourcethemes.com/academic/updates">Latest release</a></small>
-<br><br>
-<iframe style="display: inline-block;" src="https://ghbtns.com/github-btn.html?user=gcushen&amp;repo=hugo-academic&amp;type=star&amp;count=true&amp;size=large" scrolling="0" width="160px" height="30px" frameborder="0"></iframe>
-<iframe style="display: inline-block;" src="https://ghbtns.com/github-btn.html?user=gcushen&amp;repo=hugo-academic&amp;type=fork&amp;count=true&amp;size=large" scrolling="0" width="158px" height="30px" frameborder="0"></iframe>
-
-<script type="text/javascript">
-  (function defer() {
-    if (window.jQuery) {
-      jQuery(document).ready(function(){
-        GetLatestReleaseInfo();
-      });
-    } else {
-      setTimeout(function() { defer() }, 50);
-    }
-  })();  
-  function GetLatestReleaseInfo() {
-    $.getJSON('https://api.github.com/repos/gcushen/hugo-academic/tags').done(function (json) {
-      let release = json[0];
-      // let downloadURL = release.zipball_url;
-      $('#academic-release').text('Latest release ' + release.name);  
-    });    
-}  
-</script>
+<div style="margin-top: -0.5rem;">
+  <a id="academic-release" href="https://sourcethemes.com/academic/updates" data-repo="gcushen/hugo-academic">
+  Latest release <!-- V -->
+  </a>
+</div>
+<div class="mt-3">
+  <a class="github-button" href="https://github.com/gcushen/hugo-academic" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star this on GitHub">Star</a>
+</div>
+<script async defer src="https://buttons.github.io/buttons.js"></script>

+ 1 - 1
exampleSite/content/home/hero_carousel.md

@@ -33,7 +33,7 @@ height = "300px"
   #   Deactivate by commenting out parameters, prefixing lines with `#`.
   cta_label = "Get Academic"
   cta_url = "https://sourcethemes.com/academic/"
-  cta_icon_pack = "fa"
+  cta_icon_pack = "fas"
   cta_icon = "graduation-cap"
 
 [[item]]

+ 2 - 1
exampleSite/content/home/posts.md

@@ -23,6 +23,7 @@ count = 5
 # List format.
 #   0 = Simple
 #   1 = Detailed
-list_format = 1
+#   2 = Stream
+list_format = 2
 +++
 

+ 8 - 1
exampleSite/content/home/projects.md

@@ -17,9 +17,16 @@ folder = "project"
 
 # View.
 # Customize how projects are displayed.
-# Legend: 0 = list, 1 = cards.
+# Legend: 0 = list, 1 = cards, 2 = showcase.
 view = 1
 
+# Widget layout
+# Legend: 0 = two columns (default), 1 = single column
+widget_layout = 0
+
+# For Showcase view, flip alternate rows?
+flip_alt_rows = false
+
 # Filter toolbar.
 
 # Default filter index (e.g. 0 corresponds to the first `[[filter]]` instance below).

+ 2 - 1
exampleSite/content/home/publications.md

@@ -19,7 +19,8 @@ count = 10
 #   1 = Detailed
 #   2 = APA
 #   3 = MLA
-list_format = 3
+#   4 = Stream
+list_format = 4
 
 # Filter by publication type.
 # -1: Any

+ 1 - 0
exampleSite/content/home/publications_selected.md

@@ -17,6 +17,7 @@ weight = 10
 #   1 = Detailed
 #   2 = APA
 #   3 = MLA
+#   4 = Stream
 list_format = 1
 
 # Filter by publication type.

+ 0 - 12
exampleSite/content/home/search.md

@@ -1,12 +0,0 @@
-+++
-# Search widget.
-widget = "search"
-active = true
-date = 2018-07-23T00:00:00
-
-title = "Search"
-subtitle = ""
-
-# Order that this section will appear in.
-weight = 66
-+++

+ 30 - 13
exampleSite/content/home/skills.md

@@ -1,25 +1,42 @@
 +++
 # Feature/Skill widget.
-widget = "featurette"
-active = false
-date = "2017-11-21"
+widget = "featurette"  # Do not modify this line!
+date = 2017-09-20T00:00:00
+
+# Activate this widget? true/false
+active = true
+
+title = "Skills"
+subtitle = ""
 
 # Order that this section will appear in.
-weight = 20
+weight = 7
 
+# Showcase personal skills or business features.
+# 
 # Add/remove as many `[[feature]]` blocks below as you like.
-# See `config.toml` for more info on available icons.
+# 
+# Available icon packs and icons:
+# * fas - Font Awesome standard icons (see https://fontawesome.com/icons)
+# * fab - Font Awesome brand icons (see https://fontawesome.com/icons)
+# * ai - academic icons (see https://jpswalsh.github.io/academicons/)
 
 [[feature]]
-  icon = "files-o"
-  icon_pack = "fa"
-  name = "Data Driven"
-  description = "..."
+  icon = "r-project"
+  icon_pack = "fab"
+  name = "R"
+  description = "90%"
+  
+[[feature]]
+  icon = "chart-line"
+  icon_pack = "fas"
+  name = "Statistics"
+  description = "100%"  
   
 [[feature]]
-  icon = "pencil"
-  icon_pack = "fa"
-  name = "Math"
-  description = "..."
+  icon = "camera-retro"
+  icon_pack = "fas"
+  name = "Photography"
+  description = "10%"
 
 +++

+ 2 - 1
exampleSite/content/home/talks.md

@@ -16,7 +16,8 @@ count = 10
 # List format.
 #   0 = Simple
 #   1 = Detailed
-list_format = 0
+#   2 = Stream
+list_format = 2
 
 # Exclude talks that are shown in the Selected Talks widget?
 exclude_selected = false

+ 1 - 0
exampleSite/content/home/talks_selected.md

@@ -13,5 +13,6 @@ weight = 29
 # List format.
 #   0 = Simple
 #   1 = Detailed
+#   3 = Stream
 list_format = 0
 +++

+ 2 - 3
exampleSite/content/post/_index.md

@@ -1,13 +1,12 @@
 +++
 title = "Posts"
 date = 2017-01-01T00:00:00
-math = false
-highlight = false
 
 # List format.
 #   0 = Simple
 #   1 = Detailed
-list_format = 1
+#   2 = Stream
+list_format = 2
 
 # Optional featured image (relative to `static/img/` folder).
 [header]

BIN
exampleSite/content/post/getting-started/featured.jpg


BIN
exampleSite/content/post/getting-started/gallery/theme-1950s.png


BIN
exampleSite/content/post/getting-started/gallery/theme-apogee.png


BIN
exampleSite/content/post/getting-started/gallery/theme-coffee-playfair.png


BIN
exampleSite/content/post/getting-started/gallery/theme-cupcake.png


BIN
exampleSite/content/post/getting-started/gallery/theme-dark.png


BIN
exampleSite/content/post/getting-started/gallery/theme-default.png


BIN
exampleSite/content/post/getting-started/gallery/theme-forest.png


BIN
exampleSite/content/post/getting-started/gallery/theme-ocean.png


+ 65 - 18
exampleSite/content/post/getting-started.md → exampleSite/content/post/getting-started/index.md

@@ -1,5 +1,6 @@
 +++
 title = "Academic: the website designer for Hugo"
+subtitle = "Create a beautifully simple website in under 10 minutes :rocket:"
 
 date = 2016-04-20T00:00:00
 lastmod = 2018-01-13T00:00:00
@@ -11,42 +12,83 @@ authors = []
 tags = ["Academic"]
 summary = "Create a beautifully simple website or blog in under 10 minutes."
 
-[header]
-image = "headers/getting-started.png"
-caption = "Image credit: [**Academic**](https://github.com/gcushen/hugo-academic/)"
+# Projects (optional).
+#   Associate this post with one or more of your projects.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
+#   Otherwise, set `projects = []`.
+# projects = ["internal-project"]
+
+# Featured image
+# To use, add an image named `featured.jpg/png` to your project's folder. 
+[image]
+  # Caption (optional)
+  caption = "Image credit: [**Unsplash**](https://unsplash.com/photos/CpkOjOcXdUY)"
+
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
+
+  # Show image only in page previews?
+  preview_only = false
+
+# Set captions for image gallery.
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-default.png"
+album = "gallery"
+image = "theme-default.png"
 caption = "Default"
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-ocean.png"
+album = "gallery"
+image = "theme-ocean.png"
 caption = "Ocean"
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-dark.png"
+album = "gallery"
+image = "theme-forest.png"
+caption = "Forest"
+
+[[gallery_item]]
+album = "gallery"
+image = "theme-dark.png"
 caption = "Dark"
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-forest.png"
-caption = "Default"
+album = "gallery"
+image = "theme-apogee.png"
+caption = "Apogee"
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-coffee-playfair.png"
+album = "gallery"
+image = "theme-1950s.png"
+caption = "1950s"
+
+[[gallery_item]]
+album = "gallery"
+image = "theme-coffee-playfair.png"
 caption = "Coffee theme with Playfair font"
 
 [[gallery_item]]
-album = "1"
-image = "https://raw.githubusercontent.com/gcushen/hugo-academic/master/images/theme-1950s.png"
-caption = "1950s"
+album = "gallery"
+image = "theme-cupcake.png"
+caption = "Cupcake"
 +++
 
-**Academic** is a framework to help you create a beautiful website quickly. Perfect for personal sites, blogs, or business/project sites. [Check out the latest demo](https://themes.gohugo.io/theme/academic/) of what you'll get in less than 10 minutes. Then head on over to the [Quick Start guide](https://sourcethemes.com/academic/docs/) or take a look at the [Release Notes](https://sourcethemes.com/academic/updates/).
+**Academic** makes it easy to create a beautiful website for free using Markdown. Customize anything on your site with widgets, themes, and language packs.
+
+Follow our easy [step by step guide](https://sourcethemes.com/academic/docs/install/) to learn how to build your own free website with Academic. [Check out the personal demo](https://themes.gohugo.io/theme/academic/) or the [business demo](https://sourcethemes.com/academic/) of what you'll get in less than 10 minutes.
+
+- [View the documentation](https://sourcethemes.com/academic/docs/)
+- [Ask a question](http://discuss.gohugo.io/)
+- [Request a feature or report a bug](https://github.com/gcushen/hugo-academic/issues)
+- Updating? View the [Update Guide](https://sourcethemes.com/academic/docs/update/) and [Release Notes](https://sourcethemes.com/academic/updates/)
+- Support development of Academic:
+  - [Donate a coffee](https://paypal.me/cushen)
+  - [Become a backer on Patreon](https://www.patreon.com/cushen)
+  - [Decorate your laptop or journal with an Academic sticker](https://www.redbubble.com/people/neutreno/works/34387919-academic)
+  - [Wear the T-shirt](https://academic.threadless.com/)
 
 [![Screenshot](https://raw.githubusercontent.com/gcushen/hugo-academic/master/academic.png)](https://github.com/gcushen/hugo-academic/)
 
@@ -66,6 +108,11 @@ Academic is available in different color themes and font themes.
 
 {{< gallery >}}
 
+## Ecosystem
+
+* **[Academic Admin](https://github.com/sourcethemes/academic-admin):** An admin tool to import publications from BibTeX or import assets for an offline site
+* **[Academic Scripts](https://github.com/sourcethemes/academic-scripts):** Scripts to help migrate content to new versions of Academic
+
 ## Install
 
 You can choose from one of the following four methods to install:

+ 1 - 1
exampleSite/content/privacy.md

@@ -2,7 +2,7 @@
 title = "Privacy Policy"
 
 date = 2018-06-28T00:00:00
-draft = false
+draft = true
 
 # [header]
 # image = ""

BIN
exampleSite/content/project/external-project/featured.jpg


+ 11 - 9
exampleSite/content/project/example-external-project.md → exampleSite/content/project/external-project/index.md

@@ -1,16 +1,13 @@
 +++
-# Date this page was created.
-date = 2016-04-27T00:00:00
-
 # Project title.
 title = "External Project"
 
+# Date this page was created.
+date = 2016-04-27T00:00:00
+
 # Project summary to display on homepage.
 summary = "An example of linking directly to an external project website using `external_link`."
 
-# Optional image to display on homepage (relative to `static/img/` folder).
-image_preview = "boards.jpg"
-
 # Tags: can be used for filtering projects.
 # Example: `tags = ["machine-learning", "deep-learning"]`
 tags = ["Demo"]
@@ -18,8 +15,13 @@ tags = ["Demo"]
 # Optional external URL for project (replaces project detail page).
 external_link = "http://example.org"
 
-# Does the project detail page use math formatting?
-math = false
+# Featured image
+# To use, add an image named `featured.jpg/png` to your project's folder. 
+[image]
+  # Caption (optional)
+  caption = "Photo by Toa Heftiba on Unsplash"
 
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = "Smart"
 +++
-

BIN
exampleSite/content/project/internal-project/featured.jpg


+ 31 - 15
exampleSite/content/project/deep-learning.md → exampleSite/content/project/internal-project/index.md

@@ -1,15 +1,12 @@
 +++
+# Project title.
+title = "Internal Project"
+
 # Date this page was created.
 date = 2016-04-27T00:00:00
 
-# Project title.
-title = "Deep Learning"
-
 # Project summary to display on homepage.
-summary = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."
-
-# Optional image to display on homepage (relative to `static/img/` folder).
-image_preview = "bubbles.jpg"
+summary = "An example of using the in-built project page."
 
 # Tags: can be used for filtering projects.
 # Example: `tags = ["machine-learning", "deep-learning"]`
@@ -18,14 +15,33 @@ tags = ["Deep Learning"]
 # Optional external URL for project (replaces project detail page).
 external_link = ""
 
-# Does the project detail page use math formatting?
-math = false
-
-# Optional featured image (relative to `static/img/` folder).
-[header]
-image = "headers/bubbles-wide.jpg"
-caption = "My caption :smile:"
-
+# Slides (optional).
+#   Associate this project with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = "example-slides"
+
+# Links (optional).
+url_pdf = ""
+url_slides = ""
+url_video = ""
+url_code = ""
+
+# Custom links (optional).
+#   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
+url_custom = [{icon_pack = "fab", icon="twitter", name="Follow", url = "https://twitter.com/georgecushen"}]
+
+# Featured image
+# To use, add an image named `featured.jpg/png` to your project's folder. 
+[image]
+  # Caption (optional)
+  caption = "Photo by rawpixel on Unsplash"
+  
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = "Smart"
 +++
 
 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam. Quisque risus orci, mollis id ante sit amet, gravida egestas nisl. Sed ac tempus magna. Proin in dui enim. Donec condimentum, sem id dapibus fringilla, tellus enim condimentum arcu, nec volutpat est felis vel metus. Vestibulum sit amet erat at nulla eleifend gravida.

+ 1 - 2
exampleSite/content/publication/_index.md

@@ -1,14 +1,13 @@
 +++
 title = "Publications"
 date = 2017-01-01T00:00:00
-math = false
-highlight = false
 
 # List format.
 #   0 = Simple
 #   1 = Detailed
 #   2 = APA
 #   3 = MLA
+#   4 = Stream
 list_format = 3
 
 # Optional featured image (relative to `static/img/` folder).

+ 0 - 0
exampleSite/static/files/citations/clothing-search.bib → exampleSite/content/publication/clothing-search/cite.bib


BIN
exampleSite/content/publication/clothing-search/featured.jpg


+ 14 - 13
exampleSite/content/publication/clothing-search.md → exampleSite/content/publication/clothing-search/index.md

@@ -25,18 +25,16 @@ publication_short = "In *ICMEW*"
 abstract = "We present a mobile visual clothing search system whereby a smart phone user can either choose a social networking photo or take a new photo of a person wearing clothing of interest and search for similar clothing in a retail database. From the query image, the person is detected, clothing is segmented, and clothing features are extracted and quantized. The information is sent from the phone client to a server, where the feature vector of the query image is used to retrieve similar clothing products from online databases. The phone's GPS location is used to re-rank results by retail store location. State of the art work focuses primarily on the recognition of a diverse range of clothing offline and pays little attention to practical applications. Evaluated on a challenging dataset, the system is relatively fast and achieves promising results."
 abstract_short = "A mobile visual clothing search system is presented whereby a smart phone user can either choose a social networking image or capture a new photo of a person wearing clothing of interest and search for similar clothing in a large cloud-based ecommerce database. The phone's GPS location is used to re-rank results by retail store location, to inform the user of local stores where similar clothing items can be tried on."
 
-# Featured image thumbnail (optional)
-image_preview = ""
-
 # Is this a selected publication? (true/false)
 selected = true
 
 # Projects (optional).
 #   Associate this publication with one or more of your projects.
-#   Simply enter your project's filename without extension.
-#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
 #   Otherwise, set `projects = []`.
-projects = ["example-external-project"]
+projects = ["internal-project"]
 
 # Tags (optional).
 #   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
@@ -57,18 +55,21 @@ url_source = "#"
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
+# Digital Object Identifier (DOI)
+doi = ""
+
 # Does this page contain LaTeX math? (true/false)
 math = true
 
-# Does this page require source code highlighting? (true/false)
-highlight = true
-
 # Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = "headers/bubbles-wide.jpg"
-caption = "My caption :smile:"
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = "Image credit: [**Unsplash**](https://unsplash.com/photos/pLCdAaMFLTE)"
 
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
 +++
 
 More detail can easily be written here using *Markdown* and $\rm \LaTeX$ math code.

BIN
exampleSite/content/publication/person-re-id/featured.jpg


+ 21 - 12
exampleSite/content/publication/person-re-identification.md → exampleSite/content/publication/person-re-id/index.md

@@ -25,19 +25,25 @@ publication_short = "In *SITIS*"
 abstract = "Person re-identification is a critical security task for recognizing a person across spatially disjoint sensors. Previous work can be computationally intensive and is mainly based on low-level cues extracted from RGB data and implemented on a PC for a fixed sensor network (such as traditional CCTV). We present a practical and efficient framework for mobile devices (such as smart phones and robots) where high-level semantic soft biometrics are extracted from RGB and depth data. By combining these cues, our approach attempts to provide robustness to noise, illumination, and minor variations in clothing. This mobile approach may be particularly useful for the identification of persons in areas ill-served by fixed sensors or for tasks where the sensor position and direction need to dynamically adapt to a target. Results on the BIWI dataset are preliminary but encouraging. Further evaluation and demonstration of the system will be available on our website."
 abstract_short = ""
 
-# Featured image thumbnail (optional)
-image_preview = ""
-
 # Is this a selected publication? (true/false)
 selected = false
 
 # Projects (optional).
 #   Associate this publication with one or more of your projects.
-#   Simply enter your project's filename without extension.
-#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
 #   Otherwise, set `projects = []`.
 projects = []
 
+# Slides (optional).
+#   Associate this publication with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = "example-slides"
+
 # Tags (optional).
 #   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
 tags = []
@@ -57,18 +63,21 @@ url_source = ""
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 # url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
+# Digital Object Identifier (DOI)
+doi = ""
+
 # Does this page contain LaTeX math? (true/false)
 math = true
 
-# Does this page require source code highlighting? (true/false)
-highlight = true
-
 # Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = ""
-caption = ""
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = "Image credit: [**Unsplash**](https://unsplash.com/photos/jdD8gXaTZsc)"
 
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = ""
 +++
 
 More detail can easily be written here using *Markdown* and $\rm \LaTeX$ math code.

+ 159 - 0
exampleSite/content/slides/example-slides.md

@@ -0,0 +1,159 @@
++++
+title = "Slides"
+
+[slides]
+# Choose a theme from https://github.com/hakimel/reveal.js#theming
+theme = "black"
++++
+
+# Welcome to Slides
+
+[Academic](https://sourcethemes.com/academic/)
+
+---
+
+## Features
+
+- Efficiently write slides in Markdown
+- 3-in-1: Create, Present, and Publish your slides
+- Supports speaker notes
+- Mobile friendly slides
+
+---
+
+## Controls
+
+- Next: `Right Arrow` or `Space`
+- Previous: `Left Arrow`
+- Start: `Home`
+- Finish: `End`
+- Overview: `Esc`
+- Speaker notes: `S`
+- Fullscreen: `F`
+- Zoom: `Alt + Click`
+- [PDF Export](https://github.com/hakimel/reveal.js#pdf-export): `E`
+
+---
+
+## Code Highlighting
+
+Inline code: `variable`
+
+Code block:
+```python
+porridge = "blueberry"
+if porridge == "blueberry":
+    print("Eating...")
+```
+
+---
+
+## Math
+
+In-line math: $x + y = z$
+
+Block math:
+
+$$
+f\left( x \right) = \;\frac{{2\left( {x + 4} \right)\left( {x - 4} \right)}}{{\left( {x + 4} \right)\left( {x + 1} \right)}}
+$$
+
+---
+
+## Fragments
+
+Make content appear incrementally
+
+```
+{{%/* fragment */%}} One {{%/* /fragment */%}}
+{{%/* fragment */%}} **Two** {{%/* /fragment */%}}
+{{%/* fragment */%}} Three {{%/* /fragment */%}}
+```
+
+Press `Space` to play!
+
+{{% fragment %}} One {{% /fragment %}}
+{{% fragment %}} **Two** {{% /fragment %}}
+{{% fragment %}} Three {{% /fragment %}}
+
+---
+
+A fragment can accept two optional parameters:
+
+- `class`: use a custom style (requires definition in custom CSS)
+- `weight`: sets the order in which a fragment appears
+
+---
+
+## Speaker Notes
+
+Add speaker notes to your presentation
+
+```markdown
+{{%/* speaker_note */%}}
+- Only the speaker can read these notes
+- Press `S` key to view
+{{%/* /speaker_note */%}}
+```
+
+Press the `S` key to view the speaker notes!
+
+{{< speaker_note >}}
+- Only the speaker can read these notes
+- Press `S` key to view
+{{< /speaker_note >}}
+
+---
+
+## Themes
+
+- black: Black background, white text, blue links (default)
+- white: White background, black text, blue links
+- league: Gray background, white text, blue links
+- beige: Beige background, dark text, brown links
+- sky: Blue background, thin dark text, blue links
+
+---
+
+- night: Black background, thick white text, orange links
+- serif: Cappuccino background, gray text, brown links
+- simple: White background, black text, blue links
+- solarized: Cream-colored background, dark green text, blue links
+
+---
+
+{{< slide background-image="/img/boards.jpg" >}}
+
+## Custom Slide
+
+Customize the slide style and background
+
+```markdown
+{{</* slide background-image="/img/boards.jpg" */>}}
+{{</* slide background-color="#0000FF" */>}}
+{{</* slide class="my-style" */>}}
+```
+
+---
+
+## Custom CSS Example
+
+Let's make headers navy colored.
+
+Create `assets/css/reveal_custom.css` with:
+
+```css
+.reveal section h1,
+.reveal section h2,
+.reveal section h3 {
+  color: navy;
+}
+```
+
+---
+
+# Questions?
+
+[Ask](https://discourse.gohugo.io)
+
+[Documentation](https://sourcethemes.com/academic/docs/)

+ 2 - 3
exampleSite/content/talk/_index.md

@@ -1,13 +1,12 @@
 +++
 title = "Recent & Upcoming Talks"
 date = 2017-01-01T00:00:00
-math = false
-highlight = false
 
 # List format.
 #   0 = Simple
 #   1 = Detailed
-list_format = 0
+#   2 = Stream
+list_format = 2
 
 # Optional featured image (relative to `static/img/` folder).
 [header]

+ 0 - 56
exampleSite/content/talk/example-talk.md

@@ -1,56 +0,0 @@
-+++
-title = "Example Talk"
-date = 2017-01-01T00:00:00  # Schedule page publish date.
-draft = false
-
-# Talk start and end times.
-#   End time can optionally be hidden by prefixing the line with `#`.
-time_start = 2030-06-01T13:00:00
-time_end = 2030-06-01T15:00:00
-
-# Abstract and optional shortened version.
-abstract = ""
-abstract_short = ""
-
-# Name of event and optional event URL.
-event = "Academic Theme Conference"
-event_url = "https://example.org"
-
-# Location of event.
-location = "London, United Kingdom"
-
-# Is this a selected talk? (true/false)
-selected = false
-
-# Projects (optional).
-#   Associate this talk with one or more of your projects.
-#   Simply enter your project's filename without extension.
-#   E.g. `projects = ["deep-learning"]` references `content/project/deep-learning.md`.
-#   Otherwise, set `projects = []`.
-projects = ["deep-learning"]
-
-# Tags (optional).
-#   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
-tags = []
-
-# Links (optional).
-url_pdf = ""
-url_slides = ""
-url_video = ""
-url_code = ""
-
-# Does the content use math formatting?
-math = true
-
-# Does the content use source code highlighting?
-highlight = true
-
-# Featured image
-# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
-[header]
-image = "headers/bubbles-wide.jpg"
-caption = "My caption :smile:"
-
-+++
-
-Embed your slides or video here using [shortcodes](https://sourcethemes.com/academic/post/writing-markdown-latex/). Further details can easily be added using *Markdown* and $\rm \LaTeX$ math code.

BIN
exampleSite/content/talk/example/featured.jpg


+ 78 - 0
exampleSite/content/talk/example/index.md

@@ -0,0 +1,78 @@
++++
+title = "Example Talk"
+date = 2017-01-01T00:00:00  # Schedule page publish date.
+draft = false
+
+# Talk start and end times.
+#   End time can optionally be hidden by prefixing the line with `#`.
+time_start = 2030-06-01T13:00:00
+time_end = 2030-06-01T15:00:00
+
+# Authors. Comma separated list, e.g. `["Bob Smith", "David Jones"]`.
+authors = []
+
+# Abstract and optional shortened version.
+abstract = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellus ac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam."
+abstract_short = "An example talk using Academic's Markdown slides feature."
+
+# Name of event and optional event URL.
+event = "Academic Theme Conference"
+event_url = "https://example.org"
+
+# Location of event.
+location = "London, United Kingdom"
+
+# Is this a selected talk? (true/false)
+selected = false
+
+# Projects (optional).
+#   Associate this talk with one or more of your projects.
+#   Simply enter your project's folder or file name without extension.
+#   E.g. `projects = ["deep-learning"]` references 
+#   `content/project/deep-learning/index.md`.
+#   Otherwise, set `projects = []`.
+projects = ["internal-project"]
+
+# Tags (optional).
+#   Set `tags = []` for no tags, or use the form `tags = ["A Tag", "Another Tag"]` for one or more tags.
+tags = []
+
+# Slides (optional).
+#   Associate this talk with Markdown slides.
+#   Simply enter your slide deck's filename without extension.
+#   E.g. `slides = "example-slides"` references 
+#   `content/slides/example-slides.md`.
+#   Otherwise, set `slides = ""`.
+slides = "example-slides"
+
+# Links (optional).
+url_pdf = ""
+url_slides = ""
+url_video = ""
+url_code = ""
+
+# Does the content use math formatting?
+math = true
+
+# Featured image
+# To use, add an image named `featured.jpg/png` to your page's folder. 
+[image]
+  # Caption (optional)
+  caption = "Image credit: [**Unsplash**](https://unsplash.com/photos/bzdhc5b3Bxs)"
+
+  # Focal point (optional)
+  # Options: Smart, Center, TopLeft, Top, TopRight, Left, Right, BottomLeft, Bottom, BottomRight
+  focal_point = "Right"
++++
+
+{{% alert note %}}
+Click on the **Slides** button above to view the built-in slides feature.
+{{% /alert %}}
+
+Slides can be added in a few ways:
+
+- **Create** slides using Academic's *Slides* feature and link using `url_slides` parameter in the front matter of the talk file
+- **Upload** an existing slide deck to `static/` and link using `url_slides` parameter in the front matter of the talk file
+- **Embed** your slides (e.g. Google Slides) or presentation video on this page using [shortcodes](https://sourcethemes.com/academic/docs/writing-markdown-latex/).
+
+Further talk details can easily be added to this page using *Markdown* and $\rm \LaTeX$ math code.

+ 27 - 0
exampleSite/content/tutorial/_index.md

@@ -0,0 +1,27 @@
++++
+title = "Overview"
+
+date = 2018-09-09T00:00:00
+# lastmod = 2018-09-09T00:00:00
+
+draft = false  # Is this a draft? true/false
+toc = true  # Show table of contents? true/false
+type = "docs"  # Do not modify.
+
+# Add menu entry to sidebar.
+[menu.tutorial]
+  name = "Overview"
+  weight = 1
++++
+
+This feature can be used for publishing content such as:
+
+* **Project or software documentation**
+* **Online courses**
+* **Tutorials**
+
+The parent folder may be renamed, for example, to `docs` for project documentation or `course` for creating an online course.
+
+To disable this feature, either delete the parent folder, or set `draft = true` in the front matter of all its pages. 
+
+After renaming or deleting the parent folder, you may wish to update any `[[menu.main]]` menu links to it in the `config.toml`. 

+ 26 - 0
exampleSite/content/tutorial/example.md

@@ -0,0 +1,26 @@
++++
+title = "Example Page"
+
+date = 2018-09-09T00:00:00
+# lastmod = 2018-09-09T00:00:00
+
+draft = false  # Is this a draft? true/false
+toc = true  # Show table of contents? true/false
+type = "docs"  # Do not modify.
+
+# Add menu entry to sidebar.
+linktitle = "Example Page"
+[menu.tutorial]
+  parent = "Example Topic"
+  weight = 1
++++
+
+In this tutorial, I'll share my top 10 tips for getting started with Academic:
+
+## Tip 1
+
+...
+
+## Tip 2
+
+...

BIN
exampleSite/static/img/bubbles.jpg


BIN
exampleSite/static/img/headers/getting-started.png


+ 160 - 0
i18n/ca.yaml

@@ -0,0 +1,160 @@
+# Navigation
+
+- id: toggle_navigation
+  translation: Barra de navegació
+
+- id: table_of_contents
+  translation: Index
+
+# General
+
+- id: related
+  translation: Relacionat
+
+- id: minute_read
+  translation: min de lectura
+
+- id: previous
+  translation: Anterior
+
+- id: next
+  translation: Següent
+
+- id: figure
+  translation: "Figura %d:"
+
+# Buttons
+
+- id: btn_preprint
+  translation: Preimpresió
+
+- id: btn_pdf
+  translation: PDF
+
+- id: btn_cite
+  translation: Cita
+
+- id: btn_slides
+  translation: Diapositives
+
+- id: btn_video
+  translation: Vídeo
+
+- id: btn_code
+  translation: Códi
+
+- id: btn_dataset
+  translation: Dades
+
+- id: btn_project
+  translation: Projecte
+
+- id: btn_poster
+  translation: Poster
+
+- id: btn_source
+  translation: Font
+
+- id: btn_copy
+  translation: Copia
+
+- id: btn_download
+  translation: Baixa
+
+# About widget
+
+- id: interests
+  translation: Interessos
+
+- id: education
+  translation: Educació
+
+# Publications widget
+
+- id: more_publications
+  translation: Més publicacions
+
+# Posts widget
+
+- id: continue_reading
+  translation: CONTINUAR LLEGINT
+
+- id: more_posts
+  translation: Més entrades
+
+# Talks widget
+
+- id: more_talks
+  translation: Més xerrades
+
+# Publication/Talk details
+
+- id: abstract
+  translation: Resum
+
+- id: publication
+  translation: Publicació
+
+- id: publication_type
+  translation: Tipus
+
+- id: date
+  translation: Data
+
+- id: last_updated
+  translation: Última actualizació el
+
+- id: links
+  translation: Enllaços
+
+- id: event
+  translation: Event
+
+- id: location
+  translation: Ubicació
+
+# Filtering
+
+- id: filter_by_type
+  translation: Filtrar per tipus
+
+- id: filter_all
+  translation: Tot
+
+# Project details
+
+- id: open_project_site
+  translation: Obre el lloc del web del projecte
+
+# Default node titles
+
+- id: posts
+  translation: Entrada
+
+- id: publications
+  translation: Publicació
+
+- id: talks
+  translation: Conferència
+
+- id: projects
+  translation: Projectes
+
+# Error 404
+
+- id: page_not_found
+  translation: No s'ha trobat la pàgina
+
+- id: 404_recommendations
+  translation: Buscaves alguna d'aquestes?
+
+# Cookie consent
+
+- id: cookie_message
+  translation: Aquet lloc web fa servir cookies per garantitzar una millor experiència.
+
+- id: cookie_dismiss
+  translation: D'acord
+
+- id: cookie_learn
+  translation: Més informació

+ 95 - 2
i18n/de.yaml

@@ -3,14 +3,43 @@
 - id: toggle_navigation
   translation: Zur Navigation
 
+- id: table_of_contents
+  translation: Inhaltsverzeichnis
+
+- id: on_this_page
+  translation: Auf dieser Seite
+
+- id: back_to_top
+  translation: Zurück zum Anfang
+
+# General
+
+- id: related
+  translation: Ähnliches
+
+- id: minute_read
+  translation: Min. Lektüre
+
+- id: previous
+  translation: Zurück
+
+- id: next
+  translation: Weiter
+
+- id: figure
+  translation: "Abbildung %d:"
+
 # Buttons
 
-- id: btn_details
-  translation: Details
+- id: btn_preprint
+  translation: Preprint
 
 - id: btn_pdf
   translation: PDF
 
+- id: btn_cite
+  translation: Zitieren
+
 - id: btn_slides
   translation: Folien
 
@@ -26,6 +55,18 @@
 - id: btn_project
   translation: Projekt
 
+- id: btn_poster
+  translation: Poster
+
+- id: btn_source
+  translation: Quelldokument
+
+- id: btn_copy
+  translation: Kopie
+
+- id: btn_download
+  translation: Download
+
 # About widget
 
 - id: interests
@@ -34,6 +75,11 @@
 - id: education
   translation: Ausbildung
 
+# Experience widget
+
+- id: present
+  translation: Aktuell
+
 # Publications widget
 
 - id: more_publications
@@ -66,6 +112,9 @@
 - id: date
   translation: Datum
 
+- id: last_updated
+  translation: Zuletzt aktualisiert am
+
 - id: links
   translation: Links
 
@@ -87,3 +136,47 @@
 
 - id: open_project_site
   translation: Zur Projektseite
+
+# Default node titles
+
+- id: posts
+  translation: Blog
+
+- id: publications
+  translation: Publikationen
+
+- id: talks
+  translation: Vorträge
+
+- id: projects
+  translation: Projekte
+
+# Search
+
+- id: search_placeholder
+  translation: Suche...
+
+- id: search_results
+  translation: Suchergebnisse
+
+- id: search_no_results
+  translation: Nichts gefunden
+
+# Error 404
+
+- id: page_not_found
+  translation: Seite nicht gefunden
+
+- id: 404_recommendations
+  translation: Suchst du vielleicht nach einer der folgenden Seiten?
+
+# Cookie consent
+
+- id: cookie_message
+  translation: Um unsere Webseite für Sie optimal zu gestalten und fortlaufend verbessern zu können, verwenden wir Cookies.
+
+- id: cookie_dismiss
+  translation: Verstanden!
+
+- id: cookie_learn
+  translation: Mehr erfahren

+ 31 - 3
i18n/en.yaml

@@ -6,6 +6,12 @@
 - id: table_of_contents
   translation: Table of Contents
 
+- id: on_this_page
+  translation: On this page
+
+- id: back_to_top
+  translation: Back to top
+
 # General
 
 - id: related
@@ -69,6 +75,11 @@
 - id: education
   translation: Education
 
+# Experience widget
+
+- id: present
+  translation: Present
+
 # Publications widget
 
 - id: more_publications
@@ -87,6 +98,20 @@
 - id: more_talks
   translation: More Talks
 
+# Contact widget
+
+- id: contact_name
+  translation: Name
+
+- id: contact_email
+  translation: Email
+
+- id: contact_message
+  translation: Message
+
+- id: contact_send
+  translation: Send
+
 # Publication/Talk details
 
 - id: abstract
@@ -104,9 +129,6 @@
 - id: last_updated
   translation: Last updated on
 
-- id: links
-  translation: Links
-
 - id: event
   translation: Event
 
@@ -142,9 +164,15 @@
 
 # Search
 
+- id: search
+  translation: Search
+
 - id: search_placeholder
   translation: Search...
 
+- id: search_results
+  translation: results found
+
 - id: search_no_results
   translation: No results found
 

+ 74 - 3
i18n/it.yaml

@@ -3,16 +3,39 @@
 - id: toggle_navigation
   translation: Attiva la navigazione
 
+- id: table_of_contents
+  translation: Indice dei Contenuti
+
+# General
+
+- id: related
+  translation: Related
+
+- id: minute_read
+  translation: minuti
+
+- id: previous
+  translation: Precedente
+
+- id: next
+  translation: Prossimo
+
+- id: figure
+  translation: "Immagine %d:"
+
 # Buttons
 
-- id: btn_details
-  translation: Dettagli
+- id: btn_preprint
+  translation: Preprint
 
 - id: btn_pdf
   translation: PDF
 
+- id: btn_cite
+  translation: Citazione
+
 - id: btn_slides
-  translation: Slide
+  translation: Slides
 
 - id: btn_video
   translation: Video
@@ -26,6 +49,18 @@
 - id: btn_project
   translation: Progetti
 
+- id: btn_poster
+  translation: Poster
+
+- id: btn_source
+  translation: Source Document
+
+- id: btn_copy
+  translation: Copia
+
+- id: btn_download
+  translation: Download
+
 # About widget
 
 - id: interests
@@ -66,6 +101,9 @@
 - id: date
   translation: Data
 
+- id: last_updated
+  translation: Aggiornato il
+
 - id: links
   translation: Link
 
@@ -98,3 +136,36 @@
 
 - id: talks
   translation: Conferenze
+
+- id: projects
+  translation: Progetti
+
+# Search
+
+- id: search_placeholder
+  translation: Cerca...
+
+- id: search_results
+  translation: Risultati della ricerca
+
+- id: search_no_results
+  translation: Nessun risultato
+
+# Error 404
+
+- id: page_not_found
+  translation: Pagina non trovata
+
+- id: 404_recommendations
+  translation: Perhaps you were looking for one of these?
+
+# Cookie consent
+
+- id: cookie_message
+  translation: Questo sito usa i cookies per garantire la migliore esperienza di navigazione.
+
+- id: cookie_dismiss
+  translation: Ok!
+
+- id: cookie_learn
+  translation: Leggi i dettagli

+ 169 - 0
i18n/ja.yaml

@@ -0,0 +1,169 @@
+# Navigation
+
+- id: toggle_navigation
+  translation: ナビゲーションの切り替え
+
+- id: table_of_contents
+  translation: 目次
+
+# General
+
+- id: related
+  translation: 関連項目
+
+- id: minute_read
+  translation: 分で読める
+
+- id: previous
+  translation: 前へ
+
+- id: next
+  translation: 次へ
+
+- id: figure
+  translation: "図 %d:"
+
+# Buttons
+
+- id: btn_preprint
+  translation: プレプリント
+
+- id: btn_pdf
+  translation: PDF
+
+- id: btn_cite
+  translation: 引用
+
+- id: btn_slides
+  translation: スライド
+
+- id: btn_video
+  translation: 動画
+
+- id: btn_code
+  translation: コード
+
+- id: btn_dataset
+  translation: データセット
+
+- id: btn_project
+  translation: プロジェクト
+
+- id: btn_poster
+  translation: ポスター
+
+- id: btn_source
+  translation: ソース
+
+- id: btn_copy
+  translation: コピー
+
+- id: btn_download
+  translation: ダウンロード
+
+# About widget
+
+- id: interests
+  translation: 興味・関心
+
+- id: education
+  translation: 学歴
+
+# Publications widget
+
+- id: more_publications
+  translation: 発表文献一覧
+
+# Posts widget
+
+- id: continue_reading
+  translation: 続きを読む
+
+- id: more_posts
+  translation: 投稿一覧
+
+# Talks widget
+
+- id: more_talks
+  translation: 登壇一覧
+
+# Publication/Talk details
+
+- id: abstract
+  translation: 概要 
+
+- id: publication
+  translation: 収録
+
+- id: publication_type
+  translation: タイプ
+
+- id: date
+  translation: 日付
+
+- id: last_updated
+  translation: 最終更新
+
+- id: links
+  translation: リンク
+
+- id: event
+  translation: イベント
+
+- id: location
+  translation: 場所
+
+# Filtering
+
+- id: filter_by_type
+  translation: 文献の種類
+
+- id: filter_all
+  translation: 全て
+
+# Project details
+
+- id: open_project_site
+  translation: プロジェクトのサイトへ
+
+# Default node titles
+
+- id: posts
+  translation: 投稿
+
+- id: publications
+  translation: 発表文献
+
+- id: talks
+  translation: 登壇
+
+- id: projects
+  translation: プロジェクト
+
+# Search
+
+- id: search_placeholder
+  translation: 検索...
+
+- id: search_no_results
+  translation: 結果が見つかりませんでした
+
+# Error 404
+
+- id: page_not_found
+  translation: ページが見つかりませんでした
+
+- id: 404_recommendations
+  translation: あなたが探しているものはこれらの中にあるかもしれません
+
+# Cookie consent
+
+- id: cookie_message
+  translation: このウェブサイトはあなたが最高の体験を得るためにクッキーを使用します。
+
+- id: cookie_dismiss
+  translation: はい
+
+- id: cookie_learn
+  translation: 詳細を見る
+

+ 36 - 3
i18n/zh.yaml

@@ -6,6 +6,12 @@
 - id: table_of_contents
   translation: 目录
 
+- id: on_this_page
+  translation: 在本页
+
+- id: back_to_top
+  translation: 回到顶部
+
 # General
 
 - id: related
@@ -69,6 +75,11 @@
 - id: education
   translation: 教育经历
 
+# Experience widget
+
+- id: present
+  translation: 现在
+
 # Publications widget
 
 - id: more_publications
@@ -87,6 +98,20 @@
 - id: more_talks
   translation: 更多演讲
 
+# Contact widget
+
+- id: contact_name
+  translation: 姓名
+
+- id: contact_email
+  translation: 邮箱
+
+- id: contact_message
+  translation: 信息
+
+- id: contact_send
+  translation: 发送
+
 # Publication/Talk details
 
 - id: abstract
@@ -104,9 +129,6 @@
 - id: last_updated
   translation: 最近更新于
 
-- id: links
-  translation: 链接
-
 - id: event
   translation: 事件
 
@@ -140,6 +162,17 @@
 - id: projects
   translation: 项目
 
+# Search
+
+- id: search_placeholder
+  translation: 搜索...
+
+- id: search_results
+  translation: 搜索结果
+
+- id: search_no_results
+  translation: 没有找到结果
+
 # Error 404
 
 - id: page_not_found

BIN
images/theme-apogee.png


BIN
images/theme-cupcake.png


+ 4 - 4
layouts/404.html

@@ -10,7 +10,7 @@
   <h2>{{ i18n "posts" }}</h2>
   {{ range first 5 (where .Site.RegularPages "Section" "post") }}
   <ul>
-    <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
   </ul>
   {{ end }}
   {{ end }}
@@ -20,7 +20,7 @@
   <h2>{{ i18n "publications" }}</h2>
   {{ range first 5 (where .Site.RegularPages "Section" "publication") }}
   <ul>
-    <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
   </ul>
   {{ end }}
   {{ end }}
@@ -30,7 +30,7 @@
   <h2>{{ i18n "talks" }}</h2>
   {{ range first 5 (sort (where .Site.RegularPages "Type" "talk") ".Params.time_start" "desc") }}
   <ul>
-    <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
   </ul>
   {{ end }}
   {{ end }}
@@ -40,7 +40,7 @@
   <h2>{{ i18n "projects" }}</h2>
   {{ range first 5 (where .Site.RegularPages "Section" "project") }}
   <ul>
-    <li><a href="{{ .Permalink }}">{{ .Title }}</a></li>
+    <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
   </ul>
   {{ end }}
   {{ end }}

+ 3 - 7
layouts/_default/list.html

@@ -7,12 +7,9 @@
 {{ partial "header.html" . }}
 {{ partial "navbar.html" . }}
 
-{{ partial "header_image.html" . }}
-
-<div class="article-container">
-
-  {{ with .Title }}<h1>{{ . }}</h1>{{ end }}
+{{ partial "page_header.html" . }}
 
+<div class="universal-wrapper">
   {{ with .Content }}
   <div class="article-style" itemprop="articleBody">{{ . }}</div>
   {{ end }}
@@ -20,7 +17,7 @@
   {{ $paginator := .Paginate .Data.Pages }}
   {{ range $paginator.Pages }}
   <div>
-    <h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
+    <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
     <div class="article-style">
       {{ if .Params.summary }}
       {{ .Params.summary | plainify | emojify }}
@@ -34,7 +31,6 @@
   {{ end }}
 
   {{ partial "pagination" . }}
-
 </div>
 {{ partial "footer_container.html" . }}
 {{ partial "footer.html" . }}

+ 0 - 16
layouts/_default/list.search.json

@@ -1,16 +0,0 @@
-{{/* Generate the search index. */}}
-{{- $scr := $.Scratch -}}
-{{- $scr.Add "index" slice -}}
-{{- range (where .Site.RegularPages "Section" "!=" "home") -}}
-  {{- if and (not .Draft) (not .Params.private) -}}
-    {{- if .Params.abstract -}}
-      {{- $scr.Set "summary" .Params.abstract -}}
-    {{- else if .Params.summary -}}
-      {{- $scr.Set "summary" .Params.summary -}}
-    {{- else -}}
-      {{- $scr.Set "summary" .Summary -}}
-    {{- end -}}
-    {{- $scr.Add "index" (dict "objectID" .UniqueID "date" .Date.UTC.Unix "publishdate" .PublishDate "lastmod" .Lastmod.UTC.Unix "expirydate" .ExpiryDate.UTC.Unix "lang" .Lang "permalink" .Permalink "relpermalink" .RelPermalink "title" .Title "summary" (plainify ($scr.Get "summary")) "content" .Plain "authors" .Params.Authors "kind" .Kind "type" .Type "section" .Section "tags" .Params.Tags "categories" .Params.Categories)}}
-  {{- end -}}
-{{- end -}}
-{{- $scr.Get "index" | jsonify -}}

+ 2 - 4
layouts/_default/single.html

@@ -3,18 +3,16 @@
 
 <article class="article" itemscope itemtype="http://schema.org/Article">
 
-  {{ partial "header_image.html" . }}
+  {{ partial "page_header.html" . }}
 
   <div class="article-container">
-    <h1 itemprop="name">{{ .Title }}</h1>
-
-    {{ partial "article_metadata" (dict "content" . "is_list" 0) }}
 
     <div class="article-style" itemprop="articleBody">
       {{ .Content }}
     </div>
 
     {{ partial "tags.html" . }}
+    {{ partial "page_author.html" . }}
 
     {{ $related := .Site.RegularPages.Related . | first 5 }}
     {{ with $related }}

+ 1 - 0
layouts/docs/list.html

@@ -0,0 +1 @@
+{{ partial "docs_layout.html" . }}

+ 1 - 0
layouts/docs/single.html

@@ -0,0 +1 @@
+{{ partial "docs_layout.html" . }}

+ 28 - 0
layouts/index.json

@@ -0,0 +1,28 @@
+{{- /* Generate the search index. */ -}}
+{{- $index := slice -}}
+{{- $pages := where .Site.RegularPages "Section" "!=" "home" -}}
+{{- $pages := $pages | union (where (where .Site.Pages "Kind" "section") "Type" "docs") -}}
+{{- /* TODO: Add author pages to index so their bios can be searched. */ -}}
+{{- /* $pages := $pages | union (where (where .Site.Pages "Kind" "taxonomy") "taxonomyTerm" "author") */ -}}
+
+{{- range $pages -}}
+  {{- /* Do not index drafts or private pages. */ -}}
+  {{- if and (not .Draft) (not .Params.private) -}}
+
+    {{- /* Generate page description. */ -}}
+    {{- $desc := "" -}}
+    {{- if .Params.summary -}}
+      {{- $desc = .Params.summary -}}
+    {{- else if .Params.abstract -}}
+      {{- $desc = .Params.abstract -}}
+    {{- else -}}
+      {{- $desc = .Summary -}}
+    {{- end -}}
+
+    {{- /* Add page to index. */ -}}
+    {{- $index = $index | append (dict "objectID" .UniqueID "date" .Date.UTC.Unix "publishdate" .PublishDate "lastmod" .Lastmod.UTC.Unix "expirydate" .ExpiryDate.UTC.Unix "lang" .Lang "permalink" .Permalink "relpermalink" .RelPermalink "title" .Title "summary" (plainify $desc) "content" .Plain "authors" .Params.Authors "kind" .Kind "type" .Type "section" .Section "tags" .Params.Tags "categories" .Params.Categories) -}}
+
+  {{- end -}}
+{{- end -}}
+
+{{- $index | jsonify -}}

+ 1 - 1
layouts/partials/cookie_consent.html

@@ -20,7 +20,7 @@
         "message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }},
         "dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }},
         "link": {{ i18n "cookie_learn" | default "Learn more" }},
-        "href": {{ with .Site.GetPage "privacy.md" }}{{ printf "%s" .Permalink }}{{ else }}"https://cookies.insites.com"{{ end }}
+        "href": {{ with .Site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://cookies.insites.com"{{ end }}
       }
     })});
 </script>

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 450 - 161
layouts/partials/css/academic.css


+ 12 - 0
layouts/partials/css/parse_theme.css

@@ -29,6 +29,18 @@
     {{- $scr.Set "background" "rgb(40, 42, 54)" -}}
   {{ end }}
 
+  {{ if $theme.link }}
+    {{- $scr.Set "link" $theme.link -}}
+  {{ else }}
+    {{- $scr.Set "link" $theme.primary -}}
+  {{ end }}
+
+  {{ if $theme.link_hover }}
+    {{- $scr.Set "link_hover" $theme.link_hover -}}
+  {{ else }}
+    {{- $scr.Set "link_hover" $theme.primary -}}
+  {{ end }}
+
   {{- $scr.Set "primary" $theme.primary -}}
   {{- $scr.Set "primary_light" $theme.primary_light -}}
   {{- $scr.Set "primary_dark" $theme.primary_dark -}}

+ 53 - 0
layouts/partials/docs_layout.html

@@ -0,0 +1,53 @@
+{{ partial "header.html" . }}
+{{ partial "navbar.html" . }}
+{{ $current_page := . }}
+
+<div class="container-fluid docs">
+  <div class="row flex-xl-nowrap">
+    <div class="col-12 col-md-3 col-xl-2 docs-sidebar">
+      {{ partial "docs_sidebar.html" . }}
+    </div>
+
+    {{ if .Params.toc }}
+    <div class="d-none d-xl-block col-xl-2 docs-toc">
+      {{ with (i18n "on_this_page") }}
+      <p class="docs-toc-title">{{.}}</p>
+      {{ end }}
+
+      {{ .TableOfContents }}
+
+      <ul class="nav toc-top">
+        <li><a href="#">{{ i18n "back_to_top" | default "Back to top" }}</a></li>
+      </ul>
+
+      {{ partial "docs_toc_foot.html" . }}
+    </div>
+    {{ end }}
+
+    <main class="col-12 col-md-9 col-xl-8 py-md-3 pl-md-5 docs-content" role="main">
+
+      <article class="article" itemscope itemtype="http://schema.org/Article">
+
+        <div class="docs-article-container">
+          <h1 itemprop="name">{{ .Title }}</h1>
+
+          <div class="article-style" itemprop="articleBody">
+            {{ .Content }}
+          </div>
+
+          {{ partial "tags.html" . }}
+        </div>
+
+        <div class="body-footer">
+          {{ i18n "last_updated" }} {{ $.Lastmod.Format $.Site.Params.date_format }}
+        </div>
+
+      </article>
+
+      {{ partial "footer_section.html" . }}
+
+    </main>
+  </div>
+</div>
+
+{{ partial "footer.html" . }}

+ 37 - 0
layouts/partials/docs_sidebar.html

@@ -0,0 +1,37 @@
+{{ $current_page := . }}
+{{ $menu_name := (path.Base (path.Split .Path).Dir) }}
+{{ with (index .Site.Menus $menu_name) }}
+{{ else }}
+{{ errorf "Please define menu items named `[menu.%s]` in your %s front matter or define `[[menu.%s]]` in `config.toml`." $menu_name .Path $menu_name }}
+{{ end }}
+
+<form class="docs-search d-flex align-items-center">
+  <button class="btn docs-toggle d-md-none p-0 mr-3" type="button" data-toggle="collapse" data-target="#docs-nav" aria-controls="docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
+    <span><i class="fas fa-bars"></i></span>
+  </button>
+
+  {{ if eq $.Site.Params.search.engine 1 }}
+  <input name="q" type="search" class="form-control" id="search-query" placeholder="{{ i18n "search_placeholder" }}" autocomplete="off">
+  {{ end }}
+</form>
+
+<nav class="collapse docs-links" id="docs-nav">
+  {{ with (index .Site.Menus $menu_name) }}
+  {{ range (index $.Site.Menus $menu_name).ByWeight }}
+  <div class="docs-toc-item{{ if $current_page.IsMenuCurrent $menu_name . }} active{{ end }}">
+    <a class="docs-toc-link" {{ if .URL }}href="{{ .URL }}"{{else if .HasChildren }}href="{{ (index .Children 0).URL }}"{{end}}>{{ .Name }}</a>
+
+    {{- if .HasChildren }}
+    <ul class="nav docs-sidenav">
+      {{ range .Children }}
+      <li {{ if $current_page.IsMenuCurrent $menu_name . }}class="active"{{ end }}>
+        <a href="{{ .URL }}">{{ .Name }}</a>
+      </li>
+      {{ end }}
+    </ul>
+    {{ end }}
+
+  </div>
+  {{ end }}
+  {{ end }}
+</nav>

+ 0 - 0
layouts/partials/docs_toc_foot.html


+ 59 - 78
layouts/partials/footer.html

@@ -2,14 +2,8 @@
 
     {{/* Config LaTeX math rendering. */}}
     {{ if or .Params.math .Site.Params.math }}
-    <script type="text/x-mathjax-config">
-      MathJax.Hub.Config({
-        CommonHTML: { linebreaks: { automatic: true } },
-        tex2jax: { inlineMath: [ ['$', '$'], ['\\(','\\)'] ], displayMath: [ ['$$','$$'], ['\\[', '\\]'] ], processEscapes: false },
-        TeX: { noUndefined: { attributes: { mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%' } } },
-        messageStyle: 'none'
-      });
-    </script>
+    {{ $mathjax_config := resources.Get "js/mathjax-config.js" }}
+    <script src="{{ $mathjax_config.RelPermalink }}"></script>
     {{ end }}
 
     {{/* Attempt to load local vendor JS, otherwise load from CDN. */}}
@@ -37,11 +31,6 @@
       {{ end }}
     {{ end }}
 
-    <script src="{{ "/js/hugo-academic.js" | relURL }}"></script>
-    {{ range .Site.Params.custom_js }}
-    <script src="{{ "/js/" | relURL }}{{ . }}"></script>
-    {{ end }}
-
     {{/* Maps JS. */}}
     {{ if eq .Site.Params.map 1 }}
       <script async defer src="//maps.googleapis.com/maps/api/js?key={{ .Site.Params.map_api_key }}"></script>
@@ -66,9 +55,10 @@
     {{ if ne .Site.Params.search.engine 0 }}
     {{/* Configure search engine. */}}
     <script>
-      const search_index_filename = {{ "/search.json" | relURL }};
+      const search_index_filename = {{ "/index.json" | relURL }};
       const i18n = {
         'placeholder': {{ i18n "search_placeholder" }},
+        'results': {{ i18n "search_results" }},
         'no_results': {{ i18n "search_no_results" }}
       };
       const content_type = {
@@ -80,11 +70,46 @@
     </script>
     {{ end }}
 
+    {{/* Load hash anchors for documentation pages. */}}
+    {{ if eq .Type "docs" }}
+    {{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.anchor.url $js.anchor.version) $js.anchor.sri | safeHTML }}
+    <script>
+      anchors.add();
+    </script>
+    {{ end }}
+
+    {{ if eq $.Site.Params.search.engine 1 }}
+    {{/* Fuse search result template. */}}
+    <script id="search-hit-fuse-template" type="text/x-template">
+      <div class="search-hit" id="summary-{{"{{key}}"}}">
+      <div class="search-hit-content">
+        <div class="search-hit-name">
+          {{ printf "<a href=\"%s\">%s</a>" "{{relpermalink}}" "{{title}}" | safeHTML }}
+          <div class="article-metadata search-hit-type">{{"{{type}}"}}</div>
+          <p class="search-hit-description">{{"{{snippet}}"}}</p>
+        </div>
+      </div>
+      </div>
+    </script>
+    {{ else if eq $.Site.Params.search.engine 2 }}
+    {{/* Algolia search result template. */}}
+    <script id="search-hit-algolia-template" type="text/html">
+      <div class="search-hit">
+        <div class="search-hit-content">
+          <div class="search-hit-name">
+            {{ printf "<a href=\"%s\">{{{_highlightResult.title.value}}}</a>" "{{relpermalink}}" | safeHTML }}
+          </div>
+          <div class="article-metadata search-hit-type">{{"{{type}}"}}</div>
+          <p class="search-hit-description">{{ safeHTML "{{{_highlightResult.summary.value}}}" }}</p>
+        </div>
+      </div>
+    </script>
+    {{ end }}
+
     {{/* Fuse search engine. */}}
     {{ if eq .Site.Params.search.engine 1 }}
     {{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.fuse.url $js.fuse.version) $js.fuse.sri | safeHTML }}
     {{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.mark.url $js.mark.version) $js.mark.sri | safeHTML }}
-    <script src="{{ "/js/search.js" | relURL }}"></script>
     {{ end }}
 
     {{/* Algolia search engine. */}}
@@ -93,71 +118,27 @@
     {{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.instantsearch.url $js.instantsearch.version) $js.instantsearch.sri | safeHTML }}
     {{ end }}
     <script>
-      if ( $('#search-box').length ) {
-        function getTemplate(templateName) {
-          return document.querySelector(`#${templateName}-template`).innerHTML;
-        }
-
-        const options = {
-          appId: {{ .Site.Params.search.algolia.app_id }},
-          apiKey: {{ .Site.Params.search.algolia.api_key }},
-          indexName: {{ .Site.Params.search.algolia.index_name }},
-          routing: true,
-          searchParameters: {
-            hitsPerPage: 10
-          },
-          searchFunction: function(helper) {
-            let searchResults = document.querySelector('#search-hits')
-            if (helper.state.query === '') {
-              searchResults.style.display = 'none';
-              return;
-            }
-            helper.search();
-            searchResults.style.display = 'block';
-          }
-        };
-
-        const search = instantsearch(options);
-
-        // Initialize search box.
-        search.addWidget(
-          instantsearch.widgets.searchBox({
-            container: '#search-box',
-            autofocus: false,
-            poweredBy: {{ .Site.Params.search.algolia.show_logo | default false }},
-            placeholder: i18n.placeholder
-          })
-        );
-
-        // Initialize search results.
-        search.addWidget(
-          instantsearch.widgets.infiniteHits({
-            container: '#search-hits',
-            escapeHits: true,
-            templates: {
-              empty: '<div class="search-no-results">' + i18n.no_results + '</div>',
-              item: getTemplate('search-hit-algolia')
-            },
-            cssClasses: {
-              showmoreButton: 'btn btn-primary btn-outline'
-            }
-          })
-        );
+      const algoliaConfig = {
+        appId: {{ .Site.Params.search.algolia.app_id }},
+        apiKey: {{ .Site.Params.search.algolia.api_key }},
+        indexName: {{ .Site.Params.search.algolia.index_name }},
+        poweredBy: {{ .Site.Params.search.algolia.show_logo | default false }}
+      };
+    </script>
+    {{ end }}
 
-        // On render search results, localize the content type metadata.
-        search.on('render', function() {
-          $('.search-hit-type').each(function( index ) {
-            let content_key = $( this ).text();
-            if (content_key in content_type) {
-              $( this ).text(content_type[content_key]);
-            }
-          });
-        });
+    {{ $js_comment := printf "/* Source Themes Academic v%s | https://sourcethemes.com/academic/ */\n" .Site.Data.academic.version }}
+    {{ $js_bundle_head := $js_comment | resources.FromString "js/bundle-head.js" }}
+    {{ $js_academic := resources.Get "js/academic.js" }}
+    {{ $js_academic_search := resources.Get "js/academic-search.js" }}
+    {{ $js_algolia_search := resources.Get "js/algolia-search.js" }}
+    {{ $js_bundle := slice $js_academic $js_academic_search }}
+    {{ $js_bundle := $js_bundle | resources.Concat "js/academic-bundle-pre.js" | minify }}
+    {{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat "js/academic.min.js" | fingerprint "md5" }}
+    <script src="{{ $js_bundle.RelPermalink }}"></script>
 
-        // Start search.
-        search.start();
-      }
-    </script>
+    {{ range .Site.Params.custom_js }}
+    <script src="{{ "/js/" | relURL }}{{ . }}"></script>
     {{ end }}
 
   </body>

+ 13 - 36
layouts/partials/footer_container.html

@@ -1,49 +1,26 @@
-<footer class="site-footer">
-  <div class="container">
-
-    {{ with .Site.GetPage "privacy.md" }}
-    <p class="powered-by">
-      {{ printf "<a href=\"%s\">%s</a>" .Permalink .Title | safeHTML }}
-    </p>
-    {{ end }}
-
-    <p class="powered-by">
-
-      {{ with .Site.Copyright }}{{ . | markdownify}} &middot; {{ end }}
-
-      Powered by the
-      <a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
-      <a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a>.
-
-      <span class="pull-right" aria-hidden="true">
-        <a href="#" id="back_to_top">
-          <span class="button_icon">
-            <i class="fa fa-chevron-up fa-2x"></i>
-          </span>
-        </a>
-      </span>
-
-    </p>
-  </div>
-</footer>
+<div class="container">
+  {{ partial "footer_section.html" . }}
+</div>
 
 <!-- Citation modal -->
 <div id="modal" class="modal fade" role="dialog">
   <div class="modal-dialog">
     <div class="modal-content">
       <div class="modal-header">
-        <button type="button" class="close btn-large" data-dismiss="modal">&times;</button>
-        <h4 class="modal-title">{{ i18n "btn_cite" }}</h4>
+        <h5 class="modal-title">{{ i18n "btn_cite" }}</h5>
+        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+          <span aria-hidden="true">&times;</span>
+        </button>
       </div>
-      <div>
-        <pre><code class="modal-body tex"></code></pre>
+      <div class="modal-body">
+        <pre><code class="tex hljs"></code></pre>
       </div>
       <div class="modal-footer">
-        <a class="btn btn-primary btn-outline js-copy-cite" href="#" target="_blank">
-          <i class="fa fa-copy"></i> {{ i18n "btn_copy" }}
+        <a class="btn btn-outline-primary my-1 js-copy-cite" href="#" target="_blank">
+          <i class="fas fa-copy"></i> {{ i18n "btn_copy" }}
         </a>
-        <a class="btn btn-primary btn-outline js-download-cite" href="#" target="_blank">
-          <i class="fa fa-download"></i> {{ i18n "btn_download" }}
+        <a class="btn btn-outline-primary my-1 js-download-cite" href="#" target="_blank">
+          <i class="fas fa-download"></i> {{ i18n "btn_download" }}
         </a>
         <div id="modal-error"></div>
       </div>

+ 25 - 0
layouts/partials/footer_section.html

@@ -0,0 +1,25 @@
+<footer class="site-footer">
+  {{ with .Site.GetPage "privacy.md" }}
+  <p class="powered-by">
+    {{ printf "<a href=\"%s\">%s</a>" .RelPermalink .Title | safeHTML }}
+  </p>
+  {{ end }}
+
+  <p class="powered-by">
+    {{ with .Site.Copyright }}{{ . | markdownify}} &middot; {{ end }}
+
+    Powered by the
+    <a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
+    <a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a>.
+
+    {{ if ne .Type "docs" }}
+    <span class="float-right" aria-hidden="true">
+      <a href="#" id="back_to_top">
+        <span class="button_icon">
+          <i class="fas fa-chevron-up fa-2x"></i>
+        </span>
+      </a>
+    </span>
+    {{ end }}
+  </p>
+</footer>

+ 27 - 14
layouts/partials/header.html

@@ -11,15 +11,19 @@
 
   {{ $scr := .Scratch }}
   {{/* Generate page description. */}}
-  {{ $scr.Set "description" .Site.Params.role }}
-  {{ if .Params.abstract }}
-    {{ $scr.Set "description" .Params.abstract }}
-  {{ else if .Params.summary }}
-    {{ $scr.Set "description" .Params.summary }}
+  {{ $desc := "" }}
+  {{ if .Params.summary }}
+    {{ $desc = .Params.summary }}
+  {{ else if .Params.abstract }}
+    {{ $desc = .Params.abstract }}
   {{ else if .IsPage }}
-    {{ $scr.Set "description" .Summary }}
+    {{ $desc = .Summary }}
+  {{ else if .Site.Params.description }}
+    {{ $desc = .Site.Params.description }}
+  {{ else }}
+    {{ $desc = .Site.Params.role }}
   {{ end }}
-  <meta name="description" content="{{ $scr.Get "description" }}">
+  <meta name="description" content="{{ $desc }}">
 
   {{ range .Translations }}
   <link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}">
@@ -80,7 +84,7 @@
 
   {{/* We cannot use SRI with Google Fonts because the CSS is dynamically generated according to the user agent. */}}
   {{ with ($scr.Get "google_fonts") }}
-  <link rel="stylesheet" href="{{ printf "//fonts.proxy.ustclug.org/css?family=%s" . }}">
+  <link rel="stylesheet" {{ printf "href=\"//fonts.proxy.ustclug.org/css?family=%s\"" . | safeHTMLAttr }}>
   {{ end }}
 
   <link rel="stylesheet" href="{{ "styles.css" | relLangURL }}">
@@ -118,15 +122,23 @@
   <link rel="canonical" href="{{ .Permalink }}">
 
   <meta property="twitter:card" content="summary_large_image">
-  {{ range where $.Site.Params.social ".icon" "twitter" }}
-  <meta property="twitter:site" content="@{{ replaceRE "^//twitter.com/([^/]+)" "$1" .link }}">
-  <meta property="twitter:creator" content="@{{ replaceRE "^//twitter.com/([^/]+)" "$1" .link  }}">
+  {{ with .Site.Params.twitter }}
+  <meta property="twitter:site" content="@{{ . }}">
+  <meta property="twitter:creator" content="@{{ . }}">
   {{ end }}
   <meta property="og:site_name" content="{{ .Site.Title }}">
   <meta property="og:url" content="{{ .Permalink }}">
   <meta property="og:title" content="{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}">
-  <meta property="og:description" content="{{ $scr.Get "description" }}">
-  {{- with .Params.header.image }}<meta property="og:image" content="{{ printf "img/%s" . | absURL }}">{{end}}
+  <meta property="og:description" content="{{ $desc }}">
+  {{ $og_image := "" }}
+  {{ if .Params.header.image }}
+    {{ $og_image = .Params.header.image }}
+  {{ else if .Site.Params.sharing_image }}
+    {{ $og_image = .Site.Params.sharing_image }}
+  {{ else }}
+    {{ $og_image = "icon-192.png" }}
+  {{ end }}
+  {{- with $og_image }}<meta property="og:image" content="{{ printf "img/%s" . | absURL }}">{{end}}
   <meta property="og:locale" content="{{ .Site.LanguageCode | default "en-us" }}">
   {{ if .IsPage }}
   {{ if not .PublishDate.IsZero }}<meta property="article:published_time" content="{{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }}">
@@ -142,4 +154,5 @@
   <title>{{ if not .IsHome }}{{ .Title }} | {{ end }}{{ .Site.Title }}</title>
 
 </head>
-<body id="top" data-spy="scroll" data-target="{{ if or .IsHome .Params.widgets }}#navbar-main{{ else }}#toc{{ end }}" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{ end }}>
+<body id="top" data-spy="scroll" data-target="{{ if or .IsHome .Params.widgets }}#navbar-main{{ else }}#TableOfContents{{ end }}" data-offset="71" {{ if not ($scr.Get "light") }}class="dark"{{ end }}>
+  {{ partial "search" . }}

+ 0 - 12
layouts/partials/header_image.html

@@ -1,12 +0,0 @@
-{{ if .Params.header.image }}
-<div class="article-header">
-  {{ $img_src := urls.Parse .Params.header.image }}
-  {{ if $img_src.Scheme }}
-    <img src="{{ .Params.header.image }}" class="article-banner" itemprop="image">
-  {{ else }}
-    <img src="{{ (printf "/img/%s" .Params.header.image) | relURL }}" class="article-banner" itemprop="image">
-  {{ end }}
-
-  {{ with .Params.header.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
-</div>
-{{end}}

+ 52 - 32
layouts/partials/navbar.html

@@ -1,17 +1,7 @@
-<nav class="navbar navbar-default navbar-fixed-top" id="navbar-main">
+<nav class="navbar navbar-light fixed-top navbar-expand-lg py-0" id="navbar-main">
   <div class="container">
 
     <!-- Brand and toggle get grouped for better mobile display -->
-    <div class="navbar-header">
-      {{ if or .Site.Menus.main .IsTranslated }}
-      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
-              data-target=".navbar-collapse" aria-expanded="false">
-        <span class="sr-only">{{ i18n "toggle_navigation" }}</span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-        <span class="icon-bar"></span>
-      </button>
-      {{ end }}
       <a class="navbar-brand" href="{{ "/" | relLangURL }}">
         {{- if .Site.Params.logo -}}
         <img src="{{ printf "/img/%s" .Site.Params.logo | relURL }}" alt="{{ .Site.Title }}">
@@ -19,30 +9,35 @@
         {{- .Site.Title -}}
         {{- end -}}
       </a>
-    </div>
+      {{ if or .Site.Menus.main .IsTranslated }}
+      <button type="button" class="navbar-toggler" data-toggle="collapse"
+              data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="{{ i18n "toggle_navigation" }}">
+        <span><i class="fas fa-bars"></i></span>
+      </button>
+      {{ end }}
 
     <!-- Collect the nav links, forms, and other content for toggling -->
-    <div class="collapse navbar-collapse">
+    <div class="collapse navbar-collapse" id="navbar">
 
       <!-- Left Nav Bar -->
       {{ $align_right := .Site.Params.menus.align_right | default true }}
-      <ul class="nav navbar-nav {{ if $align_right }}navbar-right{{ else }}navbar-left{{ end }}">
+      <ul class="navbar-nav {{ if $align_right }}ml-auto{{ else }}mr-auto{{ end }}">
         {{ range .Site.Menus.main }}
 
         {{ if .HasChildren }}
-        <li class="dropdown">
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
+        <li class="nav-item dropdown">
+          <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
             {{ .Pre }}
-            <span>{{ .Name }}</span>
+            <span>{{ .Name | safeHTML }}</span>
             {{ .Post }}
             <span class="caret"></span>
           </a>
           <ul class="dropdown-menu">
             {{ range .Children }}
-            <li class="nav-item">
+            <li class="dropdown-item my-0 py-0 mx-0 px-0">
               <a href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
                 {{ .Pre }}
-                <span>{{ .Name }}</span>
+                <span>{{ .Name | safeHTML }}</span>
                 {{ .Post }}
               </a>
             </li>
@@ -51,7 +46,7 @@
         </li>
 
         {{ else }}
-        
+
         {{/* Set target for link. */}}
         {{ $.Scratch.Set "target" "" }}
         {{ if gt (len .URL) 4 }}
@@ -61,32 +56,57 @@
         {{ end }}
 
         <li class="nav-item">
-          <a href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}{{ ($.Scratch.Get "target") | safeHTMLAttr }}>
+          <a class="nav-link" href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}{{ ($.Scratch.Get "target") | safeHTMLAttr }}>
             {{ .Pre }}
-            <span>{{ .Name }}</span>
+            <span>{{ .Name | safeHTML }}</span>
             {{ .Post }}
           </a>
         </li>
 
         {{ end }}
         {{ end }}
-      {{ if and .IsTranslated (not $align_right) }}
+
+      {{ if and (not $align_right) (or .IsTranslated .Site.Menus.main_right) }}
       </ul>
+      <ul class="navbar-nav ml-auto">
       {{ end }}
 
-      {{ if .IsTranslated }}
-      {{ if not $align_right }}
-      <ul class="nav navbar-nav navbar-right">
-      {{ end }}
-        <li class="dropdown">
-          <a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
-            <i class="fa fa-globe" aria-hidden="true"></i>
+        {{ range .Site.Menus.main_right }}
+
+        {{/* Set target for link. */}}
+        {{ $.Scratch.Set "target" "" }}
+        {{ if gt (len .URL) 4 }}
+        {{ if eq "http" (slicestr .URL 0 4) }}
+        {{ $.Scratch.Set "target" " target=\"_blank\" rel=\"noopener\"" }}
+        {{ end }}
+        {{ end }}
+
+        <li class="nav-item">
+          <a class="nav-link" href="{{ .URL | relLangURL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}{{ ($.Scratch.Get "target") | safeHTMLAttr }}>
+          {{ .Pre }}
+          <span>{{ .Name | safeHTML }}</span>
+          {{ .Post }}
+          </a>
+        </li>
+
+        {{ end }}
+
+        {{ if .Site.Params.search.engine }}
+        <li class="nav-item">
+          <a class="nav-link js-search" href="#"><i class="fas fa-search" aria-hidden="true"></i></a>
+        </li>
+        {{ end }}
+
+        {{ if .IsTranslated }}
+        <li class="nav-item dropdown">
+          <a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown" aria-haspopup="true">
+            <i class="fas fa-globe" aria-hidden="true"></i>
             <span>{{ index .Site.Data.i18n.languages .Lang }}</span>
           </a>
           <ul class="dropdown-menu">
             {{ range .Translations }}
-            <li class="nav-item">
-              <a href="{{ .URL }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
+            <li class="dropdown-item my-0 py-0 mx-0 px-0">
+              <a href="{{ .Permalink }}"{{ if $.IsHome }} data-target="{{ .URL }}"{{ end }}>
                 <span>{{ index .Site.Data.i18n.languages .Lang }}</span>
               </a>
             </li>

+ 45 - 0
layouts/partials/page_author.html

@@ -0,0 +1,45 @@
+{{ if not (or (eq .Site.Params.profile false) (eq .Params.profile false)) }}
+
+{{ $author := "" }}
+{{ if .Params.authors }}
+  {{ $author = index .Params.authors 0 }}
+{{ end }}
+
+{{/* Display site author if page authors not explicitly specified or if first page author is site author. */}}
+{{ if or (not .Params.authors) (eq $author $.Site.Params.name) }}
+<div class="media author-card" itemscope itemtype="http://schema.org/Person">
+  {{ if $.Site.Params.gravatar }}
+  <img class="portrait mr-3" src="https://s.gravatar.com/avatar/{{ md5 $.Site.Params.email }}?s=200')" itemprop="image" alt="Avatar">
+  {{ else if $.Site.Params.avatar }}
+  <img class="portrait mr-3" src="{{ (printf "img/%s" $.Site.Params.avatar) | relURL }}" itemprop="image" alt="Avatar">
+  {{ end }}
+  <div class="media-body">
+    <h5 class="card-title" itemprop="name"><a href="{{ "/" | relLangURL }}">{{ $.Site.Params.name }}</a></h5>
+    {{ with $.Site.Params.role }}<h6 class="card-subtitle">{{.}}</h6>{{end}}
+    {{ with $.Site.Params.bio }}<p class="card-text" itemprop="description">{{. | markdownify | emojify}}</p>{{end}}
+    <ul class="network-icon" aria-hidden="true">
+      {{ range $.Site.Params.social }}
+      {{ $pack := or .icon_pack "fas" }}
+      {{ $pack_prefix := $pack }}
+      {{ if in (slice "fab" "fas" "far" "fal") $pack }}
+        {{ $pack_prefix = "fa" }}
+      {{ end }}
+      {{ $link := .link }}
+      {{ $scheme := (urls.Parse $link).Scheme }}
+      {{ $target := "" }}
+      {{ if not $scheme }}
+        {{ $link = .link | relLangURL }}
+      {{ else if in (slice "http" "https") $scheme }}
+        {{ $target = "target=\"_blank\" rel=\"noopener\"" }}
+      {{ end }}
+      <li>
+        <a itemprop="sameAs" href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>
+          <i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }}"></i>
+        </a>
+      </li>
+      {{ end }}
+    </ul>
+  </div>
+</div>
+{{end}}
+{{end}}

+ 97 - 0
layouts/partials/page_header.html

@@ -0,0 +1,97 @@
+{{ $page := . }}
+{{ $featured := (.Resources.ByType "image").GetMatch "*featured*" }}
+{{ $anchor := $page.Params.image.focal_point | default "Smart" }}
+
+{{/* Set default titles for node pages */}}
+{{ $title := .Title }}
+{{ if and (not $title) .IsNode }}
+  {{ if eq .Type "post" }}
+    {{ $title = i18n "posts" }}
+  {{ else if eq .Type "talk" }}
+    {{ $title = i18n "talks" }}
+  {{ else if eq .Type "publication" }}
+    {{ $title = i18n "publications" }}
+  {{end}}
+{{end}}
+
+{{/* Header image */}}
+{{ if and .Params.header.image (not (and $featured (not .Params.image.preview_only))) }}
+<div class="article-header">
+  {{ $img_src := urls.Parse .Params.header.image }}
+  {{ if $img_src.Scheme }}
+  <img src="{{ .Params.header.image }}" class="article-banner" itemprop="image" alt="">
+  {{ else }}
+  <img src="{{ (printf "/img/%s" .Params.header.image) | relURL }}" class="article-banner" itemprop="image" alt="">
+  {{ end }}
+
+  {{ with .Params.header.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
+</div>
+{{end}}
+
+{{/* Featured image */}}
+{{ if and $featured (not .Params.image.preview_only) }}
+{{ $image := $featured.Fill (printf "1600x400 q90 %s" $anchor) }}
+<div class="article-header d-xl-none">
+  <img src="{{ $image.RelPermalink }}" class="article-banner" itemprop="image" alt="">
+  {{ with $.Params.image.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
+</div>
+
+{{ $image := $featured.Fill (printf "680x500 q90 %s" $anchor) }}
+<div class="container-fluid split-header d-none d-xl-block">
+  <div class="row">
+    <div class="col-6">
+      <div class="split-header-content">
+        <h1 itemprop="name">{{ $title }}</h1>
+
+        {{ with $page.Params.subtitle }}
+        <p class="page-subtitle">{{ . | markdownify | emojify }}</p>
+        {{end}}
+
+        {{ partial "page_metadata" (dict "content" $page "is_list" 1) }}
+
+        {{ partial "page_links_div.html" $page }}
+
+        {{ partial "share.html" $page }}
+      </div>
+    </div>
+    <div class="col-6">
+      <div class="split-header-image">
+        <img src="{{ $image.RelPermalink }}" itemprop="image" alt="">
+        {{ with $.Params.image.caption }}<span class="article-header-caption">{{ . | markdownify | emojify }}</span>{{ end }}
+      </div>
+    </div>
+  </div>
+</div>
+
+<div class="article-container d-xl-none">
+  <h1 itemprop="name">{{ $title }}</h1>
+
+  {{ with $page.Params.subtitle }}
+  <p class="page-subtitle">{{ . | markdownify | emojify }}</p>
+  {{end}}
+
+  {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
+
+  {{ partial "page_links_div.html" $page }}
+</div>
+{{else}}
+  {{/* Case when page has no image */}}
+
+  {{/* Wider container for nodes */}}
+  {{ $ctnr := "article-container" }}
+  {{ if $page.IsNode }}
+    {{ $ctnr = "universal-wrapper" }}
+  {{end}}
+<div class="{{$ctnr}} pt-3">
+  <h1 itemprop="name">{{ $title }}</h1>
+
+  {{ with $page.Params.subtitle }}
+  <p class="page-subtitle">{{ . | markdownify | emojify }}</p>
+  {{end}}
+
+  {{ if not .IsNode }}
+    {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
+    {{ partial "page_links_div.html" $page }}
+  {{end}}
+</div>
+{{end}}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно