Update: I have decided not to complicate stuff with meta tags

This commit is contained in:
VnPower 2023-06-08 15:31:57 +07:00
parent 6863bb7db8
commit 7383f23e76
Signed by: vnpower
GPG key ID: 881DE3DEB966106C
2 changed files with 3 additions and 29 deletions

View file

@ -3,25 +3,13 @@
<head>
{{ if not .Title }}
<title>PixivFE</title>
<meta name="twitter:title" content="PixivFE" />
{{ else }}
<title>{{ .Title }} - PixivFE</title>
<meta name="twitter:title" content="{{ .Title }}" />
<title>{{ . }} - PixivFE</title>
{{ end }}
<meta charset="UTF-8" />
<meta name="description" content="View this page on PixivFE." />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta property="og:site_name" content="PixivFE" />
{{ if .Image }}
<meta property="og:image" content="{{ proxyImage .Image }}" />
<meta name="twitter:image:src" content="{{ proxyImage .Image }}" />
{{ end }}
<meta name="description" content="{{ .Description }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://{{ .Url }}" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="PixivFE" />
<meta name="twitter:description" content="{{ .Description }}" />
<link rel="alternate" hreflang="en" href="https://{{ .Url }}" />
<link href="/css/style.css" rel="stylesheet" />
<link href="/css/template.css" rel="stylesheet" />
</head>

View file

@ -13,13 +13,6 @@ import (
var PC *handler.PixivClient
type Context struct {
Title string
Url string
Description string
Image string
}
func artwork_page(c *gin.Context) {
id := c.Param("id")
if _, err := strconv.Atoi(id); err != nil {
@ -50,19 +43,12 @@ func artwork_page(c *gin.Context) {
})
}
context := Context{
illust.Title,
c.Request.Host + c.Request.URL.Path,
string(illust.Description),
illust.Images[0].Large,
}
c.HTML(http.StatusOK, "artwork.html", gin.H{
"Illust": illust,
"Related": related,
"Artist": artist_info,
"Comments": comments,
"Context": context,
"Title": illust.Title,
})
}