add code syntax

This commit is contained in:
MeiK
2020-12-17 18:15:08 +08:00
parent e49f5b551e
commit b7ad0e8c8d
4 changed files with 58 additions and 0 deletions

View File

@@ -131,6 +131,8 @@ languageCode = "zh-cn"
title = "MeiK's blog" title = "MeiK's blog"
theme = "github-style" theme = "github-style"
googleAnalytics = "UA-123456-789" googleAnalytics = "UA-123456-789"
pygmentsCodeFences = true
pygmentsUseClasses = true
[params] [params]
contributions = "post" contributions = "post"
@@ -144,10 +146,12 @@ googleAnalytics = "UA-123456-789"
url = "https://meik2333.com" url = "https://meik2333.com"
keywords = "blog, google analytics" keywords = "blog, google analytics"
rss = true rss = true
location = "China"
lastmod = true lastmod = true
[frontmatter] [frontmatter]
lastmod = ["lastmod", ":fileModTime", ":default"] lastmod = ["lastmod", ":fileModTime", ":default"]
``` ```
## deploy.sh example ## deploy.sh example

View File

@@ -3,6 +3,8 @@ languageCode = "zh-cn"
title = "MeiK's blog" title = "MeiK's blog"
theme = "github-style" theme = "github-style"
googleAnalytics = "UA-123456-789" googleAnalytics = "UA-123456-789"
pygmentsCodeFences = true
pygmentsUseClasses = true
[params] [params]
contributions = "post" contributions = "post"

View File

@@ -7,6 +7,7 @@
<link rel="stylesheet" href='{{ "css/github-style.css" | absURL }}' /> <link rel="stylesheet" href='{{ "css/github-style.css" | absURL }}' />
<link rel="stylesheet" href='{{ "css/light.css" | absURL }}' /> <link rel="stylesheet" href='{{ "css/light.css" | absURL }}' />
<link rel="stylesheet" href='{{ "css/dark.css" | absURL }}' /> <link rel="stylesheet" href='{{ "css/dark.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>
<link rel="icon" type="image/x-icon" href='{{ "images/favicon.ico" | absURL }}'> <link rel="icon" type="image/x-icon" href='{{ "images/favicon.ico" | absURL }}'>
<meta name="theme-color" content="#1e2327"> <meta name="theme-color" content="#1e2327">

51
static/css/syntax.css Normal file
View File

@@ -0,0 +1,51 @@
code .k {
color: var(--color-prettylights-syntax-keyword);
}
code .nf {
color: var(--color-prettylights-syntax-entity);
}
code .o {
color: var(--color-prettylights-syntax-constant);
}
code .bp {
color: var(--color-prettylights-syntax-constant);
}
code .ow {
color: var(--color-prettylights-syntax-constant);
}
code .s2 {
color: var(--color-prettylights-syntax-string);
}
code .nb {
color: var(--color-prettylights-syntax-entity);
}
code .kn {
color: var(--color-prettylights-syntax-keyword);
}
code .nc {
color: var(--color-prettylights-syntax-variable);
}
code .c1 {
color: var(--color-prettylights-syntax-comment);
}
code .kr {
color: var(--color-prettylights-syntax-keyword);
}
code .s1 {
color: var(--color-prettylights-syntax-string);
}
code .s {
color: var(--color-prettylights-syntax-string);
}