diff --git a/themes/default/LICENSE b/themes/default/LICENSE new file mode 100644 index 0000000..0b87547 --- /dev/null +++ b/themes/default/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Linlin Yan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/themes/default/README.md b/themes/default/README.md new file mode 100644 index 0000000..42c15dd --- /dev/null +++ b/themes/default/README.md @@ -0,0 +1,31 @@ +# Simple Style Hugo Theme + +My simple style hugo theme, based on [this webpage template](https://yanlinlin82.github.io/webpage-templates/simple-style/index.html) + +Online demo of this theme: [simple-style-demo](https://yanlinlin82.github.io/simple-style-demo/) + +## License + +This project is licensed under [MIT, copyright (c) 2019 Linlin Yan](https://github.com/yanlinlin82/simple-style/blob/master/LICENSE), expect for the following code: + +* `layout/partial/github-cornor.html` is based on source code from , which is licensed under [MIT, copyright (c) 2016 Tim Holman](https://github.com/tholman/github-corners/blob/master/license.md). + +## Supported Parameters + +In `config.toml` + +``` +[params] +subtitle = "Sub title of the site" +favicon = "//logo.ico" +githubUrl = "https://github.com///" +referrer = "always" +author = "..." +description = "..." +keywords = "..." +googleSiteVerification = "" +search = "..." # baidu, google, bing, duckduckgo +dateFormat = "Mon Jan 2 15:04:05 MST 2006" # see: https://gohugo.io/functions/format/#gos-layout-string +externalLinkIcon = true +externalLinkNewWindow = true +``` diff --git a/themes/default/images/screenshot.png b/themes/default/images/screenshot.png new file mode 100644 index 0000000..32f72c2 Binary files /dev/null and b/themes/default/images/screenshot.png differ diff --git a/themes/default/images/tn.png b/themes/default/images/tn.png new file mode 100644 index 0000000..8cb78c1 Binary files /dev/null and b/themes/default/images/tn.png differ diff --git a/themes/default/layouts/_default/baseof.html b/themes/default/layouts/_default/baseof.html new file mode 100644 index 0000000..1df2849 --- /dev/null +++ b/themes/default/layouts/_default/baseof.html @@ -0,0 +1,67 @@ + + + + + + +{{ partial "html-meta.html" . -}} + {{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }} + +{{ with .Site.Params.favicon -}} + +{{ end -}} + + +
+ {{ with .Site.Menus.parent -}} + + {{ end -}} +
+

{{ .Site.Title }}

+ {{- if .Site.Params.subtitle }}

{{ .Site.Params.subtitle }}

{{- end }} +
+ +
+
+ {{ block "main" . }}{{- end }} +
+
+
+
+ {{- if .Site.Copyright -}} + {{ .Site.Copyright | markdownify }} + {{- else -}} + © 2019 Linlin Yan. CC-BY-4.0 + {{- end -}} + {{- if .Site.Params.ShowThemeInfo -}} +

Powered by Hugo with Simple-Style + {{- end -}} +

+
+
+ {{ template "_internal/google_analytics.html" . -}} + {{ partial "github-corner.html" . -}} + {{ partial "external-links.html" . -}} + + diff --git a/themes/default/layouts/_default/list.html b/themes/default/layouts/_default/list.html new file mode 100644 index 0000000..9c1f74f --- /dev/null +++ b/themes/default/layouts/_default/list.html @@ -0,0 +1,14 @@ +{{ define "main" -}} +
+

{{ .Title }}

+
+
    + {{ range .Paginator.Pages -}} +
  • + +
    {{ .Title }}
    +
  • + {{ end -}} +
+{{ template "_internal/pagination.html" . -}} +{{ end -}} diff --git a/themes/default/layouts/_default/section.html b/themes/default/layouts/_default/section.html new file mode 100644 index 0000000..70d261c --- /dev/null +++ b/themes/default/layouts/_default/section.html @@ -0,0 +1,17 @@ +{{ define "main" -}} +
+

{{ .Title }}

+
+
+ {{ .Content -}} +
+
    + {{ range .Paginator.Pages -}} +
  • + +
    {{ .Title }}
    +
  • + {{ end -}} +
+ +{{ end }} diff --git a/themes/default/layouts/_default/single.html b/themes/default/layouts/_default/single.html new file mode 100644 index 0000000..4772ced --- /dev/null +++ b/themes/default/layouts/_default/single.html @@ -0,0 +1,41 @@ +{{ define "main" -}} +
+
+

{{ .Title }}

+ {{ with .Params.Subtitle -}} +

{{ . }}

