Browse Source

Merge remote-tracking branch 'spf13/master'

Brendan Abolivier 3 years ago
parent
commit
04d7bb204c
No account linked to committer's email

+ 54
- 1
README.md View File

12
 - [Installation](#installation)
12
 - [Installation](#installation)
13
 - [Options](#options)
13
 - [Options](#options)
14
   - [Sidebar menu](#sidebar-menu)
14
   - [Sidebar menu](#sidebar-menu)
15
+  - [Sidebar description](#sidebar-description)
15
   - [Sticky sidebar content](#sticky-sidebar-content)
16
   - [Sticky sidebar content](#sticky-sidebar-content)
16
   - [Themes](#themes)
17
   - [Themes](#themes)
17
   - [Reverse layout](#reverse-layout)
18
   - [Reverse layout](#reverse-layout)
25
 
26
 
26
 ## Installation
27
 ## Installation
27
 
28
 
29
+### Quick Start
30
+
31
+To give you a running start this installation puts a fully configured [starter repo](https://github.com/forestryio/hyde-hugo-starter) into your Git account and sets it up in a content manager / CMS. 
32
+
33
+_[Forestry](https://forestry.io) Starter-Kit:_
34
+
35
+[![Import this project into Forestry](https://assets.forestry.io/import-to-forestry.svg)](https://app.forestry.io/quick-start?repo=forestryio/hyde-hugo-starter&provider=github&engine=hugo&version=0.49)
36
+
37
+### Standard Installation
38
+
28
 To install Hyde as your default theme, first install this repository in the `themes/` directory:
39
 To install Hyde as your default theme, first install this repository in the `themes/` directory:
29
 
40
 
30
     $ cd themes/
41
     $ cd themes/
44
 
55
 
45
 ### Sidebar menu
56
 ### Sidebar menu
46
 
57
 
47
-Create a list of nav links in the sidebar by assigning "menu=main" in the front matter.
58
+Create a list of nav links in the sidebar by assigning "menu=main" in the front matter, like so:
59
+
60
+**TOML**
61
+```toml
62
+theme = "hyde"
63
+
64
+[Menus]
65
+  main = [
66
+      {Name = "Github", URL = "https://github.com/username/"},
67
+      {Name = "LinkedIn", URL = "https://www.linkedin.com/in/username/"}
68
+  ]
69
+```
70
+
71
+**YAML**
72
+```yaml
73
+theme: "hyde"
74
+
75
+Menus:
76
+  main:
77
+    - Name: "Github"
78
+      URL: "https://github.com/username/"
79
+    - Name: "LinkedIn"
80
+      URL: "https://www.linkedin.com/in/username/"
81
+```
82
+
83
+### Sidebar description
84
+Customise the describe of your page using `description`, like so:
85
+
86
+**TOML**
87
+```toml
88
+theme = "hyde"
89
+
90
+[params]
91
+  description = "Your custom description"
92
+```
93
+
94
+**YAML**
95
+```yaml
96
+theme: "hyde"
97
+
98
+params:
99
+  description = "Your custom description"
100
+```
48
 
101
 
49
 
102
 
50
 ### Sticky sidebar content
103
 ### Sticky sidebar content

+ 3
- 0
go.mod View File

1
+module github.com/spf13/hyde
2
+
3
+go 1.12

+ 6
- 4
layouts/_default/baseof.html View File

1
 {{ partial "head.html" . }}
1
 {{ partial "head.html" . }}
2
   <body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
2
   <body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
3
   {{ partial "sidebar.html" . }}
3
   {{ partial "sidebar.html" . }}
4
-    <div class="content container">
4
+    <main class="content container">
5
     {{ block "main" . -}}{{- end }}
5
     {{ block "main" . -}}{{- end }}
6
-    </div>
6
+    </main>
7
 
7
 
8
-    {{ template "_internal/google_analytics_async.html" . }}
8
+    {{ if not .Site.IsServer }}
9
+      {{ template "_internal/google_analytics_async.html" . }}
10
+    {{ end }}
9
   </body>
11
   </body>
10
-</html>
12
+</html>

+ 2
- 2
layouts/_default/list.html View File

2
 <ul class="posts">
2
 <ul class="posts">
3
 {{ range .Data.Pages -}}
3
 {{ range .Data.Pages -}}
4
   <li>
4
   <li>
5
-    <span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span>
5
+    <span><a href="{{ .Permalink }}">{{ .Title }}</a> <time class="pull-right post-list" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Mon, Jan 2, 2006" }}</time></span>
6
   </li>
6
   </li>
7
 {{- end }}
7
 {{- end }}
8
 </ul>
8
 </ul>
9
-{{- end }}
9
+{{- end }}

+ 1
- 1
layouts/_default/single.html View File

1
 {{ define "main" -}}
1
 {{ define "main" -}}
2
 <div class="post">
2
 <div class="post">
3
   <h1>{{ .Title }}</h1>
3
   <h1>{{ .Title }}</h1>
4
-  <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
4
+  <time datetime={{ .Date.Format "2006-01-02T15:04:05Z0700" }} class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
5
   {{ .Content }}
5
   {{ .Content }}
6
 </div>
6
 </div>
7
 
7
 

+ 3
- 3
layouts/index.html View File

1
 {{ define "main" -}}
1
 {{ define "main" -}}
2
 <div class="posts">
2
 <div class="posts">
3
-{{ range .Data.Pages -}}
4
-<div class="post">
3
+{{ range .Site.RegularPages -}}
4
+<article class="post">
5
   <h1 class="post-title">
5
   <h1 class="post-title">
6
     <a href="{{ .Permalink }}">{{ .Title }}</a>
6
     <a href="{{ .Permalink }}">{{ .Title }}</a>
7
   </h1>
7
   </h1>
12
     <a href="{{ .RelPermalink }}">Read More…</a>
12
     <a href="{{ .RelPermalink }}">Read More…</a>
13
   </div>
13
   </div>
14
   {{ end }}
14
   {{ end }}
15
-</div>
15
+</article>
16
 {{- end }}
16
 {{- end }}
17
 </div>
17
 </div>
18
 {{- end }}
18
 {{- end }}

+ 10
- 7
layouts/partials/head.html View File

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
2
 <html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
3
 <head>
3
 <head>
4
-  <link href="http://gmpg.org/xfn/11" rel="profile">
4
+  <link href="https://gmpg.org/xfn/11" rel="profile">
5
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
5
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
-  {{ .Hugo.Generator }}
6
+  {{ hugo.Generator }}
7
 
7
 
8
   <!-- Enable responsiveness on mobile devices-->
8
   <!-- Enable responsiveness on mobile devices-->
9
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
9
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
10
 
10
 
11
   {{ if .IsHome -}}
11
   {{ if .IsHome -}}
12
   <title>{{ .Site.Title }}</title>
12
   <title>{{ .Site.Title }}</title>
13
-  <meta name="description" content="{{ .Site.Params.description }}" />
14
   <meta property="og:title" content="{{ .Site.Title }}" />
13
   <meta property="og:title" content="{{ .Site.Title }}" />
15
   <meta property="og:description" content="{{ .Site.Params.description }}" />
14
   <meta property="og:description" content="{{ .Site.Params.description }}" />
16
   <meta property="og:type" content="website" />
15
   <meta property="og:type" content="website" />
17
   {{- else -}}
16
   {{- else -}}
18
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
17
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
19
-  <meta name="description" content="{{ .Description }}" />
20
   <meta property="og:title" content="{{ .Title }} &middot; {{ .Site.Title }}" />
18
   <meta property="og:title" content="{{ .Title }} &middot; {{ .Site.Title }}" />
21
   <meta property="og:description" content="{{ .Description }}" />
19
   <meta property="og:description" content="{{ .Description }}" />
22
   <meta property="og:type" content="article" />
20
   <meta property="og:type" content="article" />
29
   <meta name="identifier-url" content="{{ .Site.BaseURL }}" />
27
   <meta name="identifier-url" content="{{ .Site.BaseURL }}" />
30
   <meta property="og:site_name" content="{{ .Site.Title }}"/>
28
   <meta property="og:site_name" content="{{ .Site.Title }}"/>
31
   <meta property="og:url" content="{{ .Permalink }}"/>
29
   <meta property="og:url" content="{{ .Permalink }}"/>
30
+  <meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
32
 
31
 
33
   <!-- CSS -->
32
   <!-- CSS -->
34
   <link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
33
   <link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
42
   <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
41
   <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
43
   <link rel="shortcut icon" type="image/png" href="/favicon.png">
42
   <link rel="shortcut icon" type="image/png" href="/favicon.png">
44
 
43
 
45
-  <!-- RSS -->
46
-  <link href="{{ .Site.RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
44
+  <!-- RSS etc -->
45
+  {{ range .AlternativeOutputFormats -}}
46
+    {{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
47
+  {{ end -}}
48
+
49
+  {{ partial "hook_head_end.html" . }}
47
 </head>
50
 </head>

+ 16
- 14
layouts/partials/sidebar.html View File

1
-<div class="sidebar">
1
+<aside class="sidebar">
2
   <div class="container sidebar-sticky">
2
   <div class="container sidebar-sticky">
3
     <div class="sidebar-about">
3
     <div class="sidebar-about">
4
 	    <a href="{{ .Site.BaseURL }}"><img src="{{ .Site.BaseURL }}images/logo.png" alt="{{ .Site.Title }} logo" /></a>
4
 	    <a href="{{ .Site.BaseURL }}"><img src="{{ .Site.BaseURL }}images/logo.png" alt="{{ .Site.Title }} logo" /></a>
7
       </p>
7
       </p>
8
     </div>
8
     </div>
9
 
9
 
10
-    <ul class="sidebar-nav">
11
-      <li><i class="fas fa-home"></i> <a href="{{ .Site.BaseURL }}">Home</a> </li>
12
-      <li><i class="fas fa-rss-square"></i> <a href="{{ .Site.RSSLink }}">RSS Feed</a></li>
13
-      <li><i class="fab fa-twitter-square"></i> <a href="https://twitter.com/{{ .Site.Params.twitter }}">{{ .Site.Params.twitter }}</a></li>
14
-      <li><i class="fab fa-mastodon"></i> <a href="https://{{ .Site.Params.mastodon.instance }}/@{{ .Site.Params.mastodon.username }}">{{ .Site.Params.mastodon.username }}</a></li>
15
-      <li><i class="fab fa-git"></i> <a href="{{ .Site.Params.git.url }}">{{ .Site.Params.git.username }}</a></li>
16
-      <li><i class="fas fa-envelope"></i> <a href=mailto:{{ .Site.Params.email }}>{{ .Site.Params.email }}</a></li>
17
-      <li><i class="fas fa-key"></i> <a href="https://{{ .Site.Params.keyserver }}/pks/lookup?op=get&search=0x{{ replace .Site.Params.pgp " " "" }}">{{ .Site.Params.pgp }}</a></li>
18
-      {{ range .Site.Menus.main -}}
19
-        <li><a href="{{.URL}}"> {{ .Name }} </a></li>
20
-      {{- end }}
21
-    </ul>
10
+    <nav>
11
+        <ul class="sidebar-nav">
12
+          <li><i class="fas fa-home"></i> <a href="{{ .Site.BaseURL }}">Home</a> </li>
13
+          <li><i class="fas fa-rss-square"></i> <a href="{{ .Site.RSSLink }}">RSS Feed</a></li>
14
+          <li><i class="fab fa-twitter-square"></i> <a href="https://twitter.com/{{ .Site.Params.twitter }}">{{ .Site.Params.twitter }}</a></li>
15
+          <li><i class="fab fa-mastodon"></i> <a href="https://{{ .Site.Params.mastodon.instance }}/@{{ .Site.Params.mastodon.username }}">{{ .Site.Params.mastodon.username }}</a></li>
16
+          <li><i class="fab fa-git"></i> <a href="{{ .Site.Params.git.url }}">{{ .Site.Params.git.username }}</a></li>
17
+          <li><i class="fas fa-envelope"></i> <a href=mailto:{{ .Site.Params.email }}>{{ .Site.Params.email }}</a></li>
18
+          <li><i class="fas fa-key"></i> <a href="https://{{ .Site.Params.keyserver }}/pks/lookup?op=get&search=0x{{ replace .Site.Params.pgp " " "" }}">{{ .Site.Params.pgp }}</a></li>
19
+          {{ range .Site.Menus.main -}}
20
+            <li><a href="{{.URL}}"> {{ .Name }} </a></li>
21
+          {{- end }}
22
+        </ul>
23
+    </nav>
22
 
24
 
23
     <p><a href="https://creativecommons.org/licenses/{{ .Site.Params.creativeCommons }}/4.0/"><img src="{{ .Site.BaseURL}}images/cc/{{ .Site.Params.creativeCommons }}.png" alt="CC {{ .Site.Params.creativeCommons }}" class="inline" /></a> {{ .Site.Params.author }}</p>
25
     <p><a href="https://creativecommons.org/licenses/{{ .Site.Params.creativeCommons }}/4.0/"><img src="{{ .Site.BaseURL}}images/cc/{{ .Site.Params.creativeCommons }}.png" alt="CC {{ .Site.Params.creativeCommons }}" class="inline" /></a> {{ .Site.Params.author }}</p>
24
 
26
 
25
     <p class="small">Built with <a href="https://gohugo.io/">Hugo</a>, powered by <a href="https://git.abolivier.bzh/babolivier/hyde">Hyde</a></p>
27
     <p class="small">Built with <a href="https://gohugo.io/">Hugo</a>, powered by <a href="https://git.abolivier.bzh/babolivier/hyde">Hyde</a></p>
26
   </div>
28
   </div>
27
-</div>
29
+</aside>

+ 5
- 4
static/css/poole.css View File

63
   background-color: #fff;
63
   background-color: #fff;
64
   -webkit-text-size-adjust: 100%;
64
   -webkit-text-size-adjust: 100%;
65
       -ms-text-size-adjust: 100%;
65
       -ms-text-size-adjust: 100%;
66
+          text-size-adjust: 100%;
66
 }
67
 }
67
 
68
 
68
 /* No `:visited` state is required by default (browsers will use `a`) */
69
 /* No `:visited` state is required by default (browsers will use `a`) */
69
 a {
70
 a {
70
-  color: #268bd2;
71
+  color: #227bb9;
71
   text-decoration: none;
72
   text-decoration: none;
72
 }
73
 }
73
 /* `:focus` is linked to `:hover` for basic accessibility */
74
 /* `:focus` is linked to `:hover` for basic accessibility */
152
 code {
153
 code {
153
   padding: .25em .5em;
154
   padding: .25em .5em;
154
   font-size: 85%;
155
   font-size: 85%;
155
-  color: #bf616a;
156
+  color: #b3555e;
156
   background-color: #f9f9f9;
157
   background-color: #f9f9f9;
157
   border-radius: 3px;
158
   border-radius: 3px;
158
 }
159
 }
325
   display: block;
326
   display: block;
326
   margin-top: -.5rem;
327
   margin-top: -.5rem;
327
   margin-bottom: 1rem;
328
   margin-bottom: 1rem;
328
-  color: #9a9a9a;
329
+  color: #757575;
329
 }
330
 }
330
 
331
 
331
 /* Related posts */
332
 /* Related posts */
346
   color: #999;
347
   color: #999;
347
 }
348
 }
348
 .related-posts li a:hover {
349
 .related-posts li a:hover {
349
-  color: #268bd2;
350
+  color: #227bb9;
350
   text-decoration: none;
351
   text-decoration: none;
351
 }
352
 }
352
 .related-posts li a:hover small {
353
 .related-posts li a:hover small {

+ 1
- 1
theme.toml View File

4
 description = "An elegant open source and mobile first theme"
4
 description = "An elegant open source and mobile first theme"
5
 tags = ["blog", "company"]
5
 tags = ["blog", "company"]
6
 features = ["blog", "themes", "disqus"]
6
 features = ["blog", "themes", "disqus"]
7
-min_version = 0.21
7
+min_version = 0.53
8
 
8
 
9
 [author]
9
 [author]
10
     name = "spf13"
10
     name = "spf13"