personal-website/_includes/metadata.html

155 lines
7.5 KiB
HTML

{% if site.enable_google_verification or site.enable_bing_verification %}
<!-- Website verification -->
{% if site.enable_google_verification -%}
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
{%- endif -%}
{% if site.enable_bing_verification -%}
<meta name="msvalidate.01" content="{{ site.bing_site_verification }}" />
{%- endif -%}
{%- endif %}
<!-- Standard metadata -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>
{%- if site.title == "blank" -%}
{%- capture title -%}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{%- endcapture -%}
{%- else -%}
{%- capture title -%}{{ site.title }}{%- endcapture -%}
{%- endif -%}
{%- if page.title != "blank" and page.url != "/" -%}
{{ title }} | {{ page.title }}
{%- else -%}
{{ title }}
{%- endif -%}
</title>
<meta name="author" content="{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}" />
<meta name="description" content="{%- if page.description -%}{{ page.description }}{%- else -%}{{ site.description }}{%- endif -%}" />
{%- if page.keywords or site.keywords %}
<meta name="keywords" content="{%- if page.keywords -%}{{ page.keywords }}{%- else -%}{{ site.keywords }}{%- endif -%}" />
{%- endif %}
{%- if site.serve_og_meta %}
<!-- OpenGraph -->
<meta property="og:site_name" content="{{ site.title }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="{%- if page.title -%}{{ site.title }} | {{ page.title }}{%- else -%}{{ site.title }}{%- endif -%}" />
<meta property="og:url" content="{{ page.url | prepend: site.baseurl | prepend: site.url | remove_first: 'index.html' }}" />
<meta property="og:description" content="{%- if page.description -%}{{ page.description }}{%- else -%}{{ site.description }}{%- endif -%}" />
{% if page.og_image or site.og_image -%}
<meta property="og:image" content="{%- if page.og_image -%}{{ page.og_image }}{%- else -%}{{ site.og_image }}{%- endif -%}" />
{%- endif %}
<meta property="og:locale" content="{{ site.lang }}" />
<!-- Twitter card -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="{%- if page.title -%}{{ page.title }}{%- else -%}{{ site.title }}{%- endif -%}" />
<meta name="twitter:description" content="{%- if page.description -%}{{ page.description }}{%- else -%}{{ site.description }}{%- endif -%}" />
{% if page.og_image or site.og_image -%}
<meta name="twitter:image" content="{%- if page.og_image -%}{{ page.og_image }}{%- else -%}{{ site.og_image }}{%- endif -%}" />
{%- endif %}
{% if site.twitter_username -%}
<meta name="twitter:site" content="@{{ site.twitter_username }}" />
<meta name="twitter:creator" content="@{{ site.twitter_username }}" />
{%- endif %}
{%- endif %}
{%- if site.serve_schema_org %}
<!-- Schema.org -->
{%- comment -%} Social links generator for "sameAs schema" {%- endcomment %}
{% assign sameaslinks = "" | split: "," %}
{%- if site.orcid_id -%}
{%- capture link -%}https://orcid.org/{{ site.orcid_id }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.scholar_userid -%}
{%- capture link -%}https://scholar.google.com/citations?user={{ site.scholar_userid }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.publons_id -%}
{%- capture link -%}https://publons.com/a/{{ site.publons_id }}/{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.research_gate_profile -%}
{%- capture link -%}https://www.researchgate.net/profile/{{site.research_gate_profile}}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.github_username -%}
{%- capture link -%}https://github.com/{{ site.github_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.linkedin_username -%}
{%- capture link -%}https://www.linkedin.com/in/{{ site.linkedin_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.twitter_username -%}
{%- capture link -%}https://twitter.com/{{ site.twitter_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.medium_username -%}
{%- capture link -%}https://medium.com/@{{ site.medium_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.quora_username -%}
{%- capture link -%}https://www.quora.com/profile/{{ site.quora_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.blogger_url -%}
{%- capture link -%}{{ site.blogger_url }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.work_url -%}
{%- capture link -%}{{ site.work_url }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.wikidata_id -%}
{%- capture link -%}https://www.wikidata.org/wiki/{{ site.wikidata_id }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.strava_userid -%}
{%- capture link -%}https://www.strava.com/athletes/{{ site.strava_userid }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.keybase_username -%}
{%- capture link -%}https://keybase.io/{{ site.keybase_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.gitlab_username -%}
{%- capture link -%}https://gitlab.com/{{ site.gitlab_username }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.dblp_url -%}
{%- capture link -%}{{ site.dblp_url }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if site.stackoverflow_id -%}
{%- capture link -%}https://stackoverflow.com/users/{{ site.stackoverflow_id }}{%- endcapture -%}
{%- assign sameaslinks = sameaslinks | push: link -%}
{%- endif -%}
{%- if sameaslinks != blank -%}
{%- assign sameaslinks = sameaslinks | split: "" -%}
{%- endif -%}
<script type="application/ld+json">
{
"author":
{
"@type": "Person",
"name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}"
},
"url": "{{ page.url | prepend: site.baseurl | prepend: site.url }}",
"@type": "WebSite",
"description": "{%- if page.description -%}{{ page.description }}{%- else if site.description -%}{{ site.description }}{%- endif -%}",
"headline": "{%- if page.title -%}{{ page.title }}{%- else -%}{{ site.title }}{%- endif -%}",
{% if sameaslinks != blank -%}
"sameAs": {{ sameaslinks }},
{%- endif %}
"name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}",
"@context": "https://schema.org"
}
</script>
{%- endif %}