Sfoglia il codice sorgente

publication: Make publication name optional

Close #423
George Cushen 7 anni fa
parent
commit
588142274b

+ 20 - 8
exampleSite/config.toml

@@ -1,6 +1,17 @@
-baseurl = "/"  # End your URL with a `/` trailing slash, e.g. `https://example.com/`.
+# Configuration of Academic
+# Documentation: https://sourcethemes.com/academic/
+
+# The URL of your website.
+# End your URL with a `/` trailing slash, e.g. `https://example.com/`.
+baseurl = "/"
+
+# Title of your site
 title = "Academic"
-copyright = "© 2017 Your Name"
+
+# Your copyright notice - appears in site footer.
+# To display a copyright symbol, type `©`.
+copyright = "© 2018"
+
 theme = "academic"
 enableEmoji = true
 footnotereturnlinkcontents = "<sup>^</sup>"
@@ -150,15 +161,16 @@ defaultContentLanguageInSubdir = false
   #   The index of the publication type in the list is used as its unique numerical identifier.
   #   The numeric ID is used in a publication's frontmatter to categorize it.
   #   The language can be edited below.
-  #   For multi-lingual sites, copy this block to each language section at the end of this file.
+  #   For multilingual sites, `publication_types` can be copied to each language section at the end of this file and
+  #   translated.
   publication_types = [
     'Uncategorized',  # 0
-    'Conference proceedings',  # 1
-    'Journal',  # 2
-    'Work in progress',  # 3
-    'Technical report',  # 4
+    'Conference paper',  # 1
+    'Journal article',  # 2
+    'Manuscript',  # 3
+    'Report',  # 4
     'Book',  # 5
-    'Book chapter'  # 6
+    'Book section'  # 6
   ]
 
   # Configuration of talk pages.

+ 4 - 4
layouts/partials/publication_li_apa.html

@@ -8,9 +8,9 @@
   ({{- .Date.Format "2006" -}}).
   <a href="{{ .Permalink }}" itemprop="name">{{ .Title }}</a>.
   {{ if .Params.publication_short }}
-    {{- .Params.publication_short | markdownify -}}
-  {{ else }}
-    {{- .Params.publication | markdownify -}}
-  {{ end }}.
+    {{- .Params.publication_short | markdownify -}}.
+  {{ else if .Params.publication }}
+    {{- .Params.publication | markdownify -}}.
+  {{ end }}
   <p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
 </div>

+ 5 - 5
layouts/partials/publication_li_detailed.html

@@ -46,11 +46,11 @@
 
       <div class="pub-publication">
         {{ if .Params.publication_short }}
-        {{- .Params.publication_short | markdownify -}}
-        {{ else }}
-        {{- .Params.publication | markdownify -}}
-        {{- end -}},&nbsp;
-        {{- .Date.Format "2006" -}}.
+        {{- .Params.publication_short | markdownify -}},
+        {{ else if .Params.publication }}
+        {{- .Params.publication | markdownify -}},
+        {{- end -}}
+        {{- .Date.Format "2006" -}}
       </div>
 
       <div class="pub-links">

+ 4 - 4
layouts/partials/publication_li_mla.html

@@ -7,10 +7,10 @@
   </span>.
   <a href="{{ .Permalink }}" itemprop="name">{{ .Title }}</a>.
   {{ if .Params.publication_short }}
-    {{- .Params.publication_short | markdownify -}}
-  {{ else }}
-    {{- .Params.publication | markdownify -}}
-  {{ end }},&nbsp;
+    {{- .Params.publication_short | markdownify -}},
+  {{ else if .Params.publication }}
+    {{- .Params.publication | markdownify -}},
+  {{ end }}
   {{- .Date.Format "2006" -}}.
   <p>{{ partial "publication_links" (dict "content" . "is_list" 1) }}</p>
 </div>

+ 2 - 0
layouts/publication/single.html

@@ -47,6 +47,7 @@
     <div class="visible-xs space-below"></div>
     {{ end }}
 
+    {{ if .Params.publication }}
     <div class="row">
       <div class="col-sm-1"></div>
       <div class="col-sm-10">
@@ -58,6 +59,7 @@
       <div class="col-sm-1"></div>
     </div>
     <div class="visible-xs space-below"></div>
+    {{ end }}
 
     <div class="row">
       <div class="col-sm-1"></div>