custom favicon

This commit is contained in:
MeiK
2020-12-21 10:11:36 +08:00
parent b28c47dd16
commit 9d9e9b3ef4
4 changed files with 9 additions and 1 deletions

View File

@@ -2,7 +2,6 @@
## 已知问题 ## 已知问题
- 提交热力图的标签显示没有完全对齐
- 多个可点击元素点击后会出现蓝色的边框 - 多个可点击元素点击后会出现蓝色的边框
- 移动端模式下点击热力图可能会导致样式错乱 - 移动端模式下点击热力图可能会导致样式错乱
@@ -148,6 +147,7 @@ pygmentsUseClasses = true
rss = true rss = true
location = "China" location = "China"
lastmod = true lastmod = true
favicon = "/images/github.png"
[frontmatter] [frontmatter]
lastmod = ["lastmod", ":fileModTime", ":default"] lastmod = ["lastmod", ":fileModTime", ":default"]

View File

@@ -20,6 +20,7 @@ pygmentsUseClasses = true
rss = true rss = true
location = "China" location = "China"
lastmod = true lastmod = true
favicon = "/images/github.png"
[frontmatter] [frontmatter]
lastmod = ["lastmod", ":fileModTime", ":default"] lastmod = ["lastmod", ":fileModTime", ":default"]

View File

@@ -9,7 +9,11 @@
<link rel="stylesheet" href='{{ "css/dark.css" | absURL }}' /> <link rel="stylesheet" href='{{ "css/dark.css" | absURL }}' />
<link rel="stylesheet" href='{{ "css/syntax.css" | absURL }}' /> <link rel="stylesheet" href='{{ "css/syntax.css" | absURL }}' />
<title>{{ if .IsHome }}{{ else }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title> <title>{{ if .IsHome }}{{ else }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
{{ if .Site.Params.favicon }}
<link rel="icon" type="image/x-icon" href='{{ .Site.Params.favicon }}'>
{{ else }}
<link rel="icon" type="image/x-icon" href='{{ "images/favicon.ico" | absURL }}'> <link rel="icon" type="image/x-icon" href='{{ "images/favicon.ico" | absURL }}'>
{{ end }}
<meta name="theme-color" content="#1e2327"> <meta name="theme-color" content="#1e2327">
<!-- Extended head section--> <!-- Extended head section-->

View File

@@ -253,6 +253,9 @@ svgElem.classList.add(...["svg-tip", "svg-tip-one-line"]);
document.body.appendChild(svgElem); document.body.appendChild(svgElem);
function svgTip(elem, count, dateStr) { function svgTip(elem, count, dateStr) {
if (window.screen.width < 768) {
return;
}
const rect = getCoords(elem); const rect = getCoords(elem);
const date = new Date(dateStr); const date = new Date(dateStr);
const dateFmt = `${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`; const dateFmt = `${months[date.getMonth()]} ${date.getDate()}, ${date.getFullYear()}`;