Update: I have decided not to complicate stuff with meta tags
This commit is contained in:
parent
6863bb7db8
commit
7383f23e76
2 changed files with 3 additions and 29 deletions
|
@ -3,25 +3,13 @@
|
||||||
<head>
|
<head>
|
||||||
{{ if not .Title }}
|
{{ if not .Title }}
|
||||||
<title>PixivFE</title>
|
<title>PixivFE</title>
|
||||||
<meta name="twitter:title" content="PixivFE" />
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<title>{{ .Title }} - PixivFE</title>
|
<title>{{ . }} - PixivFE</title>
|
||||||
<meta name="twitter:title" content="{{ .Title }}" />
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="description" content="View this page on PixivFE." />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta property="og:site_name" content="PixivFE" />
|
<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/style.css" rel="stylesheet" />
|
||||||
<link href="/css/template.css" rel="stylesheet" />
|
<link href="/css/template.css" rel="stylesheet" />
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -13,13 +13,6 @@ import (
|
||||||
|
|
||||||
var PC *handler.PixivClient
|
var PC *handler.PixivClient
|
||||||
|
|
||||||
type Context struct {
|
|
||||||
Title string
|
|
||||||
Url string
|
|
||||||
Description string
|
|
||||||
Image string
|
|
||||||
}
|
|
||||||
|
|
||||||
func artwork_page(c *gin.Context) {
|
func artwork_page(c *gin.Context) {
|
||||||
id := c.Param("id")
|
id := c.Param("id")
|
||||||
if _, err := strconv.Atoi(id); err != nil {
|
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{
|
c.HTML(http.StatusOK, "artwork.html", gin.H{
|
||||||
"Illust": illust,
|
"Illust": illust,
|
||||||
"Related": related,
|
"Related": related,
|
||||||
"Artist": artist_info,
|
"Artist": artist_info,
|
||||||
"Comments": comments,
|
"Comments": comments,
|
||||||
"Context": context,
|
"Title": illust.Title,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue