Merge pull request #333 from teaxyz/package-og-tags

add og tags to package details page
This commit is contained in:
Neil 2023-04-25 13:25:42 +08:00 committed by GitHub
commit c8e716c267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 8 deletions

View file

@ -20,6 +20,8 @@ for row in $(jq -r '.[] | @base64' < "$1"); do
type: page type: page
title: \"$(_jq '.name')\" title: \"$(_jq '.name')\"
maintainer: \"$(_jq '.maintainer')\" maintainer: \"$(_jq '.maintainer')\"
full_name: \"$(_jq '.full_name')\"
og_image_url: \"$(_jq '.thumb_image_url')\"
Description: \"$(_jq '.desc' | tr '\"' "'")\" Description: \"$(_jq '.desc' | tr '\"' "'")\"
layout: \"package-detail\" layout: \"package-detail\"
---" ---"

View file

@ -86,14 +86,23 @@
<meta name="twitter:image" content="http://www.tea.xyz.s3-website-us-east-1.amazonaws.com/cover.png"> <meta name="twitter:image" content="http://www.tea.xyz.s3-website-us-east-1.amazonaws.com/cover.png">
<meta name="twitter:description" content="{{ .Params.Description }}"> <meta name="twitter:description" content="{{ .Params.Description }}">
<meta name="twitter:creator" content="@mxcl"> <meta name="twitter:creator" content="@mxcl">
{{ if eq .Params.layout "package-detail" }}
<meta property="og:url" content="http://tea.xyz" /> <meta property="og:url" content="https://tea.xyz/+{{ .Params.full_name }}" />
<meta property="og:type" content="website" />
<meta property="og:title" content="tea | {{ .Params.title }}" />
<meta property="og:description" content="{{ .Params.Description }}" />
<meta property="og:image" content="{{- .Params.og_image_url -}}" />
<meta property="og:image:alt" content="sh &lt;(curl tea.xyz) +{{ .Params.full_name }}" />
<meta property="og:site_name" content="tea.xyz">
{{ else }}
<meta property="og:url" content="https://tea.xyz" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:title" content="{{ .Params.title }}" /> <meta property="og:title" content="{{ .Params.title }}" />
<meta property="og:description" content="{{ .Params.Description }}" /> <meta property="og:description" content="{{ .Params.Description }}" />
<meta property="og:image" content="http://www.tea.xyz.s3-website-us-east-1.amazonaws.com/cover.png" /> <meta property="og:image" content="http://www.tea.xyz.s3-website-us-east-1.amazonaws.com/cover.png" />
<meta property="og:image:alt" content="sh &lt;(curl tea.xyz)" /> <meta property="og:image:alt" content="sh &lt;(curl tea.xyz)" />
<meta property="og:site_name" content="tea.xyz"> <meta property="og:site_name" content="tea.xyz">
{{ end }}
<meta name="facebook-domain-verification" content="0fsbdl7joh0gha23zbhtovtpn0z0cl" /> <meta name="facebook-domain-verification" content="0fsbdl7joh0gha23zbhtovtpn0z0cl" />
<meta name="description" content="tea is the next-generation, cross-platform package manager from the creator of brew."> <meta name="description" content="tea is the next-generation, cross-platform package manager from the creator of brew.">