浏览代码

feat: improve listings

- link author profile pages in listings
- display author name (rather than username) in metadata
- refactor `list_format` to `view` and use new consistent mappings
- add `citation_style` in `params.toml`
- re-order Accomplishments widget in Demo
- make params/comments more consistent in all widget front matter
- Author page: don't show username if profile exists as that will
  already show the user's display name
- Publication card: move author and publication name to metadata bar to
  be consistent with other listings
- Remove portrait.jpg from static as it was duplicated for Demo author

BREAKING CHANGES: See issue below.

See #909
George Cushen 6 年之前
父节点
当前提交
7c2a85c351
共有 49 个文件被更改,包括 293 次插入343 次删除
  1. 11 19
      exampleSite/config/_default/params.toml
  2. 3 16
      exampleSite/content/author/admin/_index.md
  3. 0 1
      exampleSite/content/home/about.md
  4. 1 1
      exampleSite/content/home/accomplishments.md
  5. 2 3
      exampleSite/content/home/contact.md
  6. 2 3
      exampleSite/content/home/hero.md
  7. 2 3
      exampleSite/content/home/hero_carousel.md
  8. 5 6
      exampleSite/content/home/posts.md
  9. 6 6
      exampleSite/content/home/projects.md
  10. 8 10
      exampleSite/content/home/publications.md
  11. 9 11
      exampleSite/content/home/publications_featured.md
  12. 2 8
      exampleSite/content/home/skills.md
  13. 2 3
      exampleSite/content/home/tags.md
  14. 7 8
      exampleSite/content/home/talks.md
  15. 7 8
      exampleSite/content/home/talks_featured.md
  16. 2 3
      exampleSite/content/home/teaching.md
  17. 5 6
      exampleSite/content/post/_index.md
  18. 6 8
      exampleSite/content/publication/_index.md
  19. 5 6
      exampleSite/content/talk/_index.md
  20. 3 3
      i18n/en.yaml
  21. 8 2
      layouts/author/list.html
  22. 10 24
      layouts/partials/css/academic.css
  23. 3 4
      layouts/partials/page_header.html
  24. 15 12
      layouts/partials/page_metadata.html
  25. 23 0
      layouts/partials/page_metadata_authors.html
  26. 0 0
      layouts/partials/post_li_card.html
  27. 0 0
      layouts/partials/post_li_compact.html
  28. 0 0
      layouts/partials/post_li_list.html
  29. 0 0
      layouts/partials/project_li_list.html
  30. 0 16
      layouts/partials/publication_li_apa.html
  31. 3 17
      layouts/partials/publication_li_card.html
  32. 35 0
      layouts/partials/publication_li_citation.html
  33. 1 3
      layouts/partials/publication_li_compact.html
  34. 1 3
      layouts/partials/publication_li_list.html
  35. 0 16
      layouts/partials/publication_li_mla.html
  36. 0 0
      layouts/partials/talk_li_card.html
  37. 0 0
      layouts/partials/talk_li_compact.html
  38. 0 0
      layouts/partials/talk_li_list.html
  39. 15 16
      layouts/partials/widgets/posts.html
  40. 3 3
      layouts/partials/widgets/projects.html
  41. 27 30
      layouts/partials/widgets/publications.html
  42. 7 9
      layouts/partials/widgets/publications_featured.html
  43. 19 17
      layouts/partials/widgets/talks.html
  44. 5 5
      layouts/partials/widgets/talks_featured.html
  45. 13 15
      layouts/project/single.html
  46. 5 5
      layouts/section/post.html
  47. 7 9
      layouts/section/publication.html
  48. 5 5
      layouts/section/talk.html
  49. 二进制
      static/img/portrait.jpg

+ 11 - 19
exampleSite/config/_default/params.toml

@@ -131,27 +131,19 @@ sharing = true
   #   Examples: "Mon, Jan 2, 2006" or "2006-01-02"
   date_format = "January 2006"
 
+  # Citation style ("apa" or "mla")
+  citation_style = "apa"
+
 # Configuration of project pages.
 [projects]
-  # Post list format.
-  #   0 = Simple
-  #   1 = Detailed
-  #   2 = Stream
-  post_format = 2
-
-  # Publication list format.
-  #   0 = Simple
-  #   1 = Detailed
-  #   2 = APA
-  #   3 = MLA
-  #   4 = Stream
-  publication_format = 4
-
-  # Talk list format.
-  #   0 = Simple
-  #   1 = Detailed
-  #   2 = Stream
-  talk_format = 2
+  # Views for associated content.
+  #   1: List
+  #   2: Compact
+  #   3: Card
+  #   4: Citation (publications only)
+  post_view = 2
+  publication_view = 4
+  talk_view = 2
 
 # Search.
 [search]

+ 3 - 16
exampleSite/content/author/admin/_index.md