+ {{ end -}} +
+ {{ if .Date -}} +
{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}
+ {{ end -}} + {{ $taxo := "tags" -}} + {{ if .Param $taxo -}} +
+ {{ $data := newScratch }} + {{ range .Param $taxo -}} + {{ $name := . -}} + {{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | anchorize)) }} + {{ $data.Set "url" .Permalink }} + {{ end }} + {{ with $.Site.GetPage (printf "/%s/%s" $taxo ($name | urlize)) }} + {{ $data.Set "url" .Permalink }} + {{ end }} + + {{ end -}} +
+ {{ end -}} +
+ {{ if ne .TableOfContents "" }} + {{ .TableOfContents }} +
+ {{ .Content -}} +
+ {{ else }} +
+ {{ .Content -}} +
+ {{ end }} +
+
+{{ end -}} diff --git a/themes/default/layouts/index.html b/themes/default/layouts/index.html new file mode 100644 index 0000000..320109a --- /dev/null +++ b/themes/default/layouts/index.html @@ -0,0 +1,14 @@ +{{ define "main" -}} +
+ {{ .Content -}} +
+
    + {{ range (.Paginate ( where .Site.RegularPages "Type" "in" site.Params.mainSections )).Pages -}} +
  • + +
    {{ .Title }}
    +
  • + {{ end -}} +
+{{ template "_internal/pagination.html" . -}} +{{ end -}} diff --git a/themes/default/layouts/partials/external-links.html b/themes/default/layouts/partials/external-links.html new file mode 100644 index 0000000..8a23add --- /dev/null +++ b/themes/default/layouts/partials/external-links.html @@ -0,0 +1,18 @@ +{{ if or .Site.Params.ExternalLinkIcon .Site.Params.ExternalLinkNewWindow -}} + +{{ end -}} diff --git a/themes/default/layouts/partials/github-corner.html b/themes/default/layouts/partials/github-corner.html new file mode 100644 index 0000000..ecee1ca --- /dev/null +++ b/themes/default/layouts/partials/github-corner.html @@ -0,0 +1,3 @@ +{{ with .Site.Params.githubURL -}} + +{{- end -}} diff --git a/themes/default/layouts/partials/html-meta.html b/themes/default/layouts/partials/html-meta.html new file mode 100644 index 0000000..3810136 --- /dev/null +++ b/themes/default/layouts/partials/html-meta.html @@ -0,0 +1,15 @@ +{{ with .Site.Params.googleSiteVerification -}} + +{{ end -}} +{{ with .Site.Params.author -}} + +{{ end -}} +{{ with .Site.Params.description -}} + +{{ end -}} +{{ with .Site.Params.keywords -}} + +{{ end -}} +{{ with .Site.Params.referrer -}} + +{{ end -}} diff --git a/themes/default/layouts/partials/search.html b/themes/default/layouts/partials/search.html new file mode 100644 index 0000000..9f56b98 --- /dev/null +++ b/themes/default/layouts/partials/search.html @@ -0,0 +1,21 @@ + diff --git a/themes/default/layouts/shortcodes/permalink.html b/themes/default/layouts/shortcodes/permalink.html new file mode 100644 index 0000000..f34aae9 --- /dev/null +++ b/themes/default/layouts/shortcodes/permalink.html @@ -0,0 +1 @@ +{{with .Get 0}}{{end}} diff --git a/themes/default/static/css/main.css b/themes/default/static/css/main.css new file mode 100644 index 0000000..d302c5a --- /dev/null +++ b/themes/default/static/css/main.css @@ -0,0 +1,373 @@ +body { + font-family: Arial, "Microsoft YaHei", Sans-Serif; + font-size: 16px; +} + +div, +table { + margin: 0; +} + +body { + margin: 0 auto; + max-width: 960px; + padding: 10px; + color: #333; +} + +p { + margin: 0.5em 0; +} + +header { + margin: 0; + padding: 0; + border-bottom: 1px solid #999; + line-height: 1 +} + +header h1 { + font-size: 160%; +} + +header h2 { + font-size: 120%; +} + +footer { + margin: 0; + padding: 10px 0; + border-top: 1px solid #999; + line-height: 1; + text-align: center +} + +article h1 { + line-height: 2; + font-size: 160% +} + +article h2 { + line-height: 1.6; + font-size: 120% +} + +article h3, +article h4, +article h5, +article h6 { + line-height: 1.2; + font-size: 100% +} + +img { + margin: 10px auto; + width: 90%; + max-width: 600px; + padding: 0 10px; + height: auto; + display: block +} + +hr { + border: none; + border-top: 1px dashed #999; + color: #fff; + background-color: #fff; + height: 1px +} + +a { + color: #00f; + word-wrap: break-word +} + +a:visited { + color: #009 +} + +a:hover { + color: #f80; +} + +header a, +header a:visited, +footer a, +footer a:visited, +h1 a, +h1 a:visited, +h2 a, +h2 a:visited, +h3 a, +h3 a:visited, +h4 a, +h4 a:visited, +h5 a, +h5 a:visited, +h6 a, +h6 a:visited { + text-decoration: none; + color: #333; +} + +header a:hover, +footer a:hover, +h1 a:hover, +h2 a:hover, +h3 a:hover, +h4 a:hover, +h5 a:hover, +h6 a:hover { + text-decoration: none; + color: #f80; +} + +a.external { + background-image: url("/images/external-link-icon.svg"); + background-position: center right; + background-repeat: no-repeat; + padding-right: 13px; +} + +header nav { + padding: 10px 0; + text-align: right; +} + +header nav a { + padding-left: 15px; +} + +table { + border-collapse: collapse; + font-size: .8em; + margin: 10px auto +} + +th, +td { + border: 1px solid gray; + padding: 2px 5px +} + +code { + border: 1px dotted #999; + background-color: #f0f0f0; + padding: 1px 2px; + line-height: 200%; + word-wrap: break-word +} + +pre { + border: 1px solid #999; + background-color: #f0f0f0; + padding: 5px; + overflow: auto +} + +pre code { + border: 0; + background: none; + padding: 0; + font-size: .8em +} + +blockquote { + margin: 0; + padding: 0 0 0 20px; + border-left: solid 5px #ccc; + font-size: .8em +} + +ul.pagination { + list-style-type: none; + text-align: center +} + +li.page-item { + display: inline; + padding-right: 15px +} + +svg.permalink { + color: #666; + fill: currentColor +} + +svg:hover.permalink { + color: #f00; + fill: currentColor +} + +.title { + padding: 0; + margin: 20px 0 +} + +.meta, +.content { + padding: 0; + margin: 10px 0 +} + +.tag { + display: inline-block; + margin-right: 10px; +} + +nav#TableOfContents { + float: right; + width: 200px; + overflow: auto; + margin: 0; + padding: 0 10px; + vertical-align: top; +} + +nav#TableOfContents:before { + content: 'Content'; + font-weight: bold; +} + +nav#TableOfContents:lang(*-Hans)::before { + content: '目录'; + font-weight: bold; +} + +nav#TableOfContents ul { + margin: 0; + padding-inline-start: 24px; +} + +.content-with-toc { + width: calc(100% - 220px); + margin: 0; +} + +@media (max-width:500px) { + nav#TableOfContents { + float: none; + width: 100%; + } + + .content-with-toc { + width: 100%; + } +} + +.title h1, +.title h2 { + padding: 0 +} + +.meta div { + padding: 0 +} + +.content h1 { + padding: 0; + margin: 25px 0 0 +} + +.content h2 { + padding: 0; + margin: 20px 0 0 +} + +.content h3 { + padding: 0; + margin: 20px 0 0 +} + +.content h4 { + padding: 0; + margin: 15px 0 0 +} + +.content h5 { + padding: 0; + margin: 10px 0 0 +} + +.content h6 { + padding: 0; + margin: 10px 0 0 +} + +.content p { + padding: 0; + margin: 10px 0 +} + +div.search2 { + position: fixed; + right: -30px; + max-width: 300px; + overflow: auto; + top: 1px; + width: 300px; + bottom: 100px +} + +div.search { + display: inline-block; + margin-bottom: -12px; +} + +form.search { + width: 125px; + margin-left: 15px; +} +form.search input[type=text] { + padding: 5px 30px 5px 5px; + border: 1px solid #999; + float: left; + width: 80px; +} +form.search input[type=text]:focus { + border: 1px solid #333; + float: left; + width: 80px; +} +form.search button { + float: left; + width: 30px; + padding: 5px; + border: none; + background: transparent; + cursor: pointer; + margin-left: -30px; +} +form.search .fa-search::before { + content: "\1F50D"; + font-style: normal; + color: #999; +} +form.search button:hover { + color: #333; +} + +.article-list li { + margin-bottom: 0.5em; +} + +.article-list li .article-date, +.article-list li .article-title { + display: inline-block; +} + +.article-list li .article-date:after { + content: ' - '; +} + +@media (max-width:500px) { + + .article-list li .article-date, + .article-date li .article-title { + display: block; + } + + .article-list li .article-date:after { + content: ''; + } +} \ No newline at end of file diff --git a/themes/default/static/images/external-link-icon.svg b/themes/default/static/images/external-link-icon.svg new file mode 100644 index 0000000..de5c461 --- /dev/null +++ b/themes/default/static/images/external-link-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/themes/default/theme.toml b/themes/default/theme.toml new file mode 100644 index 0000000..e2d29ca --- /dev/null +++ b/themes/default/theme.toml @@ -0,0 +1,12 @@ +name = "Simple Style" +license = "MIT" +licenselink = "https://github.com/yanlinlin82/simple-style/blob/master/LICENSE" +description = "A simple style huho theme by Linlin Yan." +homepage = "https://github.com/yanlinlin82/simple-style/" +tags = [ "simple", "blog", "white" ] +features = [ "simple", "white" ] +min_version = "0.61.0" + +[author] +name = "Linlin Yan" +homepage = "http://yanlinlin.cn/"