浏览代码

publication: Add optional DOI link (#677)

Andrew Fowlie 6 年之前
父节点
当前提交
02d84dff98

+ 3 - 0
archetypes/publication.md

@@ -57,6 +57,9 @@ url_source = ""
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 # url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
+# Digital Object Identifier (DOI)
+doi = ""
+
 # Does this page contain LaTeX math? (true/false)
 math = false
 

+ 3 - 0
exampleSite/content/publication/clothing-search.md

@@ -57,6 +57,9 @@ url_source = "#"
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
+# Digital Object Identifier (DOI)
+doi = ""
+
 # Does this page contain LaTeX math? (true/false)
 math = true
 

+ 3 - 0
exampleSite/content/publication/person-re-identification.md

@@ -57,6 +57,9 @@ url_source = ""
 #   Uncomment line below to enable. For multiple links, use the form `[{...}, {...}, {...}]`.
 # url_custom = [{name = "Custom Link", url = "http://example.org"}]
 
+# Digital Object Identifier (DOI)
+doi = ""
+
 # Does this page contain LaTeX math? (true/false)
 math = true
 

+ 5 - 0
layouts/partials/publication_links.html

@@ -66,6 +66,11 @@
   {{ i18n "btn_source" }}
 </a>
 {{ end }}
+{{ with $.Params.doi }}
+<a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="https://doi.org/{{ . }}" target="_blank" rel="noopener">
+  DOI
+</a>
+{{ end }}
 {{ range $.Params.url_custom }}
 <a class="btn btn-outline-primary my-1 mr-1{{ if $is_list }} btn-sm{{end}}" href="{{ .url | relURL }}" target="_blank" rel="noopener">
   {{ .name }}