mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
publications: Support classic citation format (#235)
* Breaking Change: boolean `detailed_list` has changed to integer `list_format` parameter - refer to latest exampleSite
This commit is contained in:
parent
405058b8d9
commit
8168053656
13 changed files with 61 additions and 40 deletions
|
@ -2,7 +2,7 @@
|
||||||
# Recent Publications widget.
|
# Recent Publications widget.
|
||||||
# This widget displays recent publications from `content/publication/`.
|
# This widget displays recent publications from `content/publication/`.
|
||||||
|
|
||||||
date = "2016-04-20T00:00:00"
|
date = 2016-04-20
|
||||||
draft = false
|
draft = false
|
||||||
|
|
||||||
title = "Recent Publications"
|
title = "Recent Publications"
|
||||||
|
@ -15,8 +15,11 @@ weight = 20
|
||||||
# Number of publications to list.
|
# Number of publications to list.
|
||||||
count = 10
|
count = 10
|
||||||
|
|
||||||
# Show publication details (such as abstract)? (true/false)
|
# List format.
|
||||||
detailed_list = false
|
# 0 = Simple
|
||||||
|
# 1 = Classic
|
||||||
|
# 2 = Detailed
|
||||||
|
list_format = 0
|
||||||
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
# This widget displays publications from `content/publication/` which have
|
# This widget displays publications from `content/publication/` which have
|
||||||
# `selected = true` in their `+++` front matter.
|
# `selected = true` in their `+++` front matter.
|
||||||
|
|
||||||
date = "2016-04-20T00:00:00"
|
date = 2016-04-20
|
||||||
draft = false
|
draft = false
|
||||||
|
|
||||||
title = "Selected Publications"
|
title = "Selected Publications"
|
||||||
|
@ -13,8 +13,11 @@ widget = "publications_selected"
|
||||||
# Order that this section will appear in.
|
# Order that this section will appear in.
|
||||||
weight = 10
|
weight = 10
|
||||||
|
|
||||||
# Show publication details (such as abstract)? (true/false)
|
# List format.
|
||||||
detailed_list = true
|
# 0 = Simple
|
||||||
|
# 1 = Classic
|
||||||
|
# 2 = Detailed
|
||||||
|
list_format = 2
|
||||||
|
|
||||||
+++
|
+++
|
||||||
|
|
||||||
|
|
|
@ -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 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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -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.
|
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 %}}
|
{{% 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 %}}
|
{{% /alert %}}
|
||||||
|
|
||||||
## Add a widget to the homepage
|
## Add a widget to the homepage
|
||||||
|
|
|
@ -3,7 +3,12 @@ title = "Publications"
|
||||||
date = "2017-01-01T00:00:00Z"
|
date = "2017-01-01T00:00:00Z"
|
||||||
math = false
|
math = false
|
||||||
highlight = 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).
|
# Optional featured image (relative to `static/img/` folder).
|
||||||
[header]
|
[header]
|
||||||
|
|
|
@ -7,7 +7,7 @@ image_preview = ""
|
||||||
math = true
|
math = true
|
||||||
publication_types = ["2"]
|
publication_types = ["2"]
|
||||||
publication = "In *Signal Image Technology & Internet Systems (SITIS)*, IEEE."
|
publication = "In *Signal Image Technology & Internet Systems (SITIS)*, IEEE."
|
||||||
publication_short = ""
|
publication_short = "In *SITIS*"
|
||||||
selected = false
|
selected = false
|
||||||
title = "A Person Re-Identification System For Mobile Devices"
|
title = "A Person Re-Identification System For Mobile Devices"
|
||||||
url_code = ""
|
url_code = ""
|
||||||
|
|
16
layouts/partials/publication_li_classic.html
Normal file
16
layouts/partials/publication_li_classic.html
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
|
||||||
|
<i class="fa fa-file-text-o pub-icon" aria-hidden="true"></i>
|
||||||
|
<span itemprop="author">
|
||||||
|
{{ with .Params.authors }}
|
||||||
|
{{- delimit . ", " | markdownify -}}
|
||||||
|
{{- end -}}
|
||||||
|
</span>.
|
||||||
|
<span itemprop="name">{{ .Title }}</span>.
|
||||||
|
{{ if .Params.publication_short }}
|
||||||
|
{{- .Params.publication_short | markdownify -}}
|
||||||
|
{{ else }}
|
||||||
|
{{- .Params.publication | markdownify -}}
|
||||||
|
{{ end }},
|
||||||
|
{{- .Date.Format "2006" -}}.
|
||||||
|
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
|
||||||
|
</div>
|
|
@ -46,14 +46,15 @@
|
||||||
|
|
||||||
<div class="pub-publication">
|
<div class="pub-publication">
|
||||||
{{ if .Params.publication_short }}
|
{{ if .Params.publication_short }}
|
||||||
{{ .Params.publication_short | markdownify }}
|
{{- .Params.publication_short | markdownify -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ .Params.publication | markdownify }}
|
{{- .Params.publication | markdownify -}}
|
||||||
{{ end }}
|
{{- end -}},
|
||||||
|
{{- .Date.Format "2006" -}}.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pub-links">
|
<div class="pub-links">
|
||||||
{{ partial "publication_links" (dict "content" . "is_list" 1) }}
|
{{ partial "publication_links" (dict "content" . "is_list" 0) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<li itemscope itemtype="http://schema.org/CreativeWork">
|
<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
|
||||||
<i class="fa-li fa fa-file-text-o pub-icon" aria-hidden="true"></i>
|
<i class="fa fa-file-text-o pub-icon" aria-hidden="true"></i>
|
||||||
<span itemprop="name">{{ .Title }}</span>
|
<span itemprop="name">{{ .Title }}</span>
|
||||||
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
|
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
|
||||||
</li>
|
</div>
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
<div class="pub-list-item" style="margin-bottom: 1rem" itemscope itemtype="http://schema.org/CreativeWork">
|
|
||||||
<i class="fa fa-file-text-o pub-icon" aria-hidden="true"></i>
|
|
||||||
<span itemprop="name">{{ .Title }}</span>
|
|
||||||
<p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
|
|
||||||
</div>
|
|
|
@ -19,16 +19,14 @@
|
||||||
<div class="col-xs-12 col-md-8">
|
<div class="col-xs-12 col-md-8">
|
||||||
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
|
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||||
|
|
||||||
{{ if $page.Params.detailed_list }}
|
|
||||||
{{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }}
|
{{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }}
|
||||||
{{ partial "publication_li_detailed" . }}
|
{{ if eq $page.Params.list_format 1 }}
|
||||||
{{ end }}
|
{{ partial "publication_li_classic" . }}
|
||||||
{{ else }}
|
{{ else if eq $page.Params.list_format 2 }}
|
||||||
<ul class="fa-ul">
|
{{ partial "publication_li_detailed" . }}
|
||||||
{{ range first $page.Params.count (where $.Data.Pages "Type" "publication") }}
|
{{ else }}
|
||||||
{{ partial "publication_li_simple" . }}
|
{{ partial "publication_li_simple" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -10,16 +10,14 @@
|
||||||
<div class="col-xs-12 col-md-8">
|
<div class="col-xs-12 col-md-8">
|
||||||
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
|
{{ with $page.Content }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||||
|
|
||||||
{{ if $page.Params.detailed_list }}
|
|
||||||
{{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }}
|
{{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }}
|
||||||
{{ partial "publication_li_detailed" . }}
|
{{ if eq $page.Params.list_format 1 }}
|
||||||
{{ end }}
|
{{ partial "publication_li_classic" . }}
|
||||||
{{ else }}
|
{{ else if eq $page.Params.list_format 2 }}
|
||||||
<ul class="fa-ul">
|
{{ partial "publication_li_detailed" . }}
|
||||||
{{ range (where (where $.Data.Pages "Type" "publication") ".Params.selected" true) }}
|
{{ else }}
|
||||||
{{ partial "publication_li_simple" . }}
|
{{ partial "publication_li_simple" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,10 +34,12 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="grid-sizer col-md-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }}">
|
<div class="grid-sizer col-md-12 isotope-item pubtype-{{ $.Scratch.Get "pubtype" }}">
|
||||||
{{ 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" . }}
|
{{ partial "publication_li_detailed" . }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ partial "publication_li_simple_div" . }}
|
{{ partial "publication_li_simple" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue