Refactor homepage sections as dedicated widgets in content/home/.

Enable full control of the order in which sections appear.
Add option to add custom Markdown content at top of widgets (e.g. to introduce sections).
Add Keybase option to config.
Use 2 space indentation.
Update docs.
Note: requires Hugo 0.16.
This commit is contained in:
George Cushen 2016-09-24 18:22:47 +01:00
commit 61769e9b29
20 changed files with 544 additions and 395 deletions

View file

@ -20,88 +20,25 @@ googleAnalytics = ""
address = "Stanford AI Lab, Stanford University, California, 90210, USA."
phone = "888 888 88 88"
# Enable Keybase in Contact section by entering your keybase.io username.
keybase = ""
# Date format (refer to Go's date format: http://flippinggodateformat.com )
# Examples: "Mon, Jan 2, 2006" or "2006-01-02"
date_format = "Mon, Jan 2, 2006"
# Enable global LaTeX math rendering? If false, you can enable it locally
# on a per page basis.
# Enable global LaTeX math rendering?
# If false, you can enable it locally on a per page basis.
math = false
# Enable native social sharing buttons?
sharing = true
# Link custom CSS and JS assets (relative to /static/css and
# /static/js respectively)
# Link custom CSS and JS assets
# (relative to /static/css and /static/js respectively)
custom_css = []
custom_js = []
# Biography section.
# Section will only be displayed if `content/home/about.md` exists.
[params.about]
interests = [
"Artificial Intelligence",
"Computational Linguistics",
"Information Retrieval"
]
str_interests = "Interests"
str_education = "Education"
[[params.about.education]]
course = "PhD in Artificial Intelligence"
institution = "Stanford University"
year = 2012
[[params.about.education]]
course = "MEng in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2009
[[params.about.education]]
course = "BSc in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2008
# Selected Publications section.
# Section will only be displayed if there are publications with
# `selected = true` in their `+++` preamble.
[params.publications_selected]
detailed_list = true
title = "Selected Publications"
subtitle = ""
# Publications section.
# Section will only be displayed if there are publications in
# `content/publication/`.
[params.publications]
count = 10
detailed_list = false
title = "Recent Publications"
subtitle = ""
str_all = "More Publications"
# Posts section.
# Section will only be displayed if there are posts in `content/post/`.
[params.posts]
count = 5
title = "Recent Posts"
subtitle = ""
str_all = "More Posts"
str_read_more = "Read more"
# Projects section.
# Section will only be displayed if there are projects in
# `content/project/`.
[params.projects]
title = "Projects"
subtitle = ""
# Contact section.
[params.contact]
enable = true
title = "Contact"
subtitle = ""
autolink = true # Automatically link email and phone?
# Social/Academic Networking
#

View file

@ -1,9 +1,42 @@
+++
# About/Biography widget.
date = "2016-04-20T00:00:00"
draft = false
title = "about"
section_id = 0
widget = "about"
# Order that this section will appear in.
weight = 0
# List your academic interests.
[interests]
title = "Interests"
interests = [
"Artificial Intelligence",
"Computational Linguistics",
"Information Retrieval"
]
# List your qualifications (such as academic degrees).
[education]
title = "Education"
[[education.courses]]
course = "PhD in Artificial Intelligence"
institution = "Stanford University"
year = 2012
[[education.courses]]
course = "MEng in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2009
[[education.courses]]
course = "BSc in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2008
+++
# Biography

View file

@ -0,0 +1,18 @@
+++
# Contact widget.
date = "2016-04-20T00:00:00"
draft = false
title = "Contact"
subtitle = ""
widget = "contact"
# Order that this section will appear in.
weight = 60
# Automatically link email and phone?
autolink = true
+++

View file

@ -0,0 +1,23 @@
+++
# Recent Posts widget.
# Note: this widget will only display if `content/post/` contains posts.
date = "2016-04-20T00:00:00"
draft = false
title = "Recent Posts"
subtitle = ""
widget = "posts"
# Order that this section will appear in.
weight = 30
# Number of posts to list.
count = 5
# Links.
str_all = "More Posts"
str_read_more = "CONTINUE READING"
+++

View file

@ -0,0 +1,16 @@
+++
# Projects widget.
# Note: this widget will only display if `content/project/` contains projects.
date = "2016-04-20T00:00:00"
draft = false
title = "Projects"
subtitle = ""
widget = "projects"
# Order that this section will appear in.
weight = 40
+++

View file

@ -0,0 +1,25 @@
+++
# Recent Publications widget.
# Note: this widget will only display if `content/publication/` contains publications.
date = "2016-04-20T00:00:00"
draft = false
title = "Recent Publications"
subtitle = ""
widget = "pubs"
# Order that this section will appear in.
weight = 20
# Number of publications to list.
count = 10
# Show publication details (such as abstract)? (true/false)
detailed_list = false
# Link.
str_all = "More Publications"
+++

View file

@ -0,0 +1,20 @@
+++
# Selected Publications widget.
# Note: this widget will only display if `content/publication/` contains publications
# with `selected = true` in their `+++` preamble.
date = "2016-04-20T00:00:00"
draft = false
title = "Selected Publications"
subtitle = ""
widget = "pubs_selected"
# Order that this section will appear in.
weight = 10
# Show publication details (such as abstract)? (true/false)
detailed_list = true
+++

View file

@ -1,10 +1,16 @@
+++
# An example of using the custom widget to create your own home page section.
# To create more sections, duplicate this file and edit the values below as desired.
date = "2016-04-20T00:00:00"
draft = false
title = "teaching"
title = "Teaching"
subtitle = ""
section_id = 10
weight = 10
# Order that this section will appear in.
weight = 50
+++
I am a teaching instructor for the following courses at University X:

View file

@ -52,9 +52,9 @@ Assuming you created a new website with the example content following the instal
The core parameters for the website can be edited in the `config.toml` configuration file.
As can be seen in the example `config.toml`, the social/academic networking icons and education qualifications are defined as multiples of `[[params.social]]` and `[[params.about.education]]` respectively. They can be duplicated or deleted as necessary.
As can be seen in the example `config.toml`, the social/academic networking icons are defined as multiples of `[[params.social]]`. They can be duplicated or deleted as necessary.
By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `detailed_list = true` under `[params.publications]`.
By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `detailed_list = true` in `content/home/publications.md`.
For deployment, the `baseURL` variable should be changed to match your website URL such as `baseURL = "http://your-site.org/"`. The example Disqus commenting variable should be cleared (e.g. `disqusShortname = ""`) or set to your own Disqus shortname to enable commenting. To enable Google Analytics, add your tracking code in `config.toml` similarly to `googleAnalytics = "UA-12345678-9"`.
@ -98,9 +98,8 @@ To list available updates:
$ git fetch upstream
$ git log --pretty=oneline --abbrev-commit --decorate HEAD..upstream/master
Upgrade by running:
Then, upgrade by running:
$ cd themes/academic
$ git pull upstream
If you have modified files in `themes/academic`, git will attempt to auto-merge changes. If conflicts are reported, you will need to manually edit the files with conflicts and add them back (`git add <filename>`).

View file

