Add/modify config.toml settings to customize homepage language and recent publication/post counts. Refer to exampleSite/config.toml for changes.

This commit is contained in:
George Cushen 2016-05-24 22:20:08 +01:00
commit d03e66c7f9
4 changed files with 161 additions and 97 deletions

View file

@ -15,7 +15,6 @@ googleAnalytics = ""
name = "Lena Smith"
role = "Professor of Artificial Intelligence"
organization = "Stanford University"
interests = ["Artificial Intelligence", "Computational Linguistics", "Information Retrieval"]
email = "test@example.org"
address = "Stanford AI Lab, Stanford University, California, 90210, USA."
phone = "888 888 88 88"
@ -31,24 +30,57 @@ googleAnalytics = ""
custom_css = []
custom_js = []
[[params.education]]
# 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.education]]
[[params.about.education]]
course = "MEng in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2009
[[params.education]]
[[params.about.education]]
course = "BSc in Artificial Intelligence"
institution = "Massachusetts Institute of Technology"
year = 2008
# Publications section.
# Section will only be displayed if there are publications in `content/publication/`.
[params.publications]
count = 10
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]
# Automatically link email and phone?
autolink = true
enable = true
title = "Contact"
subtitle = ""
autolink = true # Automatically link email and phone?
# Social/Academic Networking
#
@ -83,7 +115,6 @@ googleAnalytics = ""
# Navigation Links
#
# The weight parameter defines the order that the links will appear in.
[[menu.main]]

View file

@ -22,13 +22,21 @@
<section id="publications" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4">
<h1>Recent Publications</h1>
<p><a href="{{ .Site.BaseURL }}publication/">More Publications <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p>
<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">
<ul class="fa-ul">
{{ range $index, $page := first 10 (where .Data.Pages "Type" "publication") }}
{{ range $index, $page := first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }}
<li itemscope itemtype="http://schema.org/CreativeWork">
<i class="fa-li fa fa-file-text-o pub-icon" aria-hidden="true"></i>
<span itemprop="name">{{ .Title }}</span>
@ -49,12 +57,20 @@
<section id="posts" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4">
<h1>Posts</h1>
<p><a href="{{ .Site.BaseURL }}post/">More Posts <i class="fa fa-angle-double-right" style="padding-left: 5px;"></i></a></p>
<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 5 (where .Data.Pages "Type" "post") }}
{{ range first .Site.Params.posts.count (where .Data.Pages "Type" "post") }}
<div class="article-list-item" itemscope="" itemprop="blogPost">
<h3 class="post-title" itemprop="name"><a href="{{ .Permalink }}" itemprop="url">{{ .Title }}</a></h3>
{{ partial "article_metadata" (dict "content" . "is_list" 1) }}
@ -66,7 +82,9 @@
{{ end }}
</p>
<p class="read-more">
<a href="{{ .Permalink }}" class="btn btn-primary btn-outline">Read more</a>
<a href="{{ .Permalink }}" class="btn btn-primary btn-outline">
{{ with .Site.Params.posts.str_read_more }}{{ . | markdownify }}{{ end }}
</a>
</p>
</div>
{{ end }}
@ -83,8 +101,9 @@
<section id="projects" class="home-section">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4">
<h1>Projects</h1>
<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">
@ -127,8 +146,9 @@
<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">
<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 }}
@ -141,11 +161,13 @@
<!-- 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">
<h1>Contact</h1>
<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" . }}
@ -153,7 +175,7 @@
</div>
</div>
</section>
{{ end }}
<!-- Page Footer -->
{{ partial "footer_container.html" . }}

View file

@ -7,7 +7,7 @@
<div class="portrait-title">
<h2 itemprop="name">{{ .Site.Params.name }}</h2>
<h3 itemprop="jobTitle">{{ .Site.Params.role }}</h3>
<h3 itemprop="worksFor">{{ .Site.Params.organization }}</h3>
{{ with .Site.Params.organization }}<h3 itemprop="worksFor">{{ . }}</h3>{{ end }}
</div>
<ul class="social-icon">
@ -35,22 +35,22 @@
<div class="row">
{{ if isset .Site.Params "interests" }}
{{ if isset .Site.Params.about "interests" }}
<div class="col-md-5">
<h3>Interests</h3>
<h3>{{ with .Site.Params.about.str_interests }}{{ . | markdownify }}{{ end }}</h3>
<ul>
{{ range .Site.Params.interests }}
{{ range .Site.Params.about.interests }}
<li>{{ . }}</li>
{{ end }}
</ul>
</div>
{{ end }}
{{ if isset .Site.Params "education" }}
{{ if isset .Site.Params.about "education" }}
<div class="col-md-7">
<h3>Education</h3>
<h3>{{ with .Site.Params.about.str_education }}{{ . | markdownify }}{{ end }}</h3>
<ul class="ul-edu fa-ul">
{{ range .Site.Params.education }}
{{ range .Site.Params.about.education }}
<li>
<i class="fa-li fa fa-graduation-cap"></i>
<div class="description">

View file

@ -160,6 +160,17 @@ pre {
background-color: rgb(247, 247, 247);
}
.section-heading h1 {
margin: 0 0 10px 0;
}
.section-heading p {
font-family: 'Lato', sans-serif;
font-weight: 400;
font-size: 1.1rem;
color: #b2b2b2;
}
/*************************************************
* Biography
**************************************************/