feat(project): add showcase mode and revert card view to resized images

* add project showcase layout, set `view = 2` in `projects.md` to use
* revert card view to use resized images rather than cropped images
* fix project filters for tags with non-ASCII (i18n) characters
* add single column wide layout for project widget, to use set
  `widget_layout` in `projects.md`
* add `flip_alt_rows` widget option to flip alternate rows in showcase
  mode
* `url_` link buttons can now be added for projects
* all link buttons now appear in page header rather than under a 'links'
  section within the page
* Markdown slides can now be linked from any page by using new `slides`
  option
* Isotope JS is now only activated when required (i.e. when using card
  view or when filters are defined)
* `links` translation removed from i18n
* consolidate talk, pub., and new project links files into new single
  `page_links.html` for all pages
* move project widget layouts to their own files

Close #764
Close #785
Close #776
Close #645
Close #326

BREAKING CHANGE:

CSS class names of project tags are now prefixed with `js-id-` to
namespace them and prevent clashes with existing CSS classes.

Migrate any filter `tag`s in `projects.md` that are prefixed `.` to the
new `.js-id-` prefix.
This commit is contained in:
George Cushen committed 2018-11-03 20:13:43 +00:00
1 parent c7f2d55c65
commit de269ebdb8
28 files changed
+287 -189

No files matched your search