@ -12,31 +12,49 @@ To enable LaTeX math rendering for a page, you should include `math = true` in t
To display an image in publication, post, or project page headers, you can include the `image = "my-image.jpg"` option in the page `+++` preamble. It is automatically assumed that the image is located in your `static/img/` folder. In the context of posts and projects, the image is intended to behave as a full width banner across the top of the article.
## Homepage sections
## Homepage widgets
Homepage sections for publications, projects and posts will automatically hide when there is no content of the respective type. Therefore, if you do not require a particular feature, you can simply delete any associated content in the `content/` folder.
The example site includes the following widgets which display as sections on the homepage:
- About/biography
- Selected publications
- Recent publications
- Recent news/blog posts
- Projects
- Example custom widget called *teaching*
- Contact
### Introduce yourself with a biography
Place a cropped portrait photo named `portrait.jpg` into the `static/img/` folder, overwriting any defaults.
Place a cropped portrait photo named `portrait.jpg` into the `static/img/` folder, overwriting any defaults. Alternatively, you can edit the `avatar` filepath in `config.toml` to point to a different image name - this is particularly useful if you wish to use a different image format such as PNG.
Edit your biography in the example `content/home/about.md` file that you copied across from the `themes/academic/exampleSite/` folder. The research interests and qualifications are stored separately as `interests` and `education` variables under `[params.about]` in `config.toml`, as can be seen in the example config. It's possible to completely hide the interests and education lists by deleting their respective variables.
Edit your biography in the example `content/home/about.md` file that you copied across from the `themes/academic/exampleSite/` folder. The research interests and qualifications are stored as `interests` and `education` variables. The academic qualifications are defined as multiples of `[[education.courses]]` and can be duplicated or deleted as necessary. It's possible to completely hide the interests and education lists by deleting their respective variables.
### Add a section to the homepage
To add a new section to the homepage:
You can use the custom widget to create your own home page sections.
hugo new home/my-section-name.md
Simply duplicate (copy/paste) and rename the example *teaching* file at `content/home/teaching.md`. Then edit the section title, weight (refer to *Ordering sections* below), and content as desired.
Then edit the newly created file `content/home/my-section-name.md` with your section title and content. In the `+++` preamble, you should also increment the `section_id` to ensure it's unique amongst the other sections in `content/home` and you can adjust `weight` variable to change the order within the custom section of the home page.
You may also wish to add a navigation link pointing to the new section. This can be achieved by adding something similar to the following lines to your `config.toml`, where the URL will consist of the first title word in lowercase:
You may also wish to add a navigation link to the top of the page that points to the new section. This can be achieved by adding something similar to the following lines to your `config.toml`, where the URL will consist of the first title word in lowercase:
[[menu.main]]
name = "Research"
url = "#research"
weight = 10
### Remove a section from the homepage
Note that homepage widgets for publications, projects and posts will automatically hide when there is no content of the respective type.
Otherwise, if you do not require a particular widget, you can simply delete any associated files from the `content/home/` folder.
To remove a navigation link from the top of the page, remove the associated `[[menu.main]]` entry in `config.toml`.
### Ordering sections
The order that the homepage sections are displayed in is defined by the `weight` parameter in each of the files in the `content/home/` directory. The sections are displayed in ascending order of their `weight`, so you can simply edit the `weight` parameters as desired.
## Create a publication
To create a new publication:
@ -86,6 +104,8 @@ To create a blog/news article:
Then edit the newly created file `content/post/my-article-name.md` with your full title and content.
To disable commenting for a specific post, you can add `disable_comments = true` to the post `+++` preamble. Or to disable commenting for all posts, you can either set `disqusShortname = ""` or `disable_comments = true` in `config.toml`.
## Create a project
To create a project:

View file

@ -4,216 +4,26 @@
<!-- Flag for jQuery -->
<span id="homepage" style="display: none"></span>
<!-- Biography Section -->
{{ range where .Data.Pages "Type" "home" }}
{{ if eq .Title "about" }}
<section id="bio" class="home-section">
<div class="container">
{{ partial "home_biography" . }}
</div>
</section>
{{ end }}
{{ end }}
<!-- Selected Publications Section -->
<!-- Widgets -->
{{ $pubs_selected_len := len (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
{{ if gt $pubs_selected_len 0 }}
<section id="publications" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Site.Params.publications_selected.title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Site.Params.publications_selected.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ if .Site.Params.publications_selected.detailed_list }}
{{ range (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
{{ partial "publication_li_detailed" . }}
{{ end }}
{{ else }}
<ul class="fa-ul">
{{ range (where (where .Data.Pages "Type" "publication") ".Params.selected" true) }}
{{ partial "publication_li_simple" . }}
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}
<!-- Publications Section -->
{{ $pubs_len := len (where .Data.Pages "Type" "publication") }}
{{ if gt $pubs_len 0 }}
<section {{ if eq $pubs_selected_len 0 }}id="publications" {{ end }}class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Site.Params.publications.title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Site.Params.publications.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $pubs_len .Site.Params.publications.count }}
<p class="view-all">
<a href="{{ .Site.BaseURL }}publication/">
{{ with .Site.Params.publications.str_all }}{{ . | markdownify }}{{ end }}
<i class="fa fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ if .Site.Params.publications.detailed_list }}
{{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }}
{{ partial "publication_li_detailed" . }}
{{ end }}
{{ else }}
<ul class="fa-ul">
{{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }}
{{ partial "publication_li_simple" . }}
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}
<!-- Blog Posts Section -->
{{ $posts_len := len (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
{{ if gt $posts_len 0 }}
<section id="posts" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Site.Params.posts.title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Site.Params.posts.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $posts_len .Site.Params.posts.count }}
<p class="view-all">
<a href="{{ .Site.BaseURL }}post/">
{{ with .Site.Params.posts.str_all }}{{ . | markdownify }}{{ end }}
<i class="fa fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ range first .Site.Params.posts.count (where (where .Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
<div class="article-list-item" itemscope itemprop="blogPost">
{{ if .Params.image }}
<a href="{{ .Permalink }}">
<img src="{{ $.Site.BaseURL }}img/{{ .Params.image }}" class="article-banner" itemprop="image">
</a>
{{end}}
<h3 class="article-title" itemprop="name"><a href="{{ .Permalink }}" itemprop="url">{{ .Title }}</a></h3>
{{ partial "article_metadata" (dict "content" . "is_list" 1) }}
<p class="article-style" itemprop="articleBody">
{{ if .Truncated }}
{{ printf "%s" .Summary | markdownify }}
{{ else }}
{{ .Content }}
{{ end }}
</p>
<p class="read-more">
<a href="{{ .Permalink }}" class="btn btn-primary btn-outline">
{{ with .Site.Params.posts.str_read_more }}{{ . | markdownify }}{{ end }}
</a>
</p>
</div>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}
<!-- Projects Section -->
{{ $projects_len := len (where .Data.Pages "Type" "project") }}
{{ if gt $projects_len 0 }}
<section id="projects" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Site.Params.projects.title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Site.Params.projects.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
<ul class="fa-ul">
{{ range where .Data.Pages "Type" "project" }}
<li>
<span class="project-title">
{{ if .Content }}<a href="{{ .Permalink }}">{{ else }}{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}{{ end }}
<i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
{{ .Title }}
{{ if .Content }}</a >{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
</span>
{{ with .Params.summary }}<p class="project-summary">{{ . }}</p>{{ end }}
{{ if isset .Params "tags" }}
{{ $tagsLen := len .Params.tags }}
{{ if gt $tagsLen 0 }}
<div class="project-tags">
<i class="fa fa-tags"></i>
{{ range $k, $v := .Params.tags }}
{{ . }}{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</section>
{{ end }}
<!-- Custom Sections -->
{{ range $index, $page := where .Data.Pages "Type" "home" }}
{{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
{{ $title_words := split $page.Title " " }}
<section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ title $page.Title }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ $page.Content }}
</div>
</div>
</div>
</section>
{{ end }}
{{ end }}
<!-- Contact Section -->
{{ if .Site.Params.contact.enable }}
<section id="contact" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Site.Params.contact.title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Site.Params.contact.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ partial "home_contact.html" . }}
</div>
</div>
</div>
</section>
{{ if eq $page.Params.widget "about" }}
{{ partial "widgets/about" $page }}
{{ else if eq $page.Params.widget "pubs_selected" }}
{{ partial "widgets/publications_selected" (dict "root" $ "page" $page "pubs_selected_len" $pubs_selected_len) }}
{{ else if eq $page.Params.widget "pubs" }}
{{ partial "widgets/publications" (dict "root" $ "page" $page "pubs_selected_len" $pubs_selected_len) }}
{{ else if eq $page.Params.widget "posts" }}
{{ partial "widgets/posts" (dict "root" $ "page" $page) }}
{{ else if eq $page.Params.widget "projects" }}
{{ partial "widgets/projects" (dict "root" $ "page" $page) }}
{{ else if eq $page.Params.widget "contact" }}
{{ partial "widgets/contact.html" $page }}
{{ else }}
{{ partial "widgets/custom.html" $page }}
{{ end }}
{{ end }}
<!-- Page Footer -->
{{ partial "footer_container.html" . }}
{{ partial "footer.html" . }}

