From f06857f9d9e2d7f672f7c542fd2e245593b4f150 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Wed, 25 May 2016 21:49:08 +0100 Subject: [PATCH] 1) Add `image` option to page preamble to enable displaying an image in publication, post, and project page headers; 2) add detailed publication list to homepage, enabled by setting `detailed_list = true` under `[params.publications]` in `config.toml`. --- archetypes/post.md | 1 - archetypes/project.md | 2 - archetypes/publication.md | 2 + exampleSite/config.toml | 1 + layouts/_default/single.html | 6 ++ layouts/index.html | 19 +++-- layouts/partials/publication_list_item.html | 53 ++++++++++++++ layouts/project/single.html | 4 ++ layouts/publication/single.html | 20 +++--- layouts/section/post.html | 5 ++ static/css/hugo-academic.css | 77 +++++++++++++++++---- 11 files changed, 163 insertions(+), 27 deletions(-) create mode 100644 layouts/partials/publication_list_item.html diff --git a/archetypes/post.md b/archetypes/post.md index b61cfb68..ef4c202d 100644 --- a/archetypes/post.md +++ b/archetypes/post.md @@ -1,6 +1,5 @@ +++ image = "" -image_preview = "" math = false tags = [] +++ diff --git a/archetypes/project.md b/archetypes/project.md index ee140ad8..b923f240 100644 --- a/archetypes/project.md +++ b/archetypes/project.md @@ -2,8 +2,6 @@ tags = [] summary = "" image = "" -image_preview = "" math = false -client_name = "" external_link = "" +++ diff --git a/archetypes/publication.md b/archetypes/publication.md index 7b43a20c..5c7ee13d 100644 --- a/archetypes/publication.md +++ b/archetypes/publication.md @@ -1,10 +1,12 @@ +++ abstract = "" +abstract_short = "" authors = [""] image = "" image_preview = "" math = false publication = "" +publication_short = "" url_pdf = "" url_code = "" url_dataset = "" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 135277cd..2d1356d4 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -59,6 +59,7 @@ googleAnalytics = "" # 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" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 8bad58ff..88d38d9f 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,6 +3,11 @@
+ + {{ if .Params.image }} + + {{end}} +

{{ .Title }}

{{ partial "article_metadata" (dict "content" . "is_list" 0) }} @@ -10,6 +15,7 @@
{{ .Content }}
+
{{ partial "section_pager.html" . }} diff --git a/layouts/index.html b/layouts/index.html index 4dd0851d..f5a8bf1d 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -35,15 +35,21 @@ {{ end }}
+ {{ if .Site.Params.publications.detailed_list }} + {{ range first .Site.Params.publications.count (where .Data.Pages "Type" "publication") }} + {{ partial "publication_list_item" . }} + {{ end }} + {{ else }} + {{ end }}
@@ -71,8 +77,13 @@
{{ range first .Site.Params.posts.count (where .Data.Pages "Type" "post") }} -
-

+
+ {{ if .Params.image }} + + + + {{end}} +

{{ partial "article_metadata" (dict "content" . "is_list" 1) }}

{{ if .Truncated }} diff --git a/layouts/partials/publication_list_item.html b/layouts/partials/publication_list_item.html new file mode 100644 index 00000000..3c7a4063 --- /dev/null +++ b/layouts/partials/publication_list_item.html @@ -0,0 +1,53 @@ +

+
+ {{ if .Params.image_preview }} +
+ + + +
+
+ {{ else if .Params.image}} +
+ + + +
+
+ {{ else }} +
+ {{end}} + +

+ +

+ +
+ {{ if .Params.abstract_short }} + {{ .Params.abstract_short }} + {{ else }} + {{ .Params.abstract }} + {{ end }} +
+ + + +
+ {{ if .Params.publication_short }} + {{ .Params.publication_short | markdownify }} + {{ else }} + {{ .Params.publication | markdownify }} + {{ end }} +
+ + + +
+
+
diff --git a/layouts/project/single.html b/layouts/project/single.html index 5221e3c0..6bc72b17 100644 --- a/layouts/project/single.html +++ b/layouts/project/single.html @@ -3,6 +3,10 @@
+ {{ if .Params.image }} + + {{end}} +

