diff --git a/archetypes/project/index.md b/archetypes/project/index.md index 870725e8..e3f3f1a9 100644 --- a/archetypes/project/index.md +++ b/archetypes/project/index.md @@ -10,9 +10,26 @@ 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 = "" + # Featured image # To use, add an image named `featured.jpg/png` to your page's folder. [image] diff --git a/archetypes/publication/index.md b/archetypes/publication/index.md index 750c07df..833bf79d 100644 --- a/archetypes/publication/index.md +++ b/archetypes/publication/index.md @@ -36,6 +36,14 @@ selected = false # 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 = [] diff --git a/archetypes/talk/index.md b/archetypes/talk/index.md index 64a5a5fb..5f82e779 100644 --- a/archetypes/talk/index.md +++ b/archetypes/talk/index.md @@ -33,6 +33,14 @@ selected = false # 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 = [] diff --git a/exampleSite/content/home/projects.md b/exampleSite/content/home/projects.md index 623c26f1..4927f634 100644 --- a/exampleSite/content/home/projects.md +++ b/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). diff --git a/exampleSite/content/project/internal-project/index.md b/exampleSite/content/project/internal-project/index.md index b9e28445..05705051 100644 --- a/exampleSite/content/project/internal-project/index.md +++ b/exampleSite/content/project/internal-project/index.md @@ -15,6 +15,20 @@ tags = ["Deep Learning"] # Optional external URL for project (replaces project detail page). external_link = "" +# 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 = "" + # Featured image # To use, add an image named `featured.jpg/png` to your project's folder. [image] diff --git a/exampleSite/content/publication/person-re-id/index.md b/exampleSite/content/publication/person-re-id/index.md index 6b5841f8..97a2e96b 100644 --- a/exampleSite/content/publication/person-re-id/index.md +++ b/exampleSite/content/publication/person-re-id/index.md @@ -36,6 +36,14 @@ selected = false # 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 = [] diff --git a/exampleSite/content/talk/example/index.md b/exampleSite/content/talk/example/index.md index 431646ee..9b705de3 100644 --- a/exampleSite/content/talk/example/index.md +++ b/exampleSite/content/talk/example/index.md @@ -37,9 +37,17 @@ projects = ["internal-project"] # 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 = "slides/example-slides" +url_slides = "" url_video = "" url_code = "" diff --git a/i18n/en.yaml b/i18n/en.yaml index ab0299bc..0146513d 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -129,9 +129,6 @@ - id: last_updated translation: Last updated on -- id: links - translation: Links - - id: event translation: Event diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index bc4f6e3f..be3ca692 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -957,7 +957,7 @@ article .article-metadata { line-height: 30px; /* Match share bar line height. */ } -.pub .pub-row-heading { +.pub-row-heading { font-weight: bold; } @@ -1084,6 +1084,14 @@ article .article-metadata { margin-bottom: 1.5rem; } +.project-showcase .project-item { + margin-bottom: 3rem; +} + +.project-item:last-of-type { + margin-bottom: 0; +} + .isotope-item { z-index: 2; } diff --git a/layouts/partials/page_header.html b/layouts/partials/page_header.html index d9373ad5..91fb28d9 100644 --- a/layouts/partials/page_header.html +++ b/layouts/partials/page_header.html @@ -49,6 +49,8 @@ {{ partial "page_metadata" (dict "content" $page "is_list" 1) }} + {{ partial "page_links_div.html" $page }} + {{ partial "share.html" $page }} @@ -69,6 +71,8 @@ {{end}} {{ partial "page_metadata" (dict "content" $page "is_list" 0) }} + + {{ partial "page_links_div.html" $page }} {{else}} {{/* Case when page has no image */}} @@ -87,6 +91,7 @@ {{ if not .IsNode }} {{ partial "page_metadata" (dict "content" $page "is_list" 0) }} + {{ partial "page_links_div.html" $page }} {{end}} {{end}} diff --git a/layouts/partials/publication_links.html b/layouts/partials/page_links.html similarity index 93% rename from layouts/partials/publication_links.html rename to layouts/partials/page_links.html index a8fe1856..b3af334e 100644 --- a/layouts/partials/publication_links.html +++ b/layouts/partials/page_links.html @@ -79,6 +79,13 @@ {{ i18n "btn_poster" }} {{ end }} +{{ if $.Params.slides }} + {{ with ($.Site.GetPage (printf "slides/%s" $.Params.slides)) }} + + {{ i18n "btn_slides" }} + + {{ end }} +{{ else }} {{ with $.Params.url_slides }} {{ $link := . }} {{ if not (urls.Parse .).Scheme }} @@ -88,6 +95,7 @@ {{ i18n "btn_slides" }} {{ end }} +{{ end }} {{ with $.Params.url_video }} {{ $link := . }} {{ if not (urls.Parse .).Scheme }} diff --git a/layouts/partials/page_links_div.html b/layouts/partials/page_links_div.html new file mode 100644 index 00000000..6df74104 --- /dev/null +++ b/layouts/partials/page_links_div.html @@ -0,0 +1,28 @@ +{{/* Div wrapper around page links. */}} +{{/* The wrapper is hidden when the page has no link buttons. */}} + +{{ $pdf_link := false }} +{{ $cite_link := false }} + +{{ $slug := "" }} +{{ if eq $.File.TranslationBaseName "index" }}{{/* Check if using dir-based page bundles. */}} + {{ $slug = delimit (last 1 (split (substr $.Dir 0 -1) "/")) "" }} +{{ end }} +{{ $resource := $.Resources.GetMatch (printf "%s.pdf" $slug) }} +{{ with $resource }} + {{ $pdf_link = true }} +{{ end }} + +{{ $resource := $.Resources.GetMatch "*.bib" }} +{{ with $resource }} + {{ $cite_link = true }} +{{ end }} + +{{ if $cite_link | or $pdf_link | or .Params.external_link | or .Params.url_preprint | or .Params.url_pdf | or .Params.url_slides | or .Params.url_video | or .Params.url_source | or .Params.url_code | or .Params.url_dataset | or .Params.url_poster | or .Params.url_project | or .Params.url_custom | or .Params.projects | or .Params.slides }} +
{{ . | markdownify }}
{{ end }} +{{ . | markdownify }}
{{ end }} +{{ partial "publication_links" (dict "content" . "is_list" 1) }}
+{{ partial "page_links" (dict "content" . "is_list" 1) }}
diff --git a/layouts/partials/publication_li_detailed.html b/layouts/partials/publication_li_detailed.html index 6739561f..8536d44a 100644 --- a/layouts/partials/publication_li_detailed.html +++ b/layouts/partials/publication_li_detailed.html @@ -39,7 +39,7 @@{{ partial "publication_links" (dict "content" . "is_list" 1) }}
+{{ partial "page_links" (dict "content" . "is_list" 1) }}
diff --git a/layouts/partials/publication_li_simple.html b/layouts/partials/publication_li_simple.html index ad0ed1c4..62573d8e 100644 --- a/layouts/partials/publication_li_simple.html +++ b/layouts/partials/publication_li_simple.html @@ -6,5 +6,5 @@ {{- delimit . ", " | markdownify -}} {{- end -}} -{{ partial "publication_links" (dict "content" . "is_list" 1) }}
+{{ partial "page_links" (dict "content" . "is_list" 1) }}
diff --git a/layouts/partials/publication_li_stream.html b/layouts/partials/publication_li_stream.html index 3e5a8555..7a9c4859 100644 --- a/layouts/partials/publication_li_stream.html +++ b/layouts/partials/publication_li_stream.html @@ -28,7 +28,7 @@{{ . | markdownify }}
{{ end }} +{{ . | markdownify }}
{{ end }} +{{ . | markdownify }}
{{ end }} {{ if $page.Params.filter }} - {{ $filter_default := default (int $page.Params.filter_default) 0 }} + {{ $filter_default := default (int $page.Params.filter_default) 0 }} - {{/* Parse default filter tag from front matter in the form of either tag name or CSS class name. */}} - {{ $default_filter_tag_raw := (index $page.Params.filter ($filter_default)).tag }} - {{ $default_filter_tag := printf ".%s" (urlize $default_filter_tag_raw) }} - {{ if or (eq (substr $default_filter_tag_raw 0 1) "*") (eq (substr $default_filter_tag_raw 0 1) ".") }} - {{ $default_filter_tag = $default_filter_tag_raw }} - {{ end }} + {{/* Parse default filter tag from front matter in the form of either tag name or CSS class name. */}} + {{ $default_filter_tag_raw := (index $page.Params.filter ($filter_default)).tag }} + {{ $default_filter_tag := printf ".js-id-%s" (replace $default_filter_tag_raw " " "-") }} + {{ if or (eq (substr $default_filter_tag_raw 0 1) "*") (eq (substr $default_filter_tag_raw 0 1) ".") }} + {{ $default_filter_tag = $default_filter_tag_raw }} + {{ end }} - {{ $default_filter_tag }} + {{ $default_filter_tag }} - {{/* Only show filter buttons if there are multiple filters. */}} - {{ if gt (len $page.Params.filter) 1 }} -