View file

@ -1,69 +0,0 @@
<div class="row" itemprop="author" itemscope itemtype="http://schema.org/Person">
<div class="col-xs-12 col-md-4">
<div id="profile">
<div class="portrait" itemprop="image" style="background-image: url('{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}');"></div>
<div class="portrait-title">
<h2 itemprop="name">{{ .Site.Params.name }}</h2>
<h3 itemprop="jobTitle">{{ .Site.Params.role }}</h3>
{{ with .Site.Params.organization }}<h3 itemprop="worksFor">{{ . }}</h3>{{ end }}
</div>
<ul class="social-icon">
{{ range .Site.Params.social }}
<li>
<a href="{{ .link }}">
{{ if eq .icon_pack "ai" }}
<i class="ai ai-{{ .icon }} big-icon" aria-hidden="true"></i>
{{ else }}
<i class="fa fa-{{ .icon }} big-icon" aria-hidden="true"></i>
{{ end }}
</a>
</li>
{{ end }}
</ul>
</div>
</div>
<div class="visible-sm visible-xs"></div>
<div class="col-xs-12 col-md-8" itemprop="description">
{{ .Content }}
<div class="row">
{{ if isset .Site.Params.about "interests" }}
<div class="col-sm-5">
<h3>{{ with .Site.Params.about.str_interests }}{{ . | markdownify }}{{ end }}</h3>
<ul>
{{ range .Site.Params.about.interests }}
<li>{{ . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if isset .Site.Params.about "education" }}
<div class="col-sm-7">
<h3>{{ with .Site.Params.about.str_education }}{{ . | markdownify }}{{ end }}</h3>
<ul class="ul-edu fa-ul">
{{ range .Site.Params.about.education }}
<li>
<i class="fa-li fa fa-graduation-cap"></i>
<div class="description">
<p class="course">{{ .course }}, {{ .year }}</p>
<p class="institution">{{ .institution }}</p>
</div>
</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</div>
</div>

View file

@ -1,32 +0,0 @@
<ul class="list-unstyled">
{{ with .Site.Params.phone }}
<li>
<i class="fa fa-phone fa-fw" aria-hidden="true"></i>
{{ if and (isset $.Site.Params.contact "autolink") (eq $.Site.Params.contact.autolink false) }}
<span>{{ . }}</span>
{{ else }}
<span><a href="tel:{{ . }}">{{ . }}</a></span>
{{ end }}
</li>
{{ end }}
{{ with .Site.Params.email }}
<li>
<i class="fa fa-envelope fa-fw" aria-hidden="true"></i>
{{ if and (isset $.Site.Params.contact "autolink") (eq $.Site.Params.contact.autolink false) }}
<span>{{ . }}</span>
{{ else }}
<span><a href="mailto:{{ . }}">{{ . }}</a></span>
{{ end }}
</li>
{{ end }}
{{ with .Site.Params.address }}
<li>
<i class="fa fa-map-marker fa-fw" aria-hidden="true"></i>
<span>{{ . }}</span>
</li>
{{ end }}
</ul>

