diff --git a/exampleSite/content/home/publications.md b/exampleSite/content/home/publications.md index eea39a4a..b485b73f 100644 --- a/exampleSite/content/home/publications.md +++ b/exampleSite/content/home/publications.md @@ -2,7 +2,7 @@ # Recent Publications widget. # This widget displays recent publications from `content/publication/`. -date = "2016-04-20T00:00:00" +date = 2016-04-20 draft = false title = "Recent Publications" @@ -15,8 +15,11 @@ weight = 20 # Number of publications to list. count = 10 -# Show publication details (such as abstract)? (true/false) -detailed_list = false +# List format. +# 0 = Simple +# 1 = Classic +# 2 = Detailed +list_format = 0 +++ diff --git a/exampleSite/content/home/publications_selected.md b/exampleSite/content/home/publications_selected.md index ea586f9b..5e27ac88 100644 --- a/exampleSite/content/home/publications_selected.md +++ b/exampleSite/content/home/publications_selected.md @@ -3,7 +3,7 @@ # This widget displays publications from `content/publication/` which have # `selected = true` in their `+++` front matter. -date = "2016-04-20T00:00:00" +date = 2016-04-20 draft = false title = "Selected Publications" @@ -13,8 +13,11 @@ widget = "publications_selected" # Order that this section will appear in. weight = 10 -# Show publication details (such as abstract)? (true/false) -detailed_list = true +# List format. +# 0 = Simple +# 1 = Classic +# 2 = Detailed +list_format = 2 +++ diff --git a/exampleSite/content/post/getting-started.md b/exampleSite/content/post/getting-started.md index 6b34b2d0..91b044a2 100644 --- a/exampleSite/content/post/getting-started.md +++ b/exampleSite/content/post/getting-started.md @@ -133,7 +133,7 @@ To edit the interface text, copy `themes/academic/i18n/en.yaml` to `i18n/en.yaml To translate the interface text to another language, follow the above instructions, but name the new file in the form `i18n/X.yaml` where `X` is the appropriate [ISO/RFC5646 language identifier](http://www.w3schools.com/tags/ref_language_codes.asp) for the translation. Then follow the brief instructions in the *Language* section at the bottom of your `config.toml`. To change the default language used by Academic, set `defaultContentLanguage` to the desired language identifier in your configuration file. -To translate the navigation bar, you can edit the default `[[menu.main]]` instances in `config.toml`. However, for a multilingual site, you will need to duplicate all of the `[[menu.main]]` instances and rename the new instances from `[[menu.main]]` to `[[languages.X.menu.main]]`, where `X` is the language identifier (e.g. `[[languages.zh.menu.main]]` for Simplified Chinese). Thus, the navigation bar can be displayed in multiple languages. +To translate the navigation bar, you can edit the default `[[menu.main]]` instances in `config.toml`. However, for a multilingual site, you will need to duplicate all of the `[[menu.main]]` instances and rename the new instances from `[[menu.main]]` to `[[Languages.X.menu.main]]`, where `X` is the language identifier (e.g. `[[Languages.zh.menu.main]]` for Simplified Chinese). Thus, the navigation bar can be displayed in multiple languages. To translate a content file in your `content/` folder into another language, copy the file to `filename.X.md` where `filename` is your existing filename and `X` is the appropriate [ISO/RFC5646 language identifier](http://www.w3schools.com/tags/ref_language_codes.asp) for the translation. Then translate the content in the new file to the specified language. diff --git a/exampleSite/content/post/widgets.md b/exampleSite/content/post/widgets.md index ca0e46d2..6f411da0 100644 --- a/exampleSite/content/post/widgets.md +++ b/exampleSite/content/post/widgets.md @@ -26,7 +26,7 @@ The example site that you copied to create your site uses all the different type The parameters for each widget vary. They can be found in the preamble/frontmatter (between the pair of `+++`) for each widget installed in the `content/home/` folder. {{% alert note %}} -By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `detailed_list = true` in `content/home/publications.md`. +By default, publications will be displayed in a simple list. If you prefer a more detailed list with abstract and image, you can enable the detailed publication list on the homepage by setting `list_format = 2` in `content/home/publications.md`. {{% /alert %}} ## Add a widget to the homepage diff --git a/exampleSite/content/publication/_index.md b/exampleSite/content/publication/_index.md index 5a676102..956fa6ef 100644 --- a/exampleSite/content/publication/_index.md +++ b/exampleSite/content/publication/_index.md @@ -3,7 +3,12 @@ title = "Publications" date = "2017-01-01T00:00:00Z" math = false highlight = false -detailed_list = false + +# List format. +# 0 = Simple +# 1 = Classic +# 2 = Detailed +list_format = 0 # Optional featured image (relative to `static/img/` folder). [header] diff --git a/exampleSite/content/publication/person-re-identification.md b/exampleSite/content/publication/person-re-identification.md index 41ea9761..59cb0815 100644 --- a/exampleSite/content/publication/person-re-identification.md +++ b/exampleSite/content/publication/person-re-identification.md @@ -7,7 +7,7 @@ image_preview = "" math = true publication_types = ["2"] publication = "In *Signal Image Technology & Internet Systems (SITIS)*, IEEE." -publication_short = "" +publication_short = "In *SITIS*" selected = false title = "A Person Re-Identification System For Mobile Devices" url_code = "" diff --git a/layouts/partials/publication_li_classic.html b/layouts/partials/publication_li_classic.html new file mode 100644 index 00000000..0eb93c91 --- /dev/null +++ b/layouts/partials/publication_li_classic.html @@ -0,0 +1,16 @@ +
+ + . + {{ .Title }}. + {{ if .Params.publication_short }} + {{- .Params.publication_short | markdownify -}} + {{ else }} + {{- .Params.publication | markdownify -}} + {{ end }},  + {{- .Date.Format "2006" -}}. +

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