+17
View File
@@ -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]
+8
View File
@@ -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 = []
+8
View File
@@ -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 = []
+8 -1
View File
@@ -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).
@@ -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]
@@ -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 = []
+9 -1
View File
@@ -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 = ""
-3
View File
@@ -129,9 +129,6 @@
- id: last_updated
translation: Last updated on
- id: links
translation: Links
- id: event
translation: Event
+9 -1
View File
@@ -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;
}
+5
View File
@@ -49,6 +49,8 @@
{{ partial "page_metadata" (dict "content" $page "is_list" 1) }}
{{ partial "page_links_div.html" $page }}
{{ partial "share.html" $page }}
</div>
</div>
@@ -69,6 +71,8 @@
{{end}}
{{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
{{ partial "page_links_div.html" $page }}
</div>
{{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}}
</div>
{{end}}
@@ -79,6 +79,13 @@
{{ i18n "btn_poster" }}
</a>
{{ end }}
{{ if $.Params.slides }}
{{ with ($.Site.GetPage (printf "slides/%s" $.Params.slides)) }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ .RelPermalink }}" target="_blank">
{{ i18n "btn_slides" }}
</a>
{{ end }}
{{ else }}
{{ with $.Params.url_slides }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
@@ -88,6 +95,7 @@
{{ i18n "btn_slides" }}
</a>
{{ end }}
{{ end }}
{{ with $.Params.url_video }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
+28
View File
@@ -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 }}
<div class="mb-3">
{{ with .Params.external_link }}
<a class="btn btn-outline-primary my-1" href="{{ . }}" target="_blank" rel="noopener">{{ i18n "open_project_site" }}</a>
{{ end }}
{{ partial "page_links" (dict "content" . "is_list" 0) }}
</div>
{{ end }}
+25
View File
@@ -0,0 +1,25 @@
{{ $item := .item }}
{{ $widget := .widget }}
{{ $link := .link }}
{{ $target := .target }}
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
{{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
<div class="col-12 col-md-6 col-lg-4 project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}">
<div class="card">
{{ with $resource }}
{{ $image := .Resize (printf "550x q90 %s") }}
<a href="{{ $link }}" {{ $target | safeHTMLAttr }} class="card-image hover-overlay">
<img src="{{ $image.RelPermalink }}" alt="" class="img-responsive">
</a>
{{ end }}
<div class="card-text">
<h4><a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{ $item.Title }}</a></h4>
<div class="card-desription">
{{ with $item.Params.summary }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
</div>
</div>
</div>
+57
View File
@@ -0,0 +1,57 @@
{{ $item := .item }}
{{ $widget := .widget }}
{{ $do_link := true }}
{{ if $item.Params.external_link | or $item.Content }}
{{ $do_link = true }}
{{ else }}
{{ $do_link = false }}
{{ end }}
{{ $link := .link }}
{{ $target := .target }}
{{ $order := "" }}
{{ if and ($widget.Params.flip_alt_rows | default true) (not (modBool .index 2)) }}
{{ $order = "order-md-2" }}
{{ end }}
{{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
<div class="col-lg-12 project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}" itemscope itemtype="http://schema.org/CreativeWork">
<div class="row align-items-center" itemscope itemtype="http://schema.org/Event">
<div class="col-12 col-md-6">
<h3 class="article-title mb-0 mt-0" itemprop="name">
{{- if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }} itemprop="url">{{end -}}
{{ $item.Title }}
{{- if $do_link}}</a>{{end -}}
</h3>
{{ $summary := "" }}
{{ if $item.Params.summary }}
{{ $summary = $item.Params.summary | markdownify }}
{{ else if $item.Truncated }}
{{ $summary = $item.Summary }}
{{ end }}
{{ with $summary }}
<div class="article-style" itemprop="articleBody">
{{ . }}
</div>
{{ end }}
<div class="talk-links">
{{ partial "page_links" (dict "content" $item "is_list" 0) }}
</div>
</div>
<div class="col-12 col-md-6 order-first {{$order}}">
{{ $resource := ($item.Resources.ByType "image").GetMatch "*featured*" }}
{{ with $resource }}
{{ $image := .Resize "540x" }}
{{if $do_link}}<a href="{{ $link }}" {{ $target | safeHTMLAttr }}>{{end}}
<img src="{{ $image.RelPermalink }}" itemprop="image" alt="">
{{if $do_link}}</a>{{end}}
{{end}}
</div>
</div>
</div>
+15
View File
@@ -0,0 +1,15 @@
{{ $item := .item }}
{{ $widget := .widget }}
{{ $link := .link }}
{{ $target := .target }}
{{ $js_tag_classes := delimit (apply (apply $item.Params.tags "replace" "." " " "-") "printf" "js-id-%s" ".") " " }}
<div class="col-lg-12 project-item isotope-item {{ $js_tag_classes | safeHTMLAttr }}" itemscope itemtype="http://schema.org/CreativeWork">
<i class="far fa-copy pub-icon" aria-hidden="true"></i>
<span class="project-title">
<a href="{{ $link }}" {{ $target | safeHTMLAttr }} itemprop="url">{{ $item.Title }}</a>
</span>
{{ with $item.Params.summary }}<p class="project-summary">{{ . | markdownify }}</p>{{ end }}
</div>
+1 -1
View File
@@ -12,5 +12,5 @@
{{ else if .Params.publication }}
{{- .Params.publication | markdownify -}}.
{{ end }}
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
<p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
</div>
@@ -39,7 +39,7 @@
</div>
<div class="pub-links">
{{ partial "publication_links" (dict "content" . "is_list" 1) }}
{{ partial "page_links" (dict "content" . "is_list" 1) }}
</div>
</div>
+1 -1
View File
@@ -12,5 +12,5 @@
{{- .Params.publication | markdownify -}},
{{ end }}
{{- .Date.Format "2006" -}}.
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
<p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
</div>
+1 -1
View File
@@ -6,5 +6,5 @@
{{- delimit . ", " | markdownify -}}
{{- end -}}
</div>
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
<p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
</div>
+1 -1
View File
@@ -28,7 +28,7 @@
</div>
<div class="talk-links">
{{ partial "publication_links" (dict "content" . "is_list" 1) }}
{{ partial "page_links" (dict "content" . "is_list" 1) }}
</div>
</div>
+1 -1
View File
@@ -43,7 +43,7 @@
</div>
<div class="talk-links">
{{ partial "talk_links" (dict "content" . "is_list" 1) }}
{{ partial "page_links" (dict "content" . "is_list" 1) }}
</div>
</div>
+1 -1
View File
@@ -16,6 +16,6 @@
{{ end }}
</div>
<div class="talk-links">
{{ partial "talk_links" (dict "content" . "is_list" 1) }}
{{ partial "page_links" (dict "content" . "is_list" 1) }}
</div>
</div>
+1 -1
View File
@@ -44,7 +44,7 @@
</div>
<div class="talk-links">
{{ partial "talk_links" (dict "content" . "is_list" 1) }}
{{ partial "page_links" (dict "content" . "is_list" 1) }}
</div>
</div>
-57
View File
@@ -1,57 +0,0 @@
{{ $is_list := .is_list }}
{{ $ := .content }}
{{ with $.Params.url_pdf }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
{{ $link = (printf "%s%s" $.Dir .) | relURL }}
{{ end }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ $link }}" target="_blank" rel="noopener">
{{ i18n "btn_pdf" }}
</a>
{{ end }}
{{ with $.Params.url_slides }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
{{ $link = (printf "%s%s" $.Dir .) | relURL }}
{{ end }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ $link }}" target="_blank">
{{ i18n "btn_slides" }}
</a>
{{ end }}
{{ with $.Params.url_video }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
{{ $link = (printf "%s%s" $.Dir .) | relURL }}
{{ end }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ $link }}" target="_blank" rel="noopener">
{{ i18n "btn_video" }}
</a>
{{ end }}
{{ with $.Params.url_code }}
{{ $link := . }}
{{ if not (urls.Parse .).Scheme }}
{{ $link = (printf "%s%s" $.Dir .) | relURL }}
{{ end }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ $link }}" target="_blank" rel="noopener">
{{ i18n "btn_code" }}
</a>
{{ end }}
{{ range $.Params.projects }}
{{ with ($.Site.GetPage (printf "project/%s" .)) }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ .RelPermalink }}">
{{ i18n "btn_project" }}
</a>
{{ else }}
{{/* errorf "The `projects` parameter in `content/%s` references a project file, `content/project/%s`, which cannot be found. Please either set `projects = []` or fix the reference." $.File.Path . */}}
{{ end }}
{{ end }}
{{ range $.Params.url_custom }}
{{ $link := .url }}
{{ if not (urls.Parse .url).Scheme }}
{{ $link = (printf "%s%s" $.Dir .url) | relURL }}
{{ end }}
<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ $link }}" target="_blank" rel="noopener">
{{ .name }}
</a>
{{ end }}
+60 -81
View File
@@ -2,105 +2,84 @@
{{ $page := .page }}
<!-- Projects widget -->
{{ $widget_layout := $page.Params.widget_layout | default 0 }}
{{ if eq $widget_layout 0 }}
{{/* Standard dual-column layout. */}}
<div class="row">
<div class="col-12 col-lg-4 section-heading">
<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-12 col-lg-8">
<div class="col-xs-12 col-md-8">
{{ else }}
{{/* Single column layout. */}}
<div class="margin-auto">
<div class="center-text">
{{ with $page.Title }}<h1 class="mt-0">{{ . | markdownify }}</h1>{{ end }}
{{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
<div>
{{ end }}
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ 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 }}
<span class="d-none default-project-filter">{{ $default_filter_tag }}</span>
<span class="d-none default-project-filter">{{ $default_filter_tag }}</span>
{{/* Only show filter buttons if there are multiple filters. */}}
{{ if gt (len $page.Params.filter) 1 }}
<div class="project-toolbar">
<div class="project-filters">
<div class="btn-toolbar">
<div class="btn-group flex-wrap">
{{ range $idx, $item := $page.Params.filter }}
{{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}}
{{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }}
{{ $.Scratch.Set "tag" .tag }}
{{ else }}
{{ $.Scratch.Set "tag" (printf ".%s" (urlize .tag)) }}
{{/* Only show filter buttons if there are multiple filters. */}}
{{ if gt (len $page.Params.filter) 1 }}
<div class="project-toolbar">
<div class="project-filters">
<div class="btn-toolbar">
<div class="btn-group flex-wrap">
{{ range $idx, $item := $page.Params.filter }}
{{/* Parse filter tag from front matter in the form of either tag name or CSS class name. */}}
{{ $data_filter := printf ".js-id-%s" (replace .tag " " "-") }}
{{ if or (eq (substr .tag 0 1) "*") (eq (substr .tag 0 1) ".") }}
{{ $data_filter = .tag }}
{{ end }}
<a href="#" data-filter="{{ $data_filter | safeHTMLAttr }}" class="btn btn-primary btn-lg{{ if eq $idx $filter_default }} active{{ end }}">{{ .name }}</a>
{{ end }}
<a href="#" data-filter="{{ $.Scratch.Get "tag" }}" class="btn btn-primary btn-lg{{ if eq $idx $filter_default }} active{{ end }}">{{ .name }}</a>
{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
{{ end }}
{{ if eq $page.Params.view 0 }}
<div class="row isotope projects-container js-layout-row">
{{ range where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }}
<div class="col-lg-12 project-item isotope-item {{ delimit (apply .Params.tags "urlize" ".") " " }}" itemscope itemtype="http://schema.org/CreativeWork">
<i class="far fa-copy pub-icon" aria-hidden="true"></i>
<span class="project-title">
{{ if .Content }}
<a href="{{ .RelPermalink }}">
{{ else }}
{{ with .Params.external_link }}<a href="{{ . }}" target="_blank" rel="noopener">{{ end }}
{{ end }}
{{ .Title }}
{{ if .Content }}</a>{{ else }}{{ with .Params.external_link }}</a>{{ end }}{{ end }}
</span>
{{ with .Params.summary }}<p class="project-summary">{{ . | markdownify }}</p>{{ end }}
</div>
{{ end }}
</div>
{{ else }}
<div class="row isotope projects-container js-layout-masonry">
{{ range $project := where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }}
{{ $.Scratch.Set "project_url" $project.RelPermalink }}
{{ $.Scratch.Set "target" "" }}
{{ if $project.Params.external_link }}
{{ $.Scratch.Set "project_url" $project.Params.external_link }}
{{ $.Scratch.Set "target" "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
{{ $resource := ($project.Resources.ByType "image").GetMatch "*featured*" }}
{{ $anchor := $project.Params.image.focal_point | default "Smart" }}
<div class="col-12 col-md-6 col-lg-4 project-item isotope-item {{ delimit (apply .Params.tags "urlize" ".") " " }}">
<div class="card">
{{ with $resource }}
{{ $image := .Fill (printf "550x550 q90 %s" $anchor) }}
<a href="{{ $.Scratch.Get "project_url" }}" {{ $.Scratch.Get "target" | safeHTMLAttr }} class="card-image hover-overlay"
{{ $.Scratch.Get "target" | safeHTMLAttr }}>
<img src="{{ $image.RelPermalink }}" alt="" class="img-responsive">
</a>
{{ end }}
<div class="card-text">
<h4><a href="{{ $.Scratch.Get "project_url" }}" {{ $.Scratch.Get "target" | safeHTMLAttr }}>{{ .Title }}</a></h4>
<div class="card-desription">
{{ with $project.Params.summary }}<p>{{ . | markdownify }}</p>{{ end }}
</div>
</div>
</div>
</div>
{{ end }}
</div>
{{ end }}
<div class="row {{ if or $page.Params.filter (eq $page.Params.view 1) }}isotope projects-container{{end}} {{if eq $page.Params.view 1}}js-layout-masonry{{else}}js-layout-row{{end}} {{ if eq $page.Params.view 2 }}project-showcase mt-5{{end}}">
{{ range $idx, $item := where $.Site.RegularPages "Type" ($page.Params.folder | default "project") }}
{{ $link := $item.RelPermalink }}
{{ $target := "" }}
{{ if $item.Params.external_link }}
{{ $link = $item.Params.external_link }}
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
{{ end }}
{{ if eq $page.Params.view 0 }}
{{ partial "project_li_simple" (dict "widget" $page "index" $idx "item" $item "link" $link "target" $target) }}
{{ else if eq $page.Params.view 1 }}
{{ partial "project_li_card" (dict "widget" $page "index" $idx "item" $item "link" $link "target" $target) }}
{{ else }}
{{ partial "project_li_showcase" (dict "widget" $page "index" $idx "item" $item "link" $link "target" $target) }}
{{ end }}
{{ end }}
</div>
</div>
</div>
-3
View File
@@ -6,9 +6,6 @@
{{ partial "page_header.html" . }}
<div class="article-container">
{{ with .Params.external_link }}
<a class="btn btn-outline-primary my-1" href="{{ . }}" target="_blank" rel="noopener">{{ i18n "open_project_site" }}</a>
{{ end }}
<div class="article-style" itemprop="articleBody">
{{ .Content }}
-16
View File
@@ -59,22 +59,6 @@
</div>
<div class="d-sm-none space-below"></div>
<div class="row" style="padding-top: 10px">
<div class="col-md-1"></div>
<div class="col-md-10">
<div class="row">
<div class="col-12 col-md-3 pub-row-heading" style="line-height:34px;">{{ i18n "links" }}</div>
<div class="col-12 col-md-9">
{{ partial "publication_links" (dict "content" . "is_list" 0) }}
</div>
</div>
</div>
<div class="col-md-1"></div>
</div>
<div class="d-sm-none space-below"></div>
<div class="space-below"></div>
<div class="article-style">{{ .Content }}</div>
-18
View File
@@ -66,24 +66,6 @@
<div class="d-md-none space-below"></div>
{{ end }}
{{ if .Params.url_pdf | or .Params.url_slides | or .Params.url_video | or .Params.url_code | or .Params.projects | or .Params.url_custom }}
<div class="row" style="padding-top: 10px">
<div class="col-md-1"></div>
<div class="col-md-10">
<div class="row">
<div class="col-12 col-md-3 pub-row-heading" style="line-height:34px;">{{ i18n "links" }}</div>
<div class="col-12 col-md-9">
{{ partial "talk_links" (dict "content" . "is_list" 0) }}
</div>
</div>
</div>
<div class="col-md-1"></div>
</div>
<div class="d-md-none space-below"></div>
{{ end }}
<div class="space-below"></div>
<div class="article-style">