Add open graph metadata in header

Signed-off-by: Harry Chen <i@harrychen.xyz>
This commit is contained in:
Harry Chen 2021-08-03 20:35:30 +08:00
parent 8891fada37
commit 919988126d
No known key found for this signature in database
GPG Key ID: 9F98D3E7C18D0378
2 changed files with 14 additions and 3 deletions

View File

@ -2,12 +2,23 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{% if include.metaDesc %}{{ include.metaDesc }}
{% endif %}{{ site.title }}致力于为国内和校内用户提供高质量的开源软件镜像、Linux 镜像源服务,帮助用户更方便地获取开源软件。本镜像站由清华大学 TUNA 团队负责维护。">
{% capture site_desc %}{% if include.metaDesc %}{{ include.metaDesc }}{% endif %}{{ site.title }}致力于为国内和校内用户提供高质量的开源软件镜像、Linux 镜像源服务,帮助用户更方便地获取开源软件。本镜像站由清华大学 TUNA 团队负责维护。{% endcapture %}
{% capture page_title %}{% if page.mirrorid %} {{ page.mirrorid }} |{% elsif page.title %} {{ page.title }} |{% endif %}{% if include.cattitle %} {{ include.cattitle }} |{% endif %}{% if (page.title or include.cattitle) %}{{" "}}{% endif %}{{ site.title }}{% if site.brand %} | {{ site.brand }}{% endif %}{% endcapture %}
<meta name="description" content="{{ site_desc }}">
<meta name="keywords" content="镜像站,镜像源,Linux,软件源,开源">
<meta name="author" content="TUNA">
<link rel="shortcut icon" href="/static/img/favicon.png">
<title>{% if page.mirrorid %} {{ page.mirrorid }} |{% elsif page.title %} {{ page.title }} |{% endif %}{% if include.cattitle %} {{ include.cattitle }} |{% endif %}{% if (page.title or include.cattitle) %}{{" "}}{% endif %}{{ site.title }}{% if site.brand %} | {{ site.brand }}{% endif %}</title>
<!-- Open Graph metadata -->
<meta property="og:type" content="website" />
<meta property="og:title" content="{{ page_title }}" />
<meta property="og:description" content="{{ site_desc }}" />
<meta property="og:image" content="{{ site.url }}{{ site.baseurl }}/static/img/logo-share.png" /> <!-- WeChat requires that thumbnail image is larger than 300x300 -->
<meta property="og:url" content="{{ site.url }}{{ site.baseurl }}{{ page.url }}" />
<title>{{ page_title }}</title>
{% unless include.nostyle %}
<link rel="stylesheet" href="/static/css/bootstrap.min.css?{{ site.data['hash'] }}">
<link rel="stylesheet" href="/static/css/bootstrap-select.min.css?{{ site.data['hash'] }}">

BIN
static/img/logo-share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB