starting the blog
This commit is contained in:
21
blog/themes/default/LICENSE
Normal file
21
blog/themes/default/LICENSE
Normal file
@@ -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.
|
||||
25
blog/themes/default/README.md
Normal file
25
blog/themes/default/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# 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/)
|
||||
|
||||
## Supported Parameters
|
||||
|
||||
In `config.toml`
|
||||
|
||||
```
|
||||
[params]
|
||||
subtitle = "Sub title of the site"
|
||||
favicon = "/<path-to-site-icon>/logo.ico"
|
||||
githubUrl = "https://github.com/<your-name>/<site-proj-name>/"
|
||||
referrer = "always"
|
||||
author = "..."
|
||||
description = "..."
|
||||
keywords = "..."
|
||||
googleSiteVerification = "<google-site-verification-code>"
|
||||
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
|
||||
```
|
||||
46
blog/themes/default/layouts/_default/baseof.html
Normal file
46
blog/themes/default/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
{{ partial "html-meta.html" . -}}
|
||||
<title>{{ if not .IsHome }}{{ .Title }} - {{ end }}{{ .Site.Title }}</title>
|
||||
{{ $css := resources.Get "style.css" }}
|
||||
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
|
||||
{{ with .Site.Params.favicon -}}
|
||||
<link rel="shortcut icon" href="{{ . }}" type="image/x-icon">
|
||||
{{ end -}}
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<meta name="description"
|
||||
content="{{ if .Params.description }}{{ .Params.description }}{{ else }}11sync.net blog{{ end }}"
|
||||
/>
|
||||
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
{{ with .Site.Menus.parent -}}
|
||||
<nav>
|
||||
{{ range . -}}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end -}}
|
||||
</nav>
|
||||
{{ end -}}
|
||||
<div>
|
||||
<h1><a href="/">{{ .Site.Title }}</a></h1>
|
||||
{{- if .Site.Params.subtitle }}<h2><a href="{{ .Site.BaseURL }}">{{ .Site.Params.subtitle }}</a></h2>{{- end }}
|
||||
</div>
|
||||
<nav>
|
||||
{{- range .Site.Menus.main -}}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{- end -}}
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
{{ block "main" . }}{{- end }}
|
||||
</main>
|
||||
<footer>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
14
blog/themes/default/layouts/_default/list.html
Normal file
14
blog/themes/default/layouts/_default/list.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ define "main" -}}
|
||||
<div>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</div>
|
||||
<ul class="article-list">
|
||||
{{ range .Paginator.Pages -}}
|
||||
<li class="article-item">
|
||||
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
|
||||
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{ template "_internal/pagination.html" . -}}
|
||||
{{ end -}}
|
||||
17
blog/themes/default/layouts/_default/section.html
Normal file
17
blog/themes/default/layouts/_default/section.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ define "main" -}}
|
||||
<div>
|
||||
<h1>{{ .Title }}</h1>
|
||||
</div>
|
||||
<div>
|
||||
{{ .Content -}}
|
||||
</div>
|
||||
<ul class="article-list">
|
||||
{{ range .Paginator.Pages -}}
|
||||
<li class="article-item">
|
||||
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
|
||||
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
</main>
|
||||
{{ end }}
|
||||
41
blog/themes/default/layouts/_default/single.html
Normal file
41
blog/themes/default/layouts/_default/single.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{{ define "main" -}}
|
||||
<article>
|
||||
<div class="title">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Params.Subtitle -}}
|
||||
<h2>{{ . }}</h2>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{ if .Date -}}
|
||||
<div class="meta">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
|
||||
{{ end -}}
|
||||
{{ $taxo := "tags" -}}
|
||||
{{ if .Param $taxo -}}
|
||||
<div class="meta">
|
||||
{{ $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 }}
|
||||
<div class="tag"><a href="{{ $data.Get "url" }}">#{{ $name }}</a></div>
|
||||
{{ end -}}
|
||||
</div>
|
||||
{{ end -}}
|
||||
<div class="artical-body">
|
||||
{{ if ne .TableOfContents "<nav id=\"TableOfContents\"></nav>" }}
|
||||
{{ .TableOfContents }}
|
||||
<div class="content-with-toc">
|
||||
{{ .Content -}}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="content">
|
||||
{{ .Content -}}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</article>
|
||||
{{ end -}}
|
||||
14
blog/themes/default/layouts/index.html
Normal file
14
blog/themes/default/layouts/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
{{ define "main" -}}
|
||||
<div>
|
||||
{{ .Content -}}
|
||||
</div>
|
||||
<ul class="article-list">
|
||||
{{ range (.Paginate ( where .Site.RegularPages "Type" "in" site.Params.mainSections )).Pages -}}
|
||||
<li class="article-item">
|
||||
<div class="article-date">{{ .Date.Format (.Site.Params.dateFormat | default "2006-01-02 15:04") }}</div>
|
||||
<div class="article-title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></div>
|
||||
</li>
|
||||
{{ end -}}
|
||||
</ul>
|
||||
{{ template "_internal/pagination.html" . -}}
|
||||
{{ end -}}
|
||||
15
blog/themes/default/layouts/partials/html-meta.html
Normal file
15
blog/themes/default/layouts/partials/html-meta.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ with .Site.Params.googleSiteVerification -}}
|
||||
<meta name="google-site-verification" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.author -}}
|
||||
<meta name="author" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.description -}}
|
||||
<meta name="description" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.keywords -}}
|
||||
<meta name="keywords" content="{{ . }}">
|
||||
{{ end -}}
|
||||
{{ with .Site.Params.referrer -}}
|
||||
<meta name="referrer" content="{{ . }}">
|
||||
{{ end -}}
|
||||
1
blog/themes/default/layouts/shortcodes/permalink.html
Normal file
1
blog/themes/default/layouts/shortcodes/permalink.html
Normal file
@@ -0,0 +1 @@
|
||||
{{with .Get 0}}<a id="{{.}}" href="#{{.}}"><svg class="permalink" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"></path><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"></path></svg></a>{{end}}
|
||||
12
blog/themes/default/theme.toml
Normal file
12
blog/themes/default/theme.toml
Normal file
@@ -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/"
|
||||
Reference in New Issue
Block a user