+
diff --git a/layouts/partials/publication_li_detailed.html b/layouts/partials/publication_li_detailed.html index 2fed2bde..482714e4 100644 --- a/layouts/partials/publication_li_detailed.html +++ b/layouts/partials/publication_li_detailed.html @@ -46,14 +46,15 @@
{{ if .Params.publication_short }} - {{ .Params.publication_short | markdownify }} + {{- .Params.publication_short | markdownify -}} {{ else }} - {{ .Params.publication | markdownify }} - {{ end }} + {{- .Params.publication | markdownify -}} + {{- end -}},  + {{- .Date.Format "2006" -}}.
diff --git a/layouts/partials/publication_li_simple.html b/layouts/partials/publication_li_simple.html index 21d0491a..91384bfa 100644 --- a/layouts/partials/publication_li_simple.html +++ b/layouts/partials/publication_li_simple.html @@ -1,5 +1,5 @@ -
  • - +
    + {{ .Title }}

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

    -
  • + diff --git a/layouts/partials/publication_li_simple_div.html b/layouts/partials/publication_li_simple_div.html deleted file mode 100644 index 91384bfa..00000000 --- a/layouts/partials/publication_li_simple_div.html +++ /dev/null @@ -1,5 +0,0 @@ -
    - - {{ .Title }} -

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

    -
    diff --git a/layouts/partials/widgets/publications.html b/layouts/partials/widgets/publications.html index f790eca4..f7322229 100644 --- a/layouts/partials/widgets/publications.html +++ b/layouts/partials/widgets/publications.html @@ -19,16 +19,14 @@
    {{ with $page.Content }}

    {{ . | markdownify }}

    {{ end }} - {{ if $page.Params.detailed_list }} {{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }} - {{ partial "publication_li_detailed" . }} - {{ end }} - {{ else }} - {{ end }}
    diff --git a/layouts/partials/widgets/publications_selected.html b/layouts/partials/widgets/publications_selected.html index 2d0946e3..93d25313 100644 --- a/layouts/partials/widgets/publications_selected.html +++ b/layouts/partials/widgets/publications_selected.html @@ -10,16 +10,14 @@
    {{ with $page.Content }}

    {{ . | markdownify }}

    {{ end }} - {{ if $page.Params.detailed_list }} {{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }} - {{ partial "publication_li_detailed" . }} - {{ end }} - {{ else }} - {{ end }}
    diff --git a/layouts/section/publication.html b/layouts/section/publication.html index a3a766c6..15f8e136 100644 --- a/layouts/section/publication.html +++ b/layouts/section/publication.html @@ -34,10 +34,12 @@ {{ end }}
    - {{ if $.Params.detailed_list }} + {{ if eq $.Params.list_format 1 }} + {{ partial "publication_li_classic" . }} + {{ else if eq $.Params.list_format 2 }} {{ partial "publication_li_detailed" . }} {{ else }} - {{ partial "publication_li_simple_div" . }} + {{ partial "publication_li_simple" . }} {{ end }}