@@ -42,22 +42,9 @@ interests = [
   year = 2008
 
 # Social/Academic Networking
-#
-# Icon pack "fab" includes the following social network icons:
-#
-#   twitter, weibo, linkedin, github, facebook, pinterest, google-plus,
-#   youtube, instagram, soundcloud
-#
-#   For email icon, use "fas" icon pack, "envelope" icon, and
-#   "mailto:your@email.com" as the link.
-#
-#   Full list: https://fontawesome.com/icons
-#
-# Icon pack "ai" includes the following academic icons:
-#
-#   cv, google-scholar, arxiv, orcid, researchgate, mendeley
-#
-#   Full list: https://jpswalsh.github.io/academicons/
+# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons
+#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
+#   form "mailto:your-email@example.com" or "#contact" for contact widget.
 
 [[social]]
   icon = "envelope"

+ 0 - 1
exampleSite/content/home/about.md

@@ -3,7 +3,6 @@
 widget = "about"  # Do not modify this line!
 active = true  # Activate this widget? true/false
 weight = 5  # Order that this section will appear in.
-date = 2016-04-20T00:00:00
 
 title = "Biography"
 

+ 1 - 1
exampleSite/content/home/accomplishments.md

@@ -7,7 +7,7 @@ title = "Accomplish­ments"
 subtitle = ""
 
 # Order that this section will appear in.
-weight = 15
+weight = 9
 
 # Date format
 #   Refer to https://sourcethemes.com/academic/docs/customization/#date-format

+ 2 - 3
exampleSite/content/home/contact.md

@@ -1,8 +1,7 @@
 +++
 # Contact widget.
-widget = "contact"
-active = true
-date = 2016-04-20T00:00:00
+widget = "contact"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Contact"
 subtitle = ""

+ 2 - 3
exampleSite/content/home/hero.md

@@ -1,8 +1,7 @@
 +++
 # Hero widget.
-widget = "hero"
-active = true
-date = 2017-10-15T00:00:00
+widget = "hero"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Academic"
 

+ 2 - 3
exampleSite/content/home/hero_carousel.md

@@ -1,8 +1,7 @@
 +++
 # Hero Carousel widget.
-widget = "hero_carousel"
-active = false
-date = 2017-10-15T00:00:00
+widget = "hero_carousel"  # Do not modify this line!
+active = false  # Activate this widget? true/false
 
 # Order that this section will appear in.
 weight = 1

+ 5 - 6
exampleSite/content/home/posts.md

@@ -4,7 +4,6 @@
 widget = "posts"  # Do not modify this line!
 active = true  # Activate this widget? true/false
 weight = 40  # Order that this section will appear.
-date = 2016-04-20T00:00:00
 
 title = "Recent Posts"
 subtitle = ""
@@ -12,11 +11,11 @@ subtitle = ""
 # Number of recent posts to list.
 count = 5
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = Stream
-list_format = 2
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+view = 2
 
 # Filter posts by tag or category.
 #  E.g. to only show posts tagged with `Academic`, set `filter_tag = "Academic"`

+ 6 - 6
exampleSite/content/home/projects.md

@@ -1,8 +1,7 @@
 +++
 # Projects widget.
-widget = "projects"
-active = true
-date = 2016-04-20T00:00:00
+widget = "projects"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Projects"
 subtitle = ""
@@ -16,9 +15,10 @@ weight = 50
 folder = "project"
 
 # View.
-# Customize how projects are displayed.
-# Legend: 0 = list, 1 = cards, 2 = showcase.
-view = 1
+#   1 = List
+#   3 = Card
+#   5 = Showcase
+view = 3
 
 # Widget layout
 # Legend: 0 = two columns (default), 1 = single column

+ 8 - 10
exampleSite/content/home/publications.md

@@ -1,9 +1,8 @@
 +++
 # Recent Publications widget.
 # This widget displays recent publications from `content/publication/`.
-widget = "publications"
-active = true
-date = 2016-04-20T00:00:00
+widget = "publications"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Recent Publications"
 subtitle = ""
@@ -14,13 +13,12 @@ weight = 20
 # Number of publications to list.
 count = 10
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = APA
-#   3 = MLA
-#   4 = Stream
-list_format = 4
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+#   4 = Citation
+view = 2
 
 # Filter by publication type.
 # -1: Any

+ 9 - 11
exampleSite/content/home/publications_featured.md

@@ -1,10 +1,9 @@
 +++
 # Featured Publications widget.
 # This widget displays publications from `content/publication/` which have
-# `featured = true` in their `+++` front matter.
-widget = "publications_featured"
-active = true
-date = 2016-04-20T00:00:00
+# `featured = true` in their front matter.
+widget = "publications_featured"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Featured Publications"
 subtitle = ""
@@ -12,13 +11,12 @@ subtitle = ""
 # Order that this section will appear in.
 weight = 10
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = APA
-#   3 = MLA
-#   4 = Stream
-list_format = 1
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+#   4 = Citation
+view = 3
 
 # Filter by publication type.
 # -1: Any

+ 2 - 8
exampleSite/content/home/skills.md

@@ -1,10 +1,7 @@
 +++
 # Feature/Skill widget.
 widget = "featurette"  # Do not modify this line!
-date = 2017-09-20T00:00:00
-
-# Activate this widget? true/false
-active = true
+active = true  # Activate this widget? true/false
 
 title = "Skills"
 subtitle = ""
@@ -16,10 +13,7 @@ weight = 7
 # 
 # Add/remove as many `[[feature]]` blocks below as you like.
 # 
-# Available icon packs and icons:
-# * fas - Font Awesome standard icons (see https://fontawesome.com/icons)
-# * fab - Font Awesome brand icons (see https://fontawesome.com/icons)
-# * ai - academic icons (see https://jpswalsh.github.io/academicons/)
+# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons
 
 [[feature]]
   icon = "r-project"

+ 2 - 3
exampleSite/content/home/tags.md

@@ -1,8 +1,7 @@
 +++
 # Tag Cloud widget.
-widget = "tag_cloud"
-active = true
-date = 2017-09-20T00:00:00
+widget = "tag_cloud"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Tags"
 subtitle = ""

+ 7 - 8
exampleSite/content/home/talks.md

@@ -1,8 +1,7 @@
 +++
 # Recent and Upcoming Talks widget.
-widget = "talks"
-active = true
-date = 2016-04-20T00:00:00
+widget = "talks"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 title = "Recent & Upcoming Talks"
 subtitle = ""
@@ -13,11 +12,11 @@ weight = 30
 # Number of talks to list.
 count = 10
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = Stream
-list_format = 2
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+view = 2
 
 # Exclude talks that are shown in the Featured Talks widget?
 exclude_featured = false

+ 7 - 8
exampleSite/content/home/talks_featured.md

@@ -1,8 +1,7 @@
 +++
 # Featured Talks widget.
-widget = "talks_featured"
-active = false
-date = 2016-04-20T00:00:00
+widget = "talks_featured"  # Do not modify this line!
+active = false  # Activate this widget? true/false
 
 title = "Featured Talks"
 subtitle = ""
@@ -10,9 +9,9 @@ subtitle = ""
 # Order that this section will appear in.
 weight = 29
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   3 = Stream
-list_format = 0
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+view = 3
 +++

+ 2 - 3
exampleSite/content/home/teaching.md

@@ -2,9 +2,8 @@
 # Custom widget.
 # An example of using the custom widget to create your own homepage section.
 # To create more sections, duplicate this file and edit the values below as desired.
-widget = "custom"
-active = true
-date = 2016-04-20T00:00:00
+widget = "custom"  # Do not modify this line!
+active = true  # Activate this widget? true/false
 
 # Note: a full width section format can be enabled by commenting out the `title` and `subtitle` with a `#`.
 title = "Teaching"

+ 5 - 6
exampleSite/content/post/_index.md

@@ -1,12 +1,11 @@
 +++
 title = "Posts"
-date = 2017-01-01T00:00:00
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = Stream
-list_format = 2
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+view = 2
 
 # Optional featured image (relative to `static/img/` folder).
 [header]

+ 6 - 8
exampleSite/content/publication/_index.md

@@ -1,14 +1,12 @@
 +++
 title = "Publications"
-date = 2017-01-01T00:00:00
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = APA
-#   3 = MLA
-#   4 = Stream
-list_format = 3
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+#   4 = Citation
+view = 4
 
 # Optional featured image (relative to `static/img/` folder).
 [header]

+ 5 - 6
exampleSite/content/talk/_index.md

@@ -1,12 +1,11 @@
 +++
 title = "Recent & Upcoming Talks"
-date = 2017-01-01T00:00:00
 
-# List format.
-#   0 = Simple
-#   1 = Detailed
-#   2 = Stream
-list_format = 2
+# View.
+#   1 = List
+#   2 = Compact
+#   3 = Card
+view = 2
 
 # Optional featured image (relative to `static/img/` folder).
 [header]

+ 3 - 3
i18n/en.yaml

@@ -88,7 +88,7 @@
 # Publications widget
 
 - id: more_publications
-  translation: More Publications
+  translation: See all publications
 
 # Posts widget
 
@@ -96,12 +96,12 @@
   translation: CONTINUE READING
 
 - id: more_posts
-  translation: More Posts
+  translation: See all posts
 
 # Talks widget
 
 - id: more_talks
-  translation: More Talks
+  translation: See all talks
 
 # Contact widget
 

+ 8 - 2
layouts/author/list.html

@@ -1,8 +1,14 @@
 {{ partial "header.html" . }}
 {{ partial "navbar.html" . }}
-{{ partial "page_header.html" . }}
 
-<section id="about" class="home-section">
+{{/* Just display author name as title if user profile unavailable. */}}
+{{ if not ($.Site.GetPage (printf "/author/%s" (urlize .Title))) }}
+<div class="universal-wrapper pt-3">
+  <h1 itemprop="name">{{ .Title }}</h1>
+</div>
+{{ end }}
+
+<section id="about" class="pt-5">
   <div class="container">
     {{/* Only show About widget if a profile has been configured for this user. */}}
     {{ $widget := "widgets/about.html" }}

+ 10 - 24
layouts/partials/css/academic.css

@@ -522,6 +522,15 @@ a[data-fancybox] img {
   color: #b2b2b2;
 }
 
+/*************************************************
+ *  Widgets (common)
+ **************************************************/
+
+.see-all {
+  margin-top: 2rem;
+  text-transform: uppercase;
+}
+
 /*************************************************
  *  Hero Widget
  **************************************************/
@@ -600,7 +609,7 @@ a[data-fancybox] img {
 }
 
 /*************************************************
- *  Biography
+ *  About widget
  **************************************************/
 
 #profile {
@@ -1069,11 +1078,6 @@ article .article-metadata {
   margin-right: auto;
 }
 
-.pub .pub-authors {
-  font-style: italic;
-  line-height: 30px; /* Match share bar line height. */
-}
-
 .pub-row-heading {
   font-weight: bold;
 }
@@ -1082,24 +1086,6 @@ article .article-metadata {
   font-size: 1rem;
 }
 
-.pub-list-item .pub-authors {
-  line-height: normal;
-  font-style: normal;
-  font-size: 0.9rem;
-  color: rgba(0,0,0,0.54);
-}
-
-.pub-list-item .pub-publication {
-  color: rgba(0,0,0,0.54);
-  font-size: 0.9rem;
-}
-
-
-.dark .pub-authors,
-.dark .pub-publication {
-  color: rgba(255,255,255,0.54);
-}
-
 .pub-list-item .btn-links {
   padding-top: 10px;
 }

+ 3 - 4
layouts/partials/page_header.html

@@ -47,7 +47,7 @@
         <p class="page-subtitle">{{ . | markdownify | emojify }}</p>
         {{end}}
 
-        {{ partial "page_metadata" (dict "content" $page "is_list" 1) }}
+        {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
 
         {{ partial "page_links_div.html" $page }}
 
@@ -70,8 +70,7 @@
   <p class="page-subtitle">{{ . | markdownify | emojify }}</p>
   {{end}}
 
-  {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
-
+  {{ partial "page_metadata" (dict "content" $page "is_list" 0 "share" true) }}
   {{ partial "page_links_div.html" $page }}
 </div>
 {{else}}
@@ -90,7 +89,7 @@
   {{end}}
 
   {{ if not .IsNode }}
-    {{ partial "page_metadata" (dict "content" $page "is_list" 0) }}
+    {{ partial "page_metadata" (dict "content" $page "is_list" 0 "share" true) }}
     {{ partial "page_links_div.html" $page }}
   {{end}}
 </div>

+ 15 - 12
layouts/partials/page_metadata.html

@@ -1,4 +1,5 @@
 {{ $is_list := .is_list }}
+{{ $share := .share | default false }}
 {{ $ := .content }}
 
 <meta content="{{ $.Params.Date }}" itemprop="datePublished">
@@ -11,16 +12,7 @@
   {{ $authorLen := len $.Params.authors }}
   {{ if gt $authorLen 0 }}
   <div>
-    {{ range $k, $v := $.Params.authors -}}
-    <span itemscope itemprop="author" itemtype="http://schema.org/Person">
-      <span itemprop="name">
-        {{with $.Site.GetPage (printf "/authors/%s" $v) }}{{ printf "<a href=\"%s\">" .RelPermalink | safeHTML }}{{end}}
-        {{- $v | markdownify -}}
-        {{with $.Site.GetPage (printf "/authors/%s" $v) }}{{ printf "</a>" | safeHTML }}{{end}}
-      </span>
-    </span>
-    {{- if lt $k (sub $authorLen 1) -}}, {{ end }}
-    {{ end }}
+    {{ partial "page_metadata_authors" $ }}
   </div>
   {{ end }}
   {{ end }}
@@ -39,6 +31,17 @@
   </span>
   {{ end }}
 
+  {{ if and (eq $is_list 1) (eq $.Type "publication") }}
+  <span class="middot-divider"></span>
+  <span class="pub-publication">
+    {{ if $.Params.publication_short }}
+      {{ $.Params.publication_short | markdownify }}
+    {{ else if $.Params.publication }}
+      {{ $.Params.publication | markdownify }}
+    {{ end }}
+  </span>
+  {{ end }}
+
   {{ if and (eq $.Type "post") (not (or (eq $.Site.Params.reading_time false) (eq $.Params.reading_time false))) }}
   <span class="middot-divider"></span>
   <span class="article-reading-time">
@@ -66,8 +69,8 @@
   {{ end }}
   {{ end }}
 
-  {{ if ne $is_list 1 }}
-  {{ partial "share.html" $ }}
+  {{ if $share }}
+    {{ partial "share.html" $ }}
   {{ end }}
 
 </div>

+ 23 - 0
layouts/partials/page_metadata_authors.html

@@ -0,0 +1,23 @@
+{{/* If `authors` is set and is not empty. */}}
+{{ if $.Params.authors }}
+{{ $authorLen := len $.Params.authors }}
+{{ if gt $authorLen 0 }}
+  {{ range $k, $v := $.Params.authors -}}
+    <span itemscope itemprop="author" itemtype="http://schema.org/Person">
+      <span itemprop="name">
+        {{ $link := ($.Site.GetPage (printf "/authors/%s" $v)).RelPermalink }}
+
+      {{ $person_page_path := (printf "/author/%s" (urlize $v)) }}
+      {{ $person_page := $.Site.GetPage $person_page_path }}
+      {{ if $person_page }}
+        {{ $person := $person_page.Params }}
+        {{- printf "<a href=\"%s\">%s</a>" $link $person.name | safeHTML -}}
+      {{- else -}}
+                {{- printf "<a href=\"%s\">%s</a>" $link ($v | markdownify) | safeHTML -}}
+      {{- end -}}
+      </span>{{- /* This comment removes whitespace */ -}}
+    </span>
+    {{- if lt $k (sub $authorLen 1) -}}, {{ end }}
+  {{ end }}
+{{ end }}
+{{ end }}

+ 0 - 0
layouts/partials/post_li_detailed.html → layouts/partials/post_li_card.html


+ 0 - 0
layouts/partials/post_li_stream.html → layouts/partials/post_li_compact.html


+ 0 - 0
layouts/partials/post_li_simple.html → layouts/partials/post_li_list.html


+ 0 - 0
layouts/partials/project_li_simple.html → layouts/partials/project_li_list.html


+ 0 - 16
layouts/partials/publication_li_apa.html

@@ -1,16 +0,0 @@
-<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
-  <i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
-  <span itemprop="author">
-    {{ with .Params.authors }}
-      {{- delimit . ", " | markdownify -}}
-    {{- end -}}
-  </span>
-  ({{- .Date.Format "2006" -}}).
-  <a href="{{ .RelPermalink }}" itemprop="name">{{ .Title }}</a>.
-  {{ if .Params.publication_short }}
-    {{- .Params.publication_short | markdownify -}}.
-  {{ else if .Params.publication }}
-    {{- .Params.publication | markdownify -}}.
-  {{ end }}
-  <p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
-</div>

+ 3 - 17
layouts/partials/publication_li_detailed.html → layouts/partials/publication_li_card.html

@@ -1,4 +1,5 @@
 <div class="pub-list-item card-simple" itemscope itemtype="http://schema.org/CreativeWork">
+  {{ partial "page_metadata" (dict "content" $ "is_list" 1) }}
 
   {{ $resource := (.Resources.ByType "image").GetMatch "*featured*" }}
   {{ $anchor := .Params.image.focal_point | default "Smart" }}
@@ -17,27 +18,12 @@
 
   <div class="pub-abstract" itemprop="text">
     {{ if .Params.abstract_short }}
-    {{ .Params.abstract_short | markdownify }}
+      {{ .Params.abstract_short | markdownify }}
     {{ else }}
-    {{ .Params.abstract | markdownify}}
+      {{ .Params.abstract | markdownify}}
     {{ end }}
   </div>
 
-  <div class="pub-authors" itemprop="author">
-    {{ with .Params.authors }}
-    {{ delimit . ", " | markdownify }}
-    {{ end }}
-  </div>
-
-  <div class="pub-publication">
-    {{ if .Params.publication_short }}
-    {{ .Params.publication_short | markdownify }},
-    {{ else if .Params.publication }}
-    {{ .Params.publication | markdownify }},
-    {{ end }}
-    {{ .Date.Format "2006" }}
-  </div>
-
   <div class="btn-links">
     {{ partial "page_links" (dict "content" . "is_list" 1) }}
   </div>

+ 35 - 0
layouts/partials/publication_li_citation.html

@@ -0,0 +1,35 @@
+<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
+  <i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
+
+  {{/* APA Style */}}
+  {{ if eq ($.Site.Params.publications.citation_style | default "apa") "apa" }}
+
+  <span itemprop="author">
+    {{ partial "page_metadata_authors" . }}
+  </span>
+  ({{- .Date.Format "2006" -}}).
+  <a href="{{ .RelPermalink }}" itemprop="name">{{ .Title }}</a>.
+  {{ if .Params.publication_short }}
+  {{- .Params.publication_short | markdownify -}}.
+  {{ else if .Params.publication }}
+  {{- .Params.publication | markdownify -}}.
+  {{ end }}
+  <p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
+
+  {{/* MLA Style */}}
+  {{ else }}
+
+  <span itemprop="author">
+    {{ partial "page_metadata_authors" . }}
+  </span>.
+  <a href="{{ .RelPermalink }}" itemprop="name">{{ .Title }}</a>.
+  {{ if .Params.publication_short }}
+  {{- .Params.publication_short | markdownify -}},
+  {{ else if .Params.publication }}
+  {{- .Params.publication | markdownify -}},
+  {{ end }}
+  {{- .Date.Format "2006" -}}.
+  <p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
+
+  {{ end }}
+</div>

+ 1 - 3
layouts/partials/publication_li_stream.html → layouts/partials/publication_li_compact.html

@@ -21,9 +21,7 @@
 
     <div class="stream-meta article-metadata">
       <div itemprop="author">
-        {{ with .Params.authors }}
-        {{- delimit . ", " | markdownify -}}
-        {{- end -}}
+        {{ partial "page_metadata_authors" . }}
       </div>
     </div>
 

+ 1 - 3
layouts/partials/publication_li_simple.html → layouts/partials/publication_li_list.html

@@ -2,9 +2,7 @@
   <i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
   <a href="{{ .RelPermalink }}" itemprop="name">{{ .Title }}</a>
   <div itemprop="author">
-    {{ with .Params.authors }}
-      {{- delimit . ", " | markdownify -}}
-    {{- end -}}
+    {{ partial "page_metadata_authors" . }}
   </div>
   <p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
 </div>

+ 0 - 16
layouts/partials/publication_li_mla.html

@@ -1,16 +0,0 @@
-<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
-  <i class="far fa-file-alt pub-icon" aria-hidden="true"></i>
-  <span itemprop="author">
-    {{ with .Params.authors }}
-      {{- delimit . ", " | markdownify -}}
-    {{- end -}}
-  </span>.
-  <a href="{{ .RelPermalink }}" itemprop="name">{{ .Title }}</a>.
-  {{ if .Params.publication_short }}
-    {{- .Params.publication_short | markdownify -}},
-  {{ else if .Params.publication }}
-    {{- .Params.publication | markdownify -}},
-  {{ end }}
-  {{- .Date.Format "2006" -}}.
-  <p>{{ partial "page_links" (dict "content" . "is_list" 1) }}</p>
-</div>

+ 0 - 0
layouts/partials/talk_li_detailed.html → layouts/partials/talk_li_card.html


+ 0 - 0
layouts/partials/talk_li_stream.html → layouts/partials/talk_li_compact.html


+ 0 - 0
layouts/partials/talk_li_simple.html → layouts/partials/talk_li_list.html


+ 15 - 16
layouts/partials/widgets/posts.html

@@ -13,37 +13,36 @@
   {{ $query = $query | intersect $archive_page.Pages }}
 {{ end }}
 
-{{ $count := len ($query) }}
+{{ $count := len $query }}
 
 <!-- Blog Posts widget -->
 <div class="row">
   <div class="col-12 col-lg-4 section-heading">
-
     <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
     {{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
-    {{ if gt $count $page.Params.count }}
-    <p class="view-all">
-      <a href="{{ $archive_page.RelPermalink }}">
-        {{ i18n "more_posts" | markdownify }}
-        <i class="fas fa-angle-double-right"></i>
-      </a>
-    </p>
-    {{ end }}
-
   </div>
   <div class="col-12 col-lg-8">
 
     {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
 
     {{ range $post := first $page.Params.count $query }}
-      {{ if eq $page.Params.list_format 0 }}
-        {{ partial "post_li_simple" . }}
-      {{ else if eq $page.Params.list_format 1 }}
-        {{ partial "post_li_detailed" . }}
+      {{ if eq $page.Params.view 1 }}
+        {{ partial "post_li_list" . }}
+      {{ else if eq $page.Params.view 3 }}
+        {{ partial "post_li_card" . }}
       {{ else }}
-        {{ partial "post_li_stream" . }}
+        {{ partial "post_li_compact" . }}
       {{ end }}
     {{end}}
 
+    {{ if gt $count $page.Params.count }}
+    <div class="see-all">
+      <a href="{{ $archive_page.RelPermalink }}">
+        {{ i18n "more_posts" | markdownify }}
+        <i class="fas fa-angle-right"></i>
+      </a>
+    </div>
+    {{ end }}
+
   </div>
 </div>

+ 3 - 3
layouts/partials/widgets/projects.html

@@ -71,9 +71,9 @@
           {{ $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 }}
+        {{ if eq $page.Params.view 1 }}
+          {{ partial "project_li_list" (dict "widget" $page "index" $idx "item" $item "link" $link "target" $target) }}
+        {{ else if eq $page.Params.view 3 }}
           {{ 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) }}

+ 27 - 30
layouts/partials/widgets/publications.html

@@ -1,48 +1,45 @@
 {{ $ := .root }}
 {{ $page := .page }}
-{{ $pubs_len := len (where $.Site.RegularPages "Type" "publication") }}
+
+{{ $query := where $.Site.RegularPages "Type" "publication" }}
+{{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
+  {{ $query = where $query ".Params.publication_types" "intersect" (slice $page.Params.publication_type) }}
+{{ end }}
+{{ if $page.Params.exclude_featured }}
+  {{ $query = $query | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.featured" "!=" true) }}
+{{ end }}
+
+{{ $count := len $query }}
 
 <!-- Publications widget -->
 <div class="row">
   <div class="col-12 col-lg-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.GetPage "section" "publication").RelPermalink }}">
-        {{ i18n "more_publications" | markdownify }}
-        <i class="fas fa-angle-double-right"></i>
-      </a>
-    </p>
-    {{ end }}
   </div>
   <div class="col-12 col-lg-8">
     {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
 
-    {{ if and ($page.Params.publication_type) (ne $page.Params.publication_type "-1") }}
-      {{ $.Scratch.Set "recent_pubs" (where (where $.Site.RegularPages "Type" "publication") ".Params.publication_types" "intersect" (slice $page.Params.publication_type)) }}
-    {{ else }}
-      {{ $.Scratch.Set "recent_pubs" (where $.Site.RegularPages "Type" "publication") }}
-    {{ end }}
-
-    {{ if $page.Params.exclude_featured }}
-      {{ $.Scratch.Set "recent_pubs" ( ($.Scratch.Get "recent_pubs") | intersect (where (where $.Site.RegularPages "Type" "publication") ".Params.featured" "!=" true) ) }}
-    {{ end }}
-
-    {{ $recent_pubs := $.Scratch.Get "recent_pubs" }}
-    {{ range first $page.Params.count $recent_pubs }}
-      {{ if eq $page.Params.list_format 1 }}
-        {{ partial "publication_li_detailed" . }}
-      {{ else if eq $page.Params.list_format 2 }}
-        {{ partial "publication_li_apa" . }}
-      {{ else if eq $page.Params.list_format 3 }}
-        {{ partial "publication_li_mla" . }}
-      {{ else if eq $page.Params.list_format 4 }}
-        {{ partial "publication_li_stream" . }}
+    {{ range first $page.Params.count $query }}
+      {{ if eq $page.Params.view 1 }}
+        {{ partial "publication_li_list" . }}
+      {{ else if eq $page.Params.view 3 }}
+        {{ partial "publication_li_card" . }}
+      {{ else if eq $page.Params.view 4 }}
+        {{ partial "publication_li_citation" . }}
       {{ else }}
-        {{ partial "publication_li_simple" . }}
+        {{ partial "publication_li_compact" . }}
       {{ end }}
     {{ end }}
 
+    {{ if gt $count $page.Params.count }}
+    <div class="see-all">
+      <a href="{{ ($.Site.GetPage "section" "publication").RelPermalink }}">
+        {{ i18n "more_publications" | markdownify }}
+        <i class="fas fa-angle-right"></i>
+      </a>
+    </div>
+    {{ end }}
+
   </div>
 </div>

+ 7 - 9
layouts/partials/widgets/publications_featured.html

@@ -18,16 +18,14 @@
 
     {{ $sel_pubs := $.Scratch.Get "sel_pubs" }}
     {{ range $sel_pubs }}
-      {{ if eq $page.Params.list_format 1 }}
-        {{ partial "publication_li_detailed" . }}
-      {{ else if eq $page.Params.list_format 2 }}
-        {{ partial "publication_li_apa" . }}
-      {{ else if eq $page.Params.list_format 3 }}
-        {{ partial "publication_li_mla" . }}
-      {{ else if eq $page.Params.list_format 4 }}
-        {{ partial "publication_li_stream" . }}
+      {{ if eq $page.Params.view 1 }}
+        {{ partial "publication_li_list" . }}
+      {{ else if eq $page.Params.view 3 }}
+        {{ partial "publication_li_card" . }}
+      {{ else if eq $page.Params.view 4 }}
+        {{ partial "publication_li_citation" . }}
       {{ else }}
-        {{ partial "publication_li_simple" . }}
+        {{ partial "publication_li_compact" . }}
       {{ end }}
     {{ end }}
 

+ 19 - 17
layouts/partials/widgets/talks.html

@@ -1,39 +1,41 @@
 {{ $ := .root }}
 {{ $page := .page }}
-{{ $talks_len := len (where $.Site.RegularPages "Type" "talk") }}
+{{ $count := len (where $.Site.RegularPages "Type" "talk") }}
 
 <!-- Talks widget -->
 <div class="row">
   <div class="col-12 col-lg-4 section-heading">
     <h1>{{ with $page.Title }}{{ . | markdownify }}{{ end }}</h1>
     {{ with $page.Params.subtitle }}<p>{{ . | markdownify }}</p>{{ end }}
-    {{ if gt $talks_len $page.Params.count }}
-    <p class="view-all">
-      <a href="{{ ($.Site.GetPage "section" "talk").RelPermalink }}">
-        {{ i18n "more_talks" | markdownify }}
-        <i class="fas fa-angle-double-right"></i>
-      </a>
-    </p>
-    {{ end }}
   </div>
   <div class="col-12 col-lg-8">
     {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
 
-    {{ $.Scratch.Set "talks" (where $.Site.RegularPages "Type" "talk") }}
+    {{ $talks := where $.Site.RegularPages "Type" "talk" }}
 
     {{/* Exclude talks shown in Featured Talks widget? */}}
     {{ if $page.Params.exclude_featured }}
-    {{ $.Scratch.Set "talks" (where ($.Scratch.Get "talks") ".Params.featured" "!=" true) }}
+      {{ $talks = (where $talks ".Params.featured" "!=" true) }}
     {{ end }}
 
-    {{ range first $page.Params.count (sort ($.Scratch.Get "talks") ".Params.time_start" "desc") }}
-      {{ if eq $page.Params.list_format 1 }}
-        {{ partial "talk_li_detailed" . }}
-      {{ else if eq $page.Params.list_format 2 }}
-        {{ partial "talk_li_stream" . }}
+    {{ range first $page.Params.count (sort $talks ".Params.time_start" "desc") }}
+      {{ if eq $page.Params.view 1 }}
+        {{ partial "talk_li_list" . }}
+      {{ else if eq $page.Params.view 3 }}
+        {{ partial "talk_li_card" . }}
       {{ else }}
-        {{ partial "talk_li_simple" . }}
+        {{ partial "talk_li_compact" . }}
       {{ end }}
     {{ end }}
+
+    {{ if gt $count $page.Params.count }}
+    <div class="see-all">
+      <a href="{{ ($.Site.GetPage "section" "talk").RelPermalink }}">
+      {{ i18n "more_talks" | markdownify }}
+      <i class="fas fa-angle-right"></i>
+      </a>
+    </div>
+    {{ end }}
+
   </div>
 </div>

+ 5 - 5
layouts/partials/widgets/talks_featured.html

@@ -11,12 +11,12 @@
     {{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
 
     {{ range (sort (where (where $.Site.RegularPages "Type" "talk") ".Params.featured" true) ".Params.time_start" "desc") }}
-      {{ if eq $page.Params.list_format 1 }}
-        {{ partial "talk_li_detailed" . }}
-      {{ else if eq $page.Params.list_format 2 }}
-        {{ partial "talk_li_stream" . }}
+      {{ if eq $page.Params.view 1 }}
+        {{ partial "talk_li_list" . }}
+      {{ else if eq $page.Params.view 3 }}
+        {{ partial "talk_li_card" . }}
       {{ else }}
-        {{ partial "talk_li_simple" . }}
+        {{ partial "talk_li_compact" . }}
       {{ end }}
     {{ end }}
   </div>

+ 13 - 15
layouts/project/single.html

@@ -22,12 +22,12 @@
     {{ if ge $count 1 }}
       <h2>{{ (i18n "posts") }}</h2>
       {{ range $items }}
-        {{ if eq $page.Site.Params.projects.post_format 0 }}
-          {{ partial "post_li_simple" . }}
-        {{ else if eq $page.Site.Params.projects.post_format 1 }}
-          {{ partial "post_li_detailed" . }}
+        {{ if eq $page.Site.Params.projects.post_format 1 }}
+          {{ partial "post_li_list" . }}
+        {{ else if eq $page.Site.Params.projects.post_format 3 }}
+          {{ partial "post_li_card" . }}
         {{ else }}
-          {{ partial "post_li_stream" . }}
+          {{ partial "post_li_compact" . }}
         {{ end }}
       {{ end }}
     {{ end }}
@@ -38,15 +38,13 @@
       <h2>{{ (i18n "publications") }}</h2>
       {{ range $items }}
         {{ if eq $page.Site.Params.projects.publication_format 1 }}
-          {{ partial "publication_li_detailed" . }}
-        {{ else if eq $page.Site.Params.projects.publication_format 2 }}
-          {{ partial "publication_li_apa" . }}
+          {{ partial "publication_li_list" . }}
         {{ else if eq $page.Site.Params.projects.publication_format 3 }}
-          {{ partial "publication_li_mla" . }}
+          {{ partial "publication_li_card" . }}
         {{ else if eq $page.Site.Params.projects.publication_format 4 }}
-          {{ partial "publication_li_stream" . }}
+          {{ partial "publication_li_citation" . }}
         {{ else }}
-          {{ partial "publication_li_simple" . }}
+          {{ partial "publication_li_compact" . }}
         {{ end }}
       {{ end }}
     {{ end }}
@@ -57,11 +55,11 @@
       <h2>{{ (i18n "talks") }}</h2>
       {{ range sort $items ".Params.time_start" "desc" }}
         {{ if eq $page.Site.Params.projects.talk_format 1 }}
-          {{ partial "talk_li_detailed" . }}
-        {{ else if eq $page.Site.Params.projects.talk_format 2 }}
-          {{ partial "talk_li_stream" . }}
+          {{ partial "talk_li_list" . }}
+        {{ else if eq $page.Site.Params.projects.talk_format 3 }}
+          {{ partial "talk_li_card" . }}
         {{ else }}
-          {{ partial "talk_li_simple" . }}
+          {{ partial "talk_li_compact" . }}
         {{ end }}
       {{ end }}
     {{ end }}

+ 5 - 5
layouts/section/post.html

@@ -11,12 +11,12 @@
 
   {{ $paginator := .Paginate .Data.Pages }}
   {{ range $paginator.Pages }}
-    {{ if eq $.Params.list_format 0 }}
-      {{ partial "post_li_simple" . }}
-    {{ else if eq $.Params.list_format 1 }}
-      {{ partial "post_li_detailed" . }}
+    {{ if eq $.Params.view 1 }}
+      {{ partial "post_li_list" . }}
+    {{ else if eq $.Params.view 3 }}
+      {{ partial "post_li_card" . }}
     {{ else }}
-      {{ partial "post_li_stream" . }}
+      {{ partial "post_li_compact" . }}
     {{ end }}
   {{ end }}
 

+ 7 - 9
layouts/section/publication.html

@@ -58,16 +58,14 @@
         {{ end }}
 
         <div class="grid-sizer col-lg-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }} year-{{ .Date.Format "2006" }}">
-          {{ if eq $.Params.list_format 1 }}
-            {{ partial "publication_li_detailed" . }}
-          {{ else if eq $.Params.list_format 2 }}
-            {{ partial "publication_li_apa" . }}
-          {{ else if eq $.Params.list_format 3 }}
-            {{ partial "publication_li_mla" . }}
-          {{ else if eq $.Params.list_format 4 }}
-            {{ partial "publication_li_stream" . }}
+          {{ if eq $.Params.view 1 }}
+            {{ partial "publication_li_list" . }}
+          {{ else if eq $.Params.view 3 }}
+            {{ partial "publication_li_card" . }}
+          {{ else if eq $.Params.view 4 }}
+            {{ partial "publication_li_citation" . }}
           {{ else }}
-            {{ partial "publication_li_simple" . }}
+            {{ partial "publication_li_compact" . }}
           {{ end }}
         </div>
 

+ 5 - 5
layouts/section/talk.html

@@ -19,12 +19,12 @@
         <div class="col-lg-10">
 
           {{ range sort .Pages ".Params.time_start" "desc" }}
-            {{ if eq $.Params.list_format 1 }}
-              {{ partial "talk_li_detailed" . }}
-            {{ else if eq $.Params.list_format 2 }}
-              {{ partial "talk_li_stream" . }}
+            {{ if eq $.Params.view 1 }}
+              {{ partial "talk_li_list" . }}
+            {{ else if eq $.Params.view 3 }}
+              {{ partial "talk_li_card" . }}
             {{ else }}
-              {{ partial "talk_li_simple" . }}
+              {{ partial "talk_li_compact" . }}
             {{ end }}
           {{ end }}
 

二进制
static/img/portrait.jpg