page_links_div.html 1.1 KB

12345678910111213141516171819202122232425
  1. {{/* Div wrapper around page links. */}}
  2. {{/* The wrapper is hidden when the page has no link buttons. */}}
  3. {{ $page := . }}
  4. {{ $pdf_link := false }}
  5. {{ $cite_link := false }}
  6. {{ $slug := $page.File.ContentBaseName }}
  7. {{ $resource := $page.Resources.GetMatch (printf "%s.pdf" $slug) }}
  8. {{ with $resource }}
  9. {{ $pdf_link = true }}
  10. {{ end }}
  11. {{ $resource := $page.Resources.GetMatch "cite.bib" }}
  12. {{ with $resource }}
  13. {{ $cite_link = true }}
  14. {{ end }}
  15. {{ if $cite_link | or $pdf_link | or .Params.external_link | or .Params.url_preprint | or .Params.url_pdf | or .Params.url_slides | or .Params.url_video | or .Params.url_source | or .Params.url_code | or .Params.url_dataset | or .Params.url_poster | or .Params.url_project | or .Params.doi | or .Params.links | or .Params.projects | or .Params.slides }}
  16. <div class="btn-links mb-3">
  17. {{ with .Params.external_link }}
  18. <a class="btn btn-outline-primary my-1" href="{{ . }}" target="_blank" rel="noopener">{{ i18n "open_project_site" }}</a>
  19. {{ end }}
  20. {{ partial "page_links" (dict "page" $page "is_list" 0) }}
  21. </div>
  22. {{ end }}