View file

@ -0,0 +1,78 @@
<!-- About/Biography widget -->
<section id="bio" class="home-section">
<div class="container">
<div class="row" itemprop="author" itemscope itemtype="http://schema.org/Person">
<div class="col-xs-12 col-md-4">
<div id="profile">
<div class="portrait" itemprop="image"
style="background-image: url('{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}');">
</div>
<div class="portrait-title">
<h2 itemprop="name">{{ .Site.Params.name }}</h2>
<h3 itemprop="jobTitle">{{ .Site.Params.role }}</h3>
{{ with .Site.Params.organization }}<h3 itemprop="worksFor">{{ . }}</h3>{{ end }}
</div>
<ul class="social-icon">
{{ range .Site.Params.social }}
<li>
<a href="{{ .link }}">
{{ if eq .icon_pack "ai" }}
<i class="ai ai-{{ .icon }} big-icon" aria-hidden="true"></i>
{{ else }}
<i class="fa fa-{{ .icon }} big-icon" aria-hidden="true"></i>
{{ end }}
</a>
</li>
{{ end }}
</ul>
</div>
</div>
<div class="visible-sm visible-xs"></div>
<div class="col-xs-12 col-md-8" itemprop="description">
{{ .Content }}
<div class="row">
{{ with .Params.interests }}
<div class="col-sm-5">
<h3>{{ .title | default "Interests" | markdownify }}</h3>
<ul>
{{ range .interests }}
<li>{{ . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ with .Params.education }}
<div class="col-sm-7">
<h3>{{ .title | default "Education" | markdownify }}</h3>
<ul class="ul-edu fa-ul">
{{ range .courses }}
<li>
<i class="fa-li fa fa-graduation-cap"></i>
<div class="description">
<p class="course">{{ .course }}, {{ .year }}</p>
<p class="institution">{{ .institution }}</p>
</div>
</li>
{{ end }}
</ul>
</div>
{{ end }}
</div>
</div>
</div>
</div>
</section>

View file

@ -0,0 +1,59 @@
<!-- Contact widget -->
<section id="contact" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with .Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with .Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with .Content }}<p>{{ . | markdownify }}</p>{{ end }}
<ul class="list-unstyled">
{{ with .Site.Params.email }}
<li>
<i class="fa fa-envelope fa-fw big-icon" aria-hidden="true"></i>
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
<span>{{ . }}</span>
{{ else }}
<span><a href="mailto:{{ . }}">{{ . }}</a></span>
{{ end }}
</li>
{{ end }}
{{ with .Site.Params.keybase }}
<li>
<i class="fa fa-lock fa-fw big-icon" aria-hidden="true"></i>
<span>
<a href="https://keybase.io/{{ . }}" target="_blank">@{{ . }}</a> on Keybase.
</span>
</li>
{{ end }}
{{ with .Site.Params.phone }}
<li>
<i class="fa fa-phone fa-fw big-icon" aria-hidden="true"></i>
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
<span>{{ . }}</span>
{{ else }}
<span><a href="tel:{{ . }}">{{ . }}</a></span>
{{ end }}
</li>
{{ end }}
{{ with .Site.Params.address }}
<li>
<i class="fa fa-map-marker fa-fw big-icon" aria-hidden="true"></i>
<span>{{ . }}</span>
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</section>

View file

@ -0,0 +1,19 @@
{{ $page := . }}
{{ $title_words := split $page.Title " " }}
<!-- Custom widget -->
<section
id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}"
class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ title $page.Title }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ $page.Content }}
</div>
</div>
</div>
</section>

View file