{{ .Title }}

{{ with .Params.external_link }}Go to Project Site{{ end }} diff --git a/layouts/publication/single.html b/layouts/publication/single.html index 817622d6..9880b0fe 100644 --- a/layouts/publication/single.html +++ b/layouts/publication/single.html @@ -2,10 +2,10 @@ {{ partial "navbar.html" . }}
-
+
-

{{ .Title }}

- +

{{ .Title }}

+
+ {{ if .Params.image }} + + {{end}} +

Abstract

-

{{ .Params.abstract }}

+

{{ .Params.abstract }}

-
Publication
+
Publication
{{ .Params.publication | markdownify }}
@@ -34,8 +38,8 @@
-
Date
-
{{ .Date.Format "January, 2006" }}
+
Date
+
@@ -46,7 +50,7 @@
-
Links
+
Links
{{ partial "publication_links" (dict "content" . "is_list" 0) }} diff --git a/layouts/section/post.html b/layouts/section/post.html index 1148a4f3..39e43399 100644 --- a/layouts/section/post.html +++ b/layouts/section/post.html @@ -7,6 +7,11 @@ {{ $paginator := .Paginate .Data.Pages }} {{ range $paginator.Pages }}
+ {{ if .Params.image }} + + + + {{end}}

{{ .Title }}

{{ partial "article_metadata" (dict "content" . "is_list" 1) }}

{{ .Summary }}

diff --git a/static/css/hugo-academic.css b/static/css/hugo-academic.css index 23f9b23a..05d65ca2 100644 --- a/static/css/hugo-academic.css +++ b/static/css/hugo-academic.css @@ -74,7 +74,7 @@ h4 { } a, a:visited, -h3.post-title a:hover { +h3.article-title a:hover { color: #0095eb; text-decoration:none; transition:color 0.6s ease; @@ -84,11 +84,6 @@ a:hover { color: #005181; } -h3.post-title a { - color: #151515; - transition: color 0.6s ease; -} - img, video { height: auto; @@ -306,6 +301,15 @@ ul.share li:hover .fa { * Blog Articles **************************************************/ +.article-title { + font-size: 1.75rem; +} + +h3.article-title a { + color: #151515; + transition: color 0.6s ease; +} + .article-metadata { margin-bottom: 20px; line-height: 30px; /* Match share bar line height. */ @@ -313,6 +317,14 @@ ul.share li:hover .fa { letter-spacing: 0.03em; } +.article-metadata a:hover { + color: #0095eb; +} + +.article-metadata a { + color: #888; +} + .article-list-item { margin-bottom: 40px; } @@ -331,6 +343,11 @@ ul.share li:hover .fa { color: #888; } +.article-banner { + width: 100%; + height: auto; +} + .article-style img, .article-style video { box-shadow: 1px 1px 0px #edefed,-1px -1px 0px #edefed,1px -1px 0px #edefed,-1px 1px 0px #edefed; @@ -360,18 +377,54 @@ ul.share li:hover .fa { * Publications **************************************************/ -#pub_list h3 { - margin-top: 0; -} - .pub-icon { color: #03396c; font-size: 0.81em; padding-top: 6px; } -.citation_authors { +.pub-banner { + max-width: 100%; + height: auto; + margin-left: auto; + margin-right: auto; +} + +.pub .pub-title { + margin-bottom: 5px; +} + +.pub .pub-authors { font-style: italic; + line-height: 30px; /* Match share bar line height. */ +} + +.pub .pub-row-heading { + font-weight: bold; +} + +.pub-list-item { + margin-bottom: 40px; +} + +.pub-list-item .pub-abstract { + font-size: 1.13em; +} + +.pub-list-item .pub-authors { + line-height: normal; + font-style: normal; + font-size: 1.13em; + color: #3170A5; +} + +.pub-list-item .pub-publication { + color: #090; + font-size: 1em; +} + +.pub-list-item .pub-links { + padding-top: 10px; } /************************************************* @@ -456,8 +509,8 @@ footer a#back_to_top i { } .btn-primary.btn-outline { - /*color: #428bca;*/ color: #0095eb; + border-color: #0095eb; } .btn-success.btn-outline {