|
1 | 1 | {% extends "!layout.html" %} |
2 | | - |
3 | 2 | {%- block extrahead %} |
4 | 3 | {{ super() }} |
5 | | - |
6 | | - {% set metadata = meta if meta is defined and meta is not none else {} %} |
7 | 4 | {% set site_name = "University of Alabama Libraries Scholarly API Cookbook" %} |
8 | 5 | {% set base = (html_baseurl or "https://ua-libraries-research-data-services.github.io/UALIB_ScholarlyAPI_Cookbook/") %} |
9 | 6 | {% set page_url = base ~ pagename ~ ('' if pagename.endswith('.html') else '.html') %} |
10 | | - |
11 | | - {# Prefer page description; fallback to a global site description #} |
12 | | - {% set site_desc = "Example tutorials for working with scholarly APIs for academic scholarly research and teaching using Python and R." %} |
13 | | - {% set page_desc = metadata.get("description") %} |
14 | | - {% set desc = page_desc or site_desc %} |
15 | | - |
16 | | - {% set og_title = metadata.get("og:title") or (title|striptags) %} |
17 | | - {% set og_type = metadata.get("og:type") or "website" %} |
18 | | - |
19 | | - <!-- Canonical Link --> |
| 7 | + <!-- Canonical Link and Sitemap --> |
20 | 8 | <link rel="canonical" href="{{ page_url }}" /> |
21 | | - |
| 9 | + <link rel="sitemap" type="application/xml" title="Sitemap" href="{{ base }}sitemap.xml"> |
| 10 | + {% set og_title = title|striptags %} |
| 11 | + {% set site_desc = "Example tutorials for working with scholarly APIs for academic research and teaching using Python and R." %} |
22 | 12 | <!-- Open Graph --> |
23 | 13 | <meta property="og:site_name" content="{{ site_name }}" /> |
24 | 14 | <meta property="og:title" content="{{ og_title }}" /> |
25 | | - <meta property="og:description" content="{{ desc }}" /> |
26 | | - <meta property="og:type" content="{{ og_type }}" /> |
| 15 | + <meta property="og:description" content="{{ site_desc }}" /> |
| 16 | + <meta property="og:type" content="website" /> |
27 | 17 | <meta property="og:url" content="{{ page_url }}" /> |
28 | | - |
| 18 | + <!-- Twitter Card --> |
| 19 | + <meta name="twitter:card" content="summary_large_image" /> |
| 20 | + <meta name="twitter:title" content="{{ og_title }}" /> |
| 21 | + <meta name="twitter:description" content="{{ site_desc }}" /> |
| 22 | + <meta name="twitter:image" content="{{ base }}images/UALIB_logo.png"> |
| 23 | + <meta name="twitter:image:alt" content="{{ title }}"> |
29 | 24 | <!-- LD+JSON --> |
30 | 25 | <script type="application/ld+json"> |
31 | 26 | { |
|
102 | 97 | ] |
103 | 98 | } |
104 | 99 | </script> |
105 | | - |
106 | 100 | {%- endblock %} |
0 commit comments