@ -0,0 +1,57 @@
{{ $ := .root }}
{{ $page := .page }}
{{ $posts_len := len (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
{{ if gt $posts_len 0 }}
<!-- Blog Posts widget -->
<section id="posts" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $posts_len $page.Params.count }}
<p class="view-all">
<a href="{{ .Site.BaseURL }}post/">
{{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }}
<i class="fa fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ range first $page.Params.count (where (where $.Data.Pages "Type" "post") ".Params.notonhomepage" nil) }}
<div class="article-list-item" itemscope itemprop="blogPost">
{{ if .Params.image }}
<a href="{{ .Permalink }}">
<img src="{{ $.Site.BaseURL }}img/{{ .Params.image }}" class="article-banner"
itemprop="image">
</a>
{{end}}
<h3 class="article-title" itemprop="name">
<a href="{{ .Permalink }}" itemprop="url">{{.Title }}</a>
</h3>
{{ partial "article_metadata" (dict "content" . "is_list" 1) }}
<p class="article-style" itemprop="articleBody">
{{ if .Truncated }}
{{ printf "%s" .Summary | markdownify }}
{{ else }}
{{ .Content }}
{{ end }}
</p>
<p class="read-more">
<a href="{{ .Permalink }}" class="btn btn-primary btn-outline">
{{ with $page.Params.str_read_more }}{{ . | markdownify }}{{ end }}
</a>
</p>
</div>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}

View file

@ -0,0 +1,53 @@
{{ $ := .root }}
{{ $page := .page }}
{{ $projects_len := len (where $.Data.Pages "Type" "project") }}
{{ if gt $projects_len 0 }}
<!-- Projects widget -->
<section id="projects" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
<ul class="fa-ul">
{{ range where $.Data.Pages "Type" "project" }}
<li>
<span class="project-title">
{{ if .Content }}
<a href="{{ .Permalink }}">
{{ else }}
{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}
{{ end }}
<i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
{{ .Title }}
{{ if .Content }}</a>{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
</span>
{{ with .Params.summary }}<p class="project-summary">{{ . }}</p>{{ end }}
{{ if isset .Params "tags" }}
{{ $tagsLen := len .Params.tags }}
{{ if gt $tagsLen 0 }}
<div class="project-tags">
<i class="fa fa-tags"></i>
{{ range $k, $v := .Params.tags }}
{{ . }}{{ if lt $k (sub $tagsLen 1) }}, {{ end }}
{{ end }}
</div>
{{ end }}
{{ end }}
</li>
{{ end }}
</ul>
</div>
</div>
</div>
</section>
{{ end }}

View file

@ -0,0 +1,43 @@
{{ $ := .root }}
{{ $page := .page }}
{{ $pubs_selected_len := .pubs_selected_len }}
{{ $pubs_len := len (where $.Data.Pages "Type" "publication") }}
{{ if gt $pubs_len 0 }}
<!-- Publications widget -->
<section {{ if eq $pubs_selected_len 0 }}id="publications" {{ end }}class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if gt $pubs_len $page.Params.count }}
<p class="view-all">
<a href="{{ $.Site.BaseURL }}publication/">
{{ with $page.Params.str_all }}{{ . | markdownify }}{{ end }}
<i class="fa fa-angle-double-right"></i>
</a>
</p>
{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $page.Params.detailed_list }}
{{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }}
{{ partial "publication_li_detailed" . }}
{{ end }}
{{ else }}
<ul class="fa-ul">
{{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }}
{{ partial "publication_li_simple" . }}
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}

View file

@ -0,0 +1,34 @@
{{ $ := .root }}
{{ $page := .page }}
{{ $pubs_selected_len := .pubs_selected_len }}
{{ if gt $pubs_selected_len 0 }}
<!-- Selected Publications widget -->
<section id="publications" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 section-heading">
<h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div class="col-xs-12 col-md-8">
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
{{ if $page.Params.detailed_list }}
{{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }}
{{ partial "publication_li_detailed" . }}
{{ end }}
{{ else }}
<ul class="fa-ul">
{{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }}
{{ partial "publication_li_simple" . }}
{{ end }}
</ul>
{{ end }}
</div>
</div>
</div>
</section>
{{ end }}