New section for papers and meta tags for citations

This commit is contained in:
Brandon Rozek 2022-08-21 00:06:51 -04:00
parent 97d21d0722
commit c8b013a04b
4 changed files with 171 additions and 0 deletions

26
archetypes/paper.md Normal file
View file

@ -0,0 +1,26 @@
---
title: ""
authors: []
publish_date: ""
journal: ""
conference: ""
dissertation_institution: ""
technical_report_institution: ""
technical_report_number: 0
issn: ""
isbn: ""
doi: ""
volume: 0
issue: 0
firstpage: 0
lastpage: 0
language: "English"
keywords: []
pdf_url: ""
abstract: ""
---

69
layouts/paper/single.html Normal file
View file

@ -0,0 +1,69 @@
{{ define "main" }}
{{ .Scratch.Set "customTitleHeaderSet" true }}
{{ .Scratch.Set "customTitleHeader" "Publications" }}
{{ .Scratch.Set "customTitleHeaderLink" "/publications" }}
{{ partial "header.html" . }}
<main>
<article class="h-entry">
<h1 class='title p-name'>{{ .Title }}</h1>
<a style="display: none" class="u-url" href="{{ .Permalink }}"></a>
<div style="display: none;" rel="author" class="h-card p-author">
<img class="u-photo" src="{{ .Site.BaseURL }}/img/avatar.jpg"/>
<span > {{ .Site.Params.Author }}</span>
</div>
<!-- content -->
<div class="e-content">
<p><strong>Authors</strong>:
{{range .Params.authors }}
{{ . }},
{{ end }}
</p>
{{ if isset .Params "journal" }}
<p>
<strong>Journal:</strong>
{{ .Params.journal }}
</p>
{{ end }}
{{ if isset .Params "conference" }}
<p>
<strong>Conference:</strong>
{{ .Params.conference }}
</p>
{{ end }}
{{ if isset .Params "publish_date" }}
<p>
<strong>Publication Date:</strong>
{{ .Params.publish_date }}
</p>
{{ end }}
{{ if isset .Params "abstract" }}
<p>
<strong>Abstract:</strong>
{{ .Params.abstract }}
</p>
{{ end }}
{{ if isset .Params "keywords" }}
<p><strong>Keywords</strong>:
{{range .Params.keywords }}
{{ . }},
{{ end }}
</p>
{{ end }}
{{ if isset .Params "pdf_url" }}
<p>
<strong>PDF Link:</strong>
<a href="{{ .Params.pdf_url }}">{{ .Params.pdf_url }}</a>
</p>
{{ end }}
</div>
</article>
</main>
{{ partial "footer.html" . }}
{{ end }}

View file

@ -0,0 +1,74 @@
{{ $is_conference := isset .Params "conference" }}
{{ $is_journal := isset .Params "journal" }}
{{- if (or $is_conference $is_journal ) -}}
{{- if isset .Params "title" -}}
<meta name="citation_title" content="{{ .Params.title }}">
{{ end }}
{{- if isset .Params "authors" -}}
{{- range .Params.authors -}}
<meta name="citation_author" content="{{ . }}">
{{ end }}
{{ end }}
{{- if isset .Params "publish_date" -}}
<meta name="citation_publication_date" content="{{ .Params.publish_date }}">
{{ end }}
{{- if isset .Params "journal" -}}
<meta name="citation_journal_title" content="{{ .Params.journal }}">
{{ end }}
{{- if isset .Params "conference" -}}
<meta name="citation_conference_title" content="{{ .Params.conference }}">
{{ end }}
{{- if isset .Params "dissertation_institution" -}}
<meta name="citation_dissertation_institution" content="{{ .Params.dissertation_institution }}">
{{ end }}
{{- if isset .Params "technical_report_institution" -}}
<meta name="citation_technical_report_institution" content="{{ .Params.technical_report_institution }}">
{{ end }}
{{- if isset .Params "technical_report_number" -}}
<meta name="citation_technical_report_number" content="{{ .Params.technical_report_number }}">
{{ end }}
{{- if isset .Params "issn" -}}
<meta name="citation_issn" content="{{ .Params.issn }}">
{{ end }}
{{- if isset .Params "isbn" -}}
<meta name="citation_isbn" content="{{ .Params.isbn }}">
{{ end }}
{{- if isset .Params "doi" -}}
<meta name="citation_doi" content="{{ .Params.doi }}">
{{ end }}
{{- if isset .Params "volume" -}}
<meta name="citation_volume" content="{{ .Params.volume }}">
{{ end }}
{{- if isset .Params "issue" -}}
<meta name="citation_issue" content="{{ .Params.issue }}">
{{ end }}
{{- if isset .Params "firstpage" -}}
<meta name="citation_firstpage" content="{{ .Params.firstpage }}">
{{ end }}
{{- if isset .Params "lastpage" -}}
<meta name="citation_lastpage" content="{{ .Params.lastpage }}">
{{ end }}
{{- if isset .Params "language" -}}
<meta name="citation_language" content="{{ .Params.language }}">
{{ end }}
{{- if isset .Params "keywords" -}}
{{- range .Params.keywords -}}
<meta name="citation_keyword" content="{{ . }}">
{{ end }}
{{ end }}
{{- if isset .Params "pdf_url" -}}
<meta name="citation_pdf_url" content="{{ .Params.pdf_url }}">
{{ end }}
{{- if isset .Params "abstract" -}}
<meta name="citation_abstract" content="{{ .Params.abstract }}">
{{ end }}
{{ end }}

View file

@ -74,4 +74,6 @@
{{- if or .Params.math .Site.Params.math -}} {{- if or .Params.math .Site.Params.math -}}
{{ partial "mathjax_support.html" . }} {{ partial "mathjax_support.html" . }}
{{- end -}} {{- end -}}
{{ partial "citation.html" . }}
</head> </head>