From 2c74ad394793ac24edb32bb52ffcf84847229b86 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 1 Oct 2017 00:10:38 +0100 Subject: [PATCH] talk archive: display listings consistent with talk widget (Close #184) - talk widget: Change `detailed_list = false` option to `list_format = 0` - Update docs --- exampleSite/content/home/talks.md | 6 ++++-- exampleSite/content/post/managing-content.md | 2 +- exampleSite/content/talk/_index.md | 6 +++++- layouts/partials/talk_li_simple.html | 6 +++--- layouts/partials/widgets/talks.html | 13 ++++--------- layouts/partials/widgets/talks_selected.html | 13 ++++--------- layouts/section/talk.html | 15 ++++++--------- 7 files changed, 27 insertions(+), 34 deletions(-) diff --git a/exampleSite/content/home/talks.md b/exampleSite/content/home/talks.md index 487fdf29..ae290433 100644 --- a/exampleSite/content/home/talks.md +++ b/exampleSite/content/home/talks.md @@ -14,8 +14,10 @@ weight = 30 # Number of talks to list. count = 10 -# Show talk details (such as abstract)? (true/false) -detailed_list = false +# List format. +# 0 = Simple +# 1 = Detailed +list_format = 0 +++ diff --git a/exampleSite/content/post/managing-content.md b/exampleSite/content/post/managing-content.md index 392e4666..f5169742 100644 --- a/exampleSite/content/post/managing-content.md +++ b/exampleSite/content/post/managing-content.md @@ -66,7 +66,7 @@ You can also associate custom link buttons with the publication by adding the fo url = "http://www.example.org" ``` -If you enabled `detailed_list` for publications in `config.toml`, then there are a few more optional variables that you can include in the publication page preamble. You may use `abstract_short = "friendly summary of abstract"` and `publication_short = "abbreviated publication details"` to display a friendly summary of the abstract and abbreviate the publication details, respectively. Furthermore, there is the option to display a different image on the homepage to the publication detail page by setting `image_preview = "my-image.jpg"`. This can be useful if you wish to scale down the image for the homepage or simply if you just wish to show a different image for the preview. +If you set `list_format=2` to enable a detailed listing of publications in the Publication Widget (`home/publications.md`) or Publication Archive (`publication/_index.md`), then there are a few more optional variables that you can include in the publication page preamble. You may use `abstract_short = "friendly summary of abstract"` and `publication_short = "abbreviated publication details"` to display a friendly summary of the abstract and abbreviate the publication details, respectively. Furthermore, there is the option to display a different image on the homepage to the publication detail page by setting `image_preview = "my-image.jpg"`. This can be useful if you wish to scale down the image for the homepage or simply if you just wish to show a different image for the preview. {{% alert warning %}} Any double quotes (`"`) or backslashes (e.g. LaTeX `\times`) occurring within the value of any frontmatter parameter (such as the *abstract*) should be escaped with a backslash (`\`). For example, the symbol `"` and LaTeX text `\times` become `\"` and `\\times`, respectively. Refer to the [TOML documentation](https://github.com/toml-lang/toml#user-content-string) for more info. diff --git a/exampleSite/content/talk/_index.md b/exampleSite/content/talk/_index.md index 3be9f550..8cb2939e 100644 --- a/exampleSite/content/talk/_index.md +++ b/exampleSite/content/talk/_index.md @@ -4,9 +4,13 @@ date = "2017-01-01T00:00:00Z" math = false highlight = false +# List format. +# 0 = Simple +# 1 = Detailed +list_format = 0 + # Optional featured image (relative to `static/img/` folder). [header] image = "" caption = "" - +++ diff --git a/layouts/partials/talk_li_simple.html b/layouts/partials/talk_li_simple.html index f470f6a5..d05eb956 100644 --- a/layouts/partials/talk_li_simple.html +++ b/layouts/partials/talk_li_simple.html @@ -1,5 +1,5 @@ -
  • - +
    + {{ .Title }}

    {{ .Date.Format $.Site.Params.date_format }}, @@ -9,4 +9,4 @@ {{ .Params.event | markdownify }} {{ end }}

    -
  • + diff --git a/layouts/partials/widgets/talks.html b/layouts/partials/widgets/talks.html index e7914093..d2bca7f2 100644 --- a/layouts/partials/widgets/talks.html +++ b/layouts/partials/widgets/talks.html @@ -19,17 +19,12 @@
    {{ with $page.Content }}

    {{ . | markdownify }}

    {{ end }} - {{ if $page.Params.detailed_list }} {{ range first $page.Params.count (where $.Data.Pages "Type" "talk") }} - {{ partial "talk_li_detailed" . }} - {{ end }} - {{ else }} - {{ end }} -
    diff --git a/layouts/partials/widgets/talks_selected.html b/layouts/partials/widgets/talks_selected.html index 446cfcec..2211caa3 100644 --- a/layouts/partials/widgets/talks_selected.html +++ b/layouts/partials/widgets/talks_selected.html @@ -10,17 +10,12 @@
    {{ with $page.Content }}

    {{ . | markdownify }}

    {{ end }} - {{ if $page.Params.detailed_list }} {{ range (where (where $.Data.Pages "Type" "talk") ".Params.selected" true) }} - {{ partial "talk_li_detailed" . }} - {{ end }} - {{ else }} - {{ end }} -
    diff --git a/layouts/section/talk.html b/layouts/section/talk.html index 3fff7b09..f4b67c9e 100644 --- a/layouts/section/talk.html +++ b/layouts/section/talk.html @@ -18,18 +18,15 @@

    {{ .Key }}

    -
    {{ end }}