Просмотр исходного кода

Merge remote-tracking branch 'spf13/master'

Brendan Abolivier 3 лет назад
Родитель
Сommit
04d7bb204c
Аккаунт пользователя с таким Email не найден

+ 54
- 1
README.md Просмотреть файл

@@ -12,6 +12,7 @@ It pairs a prominent sidebar with uncomplicated content.
12 12
 - [Installation](#installation)
13 13
 - [Options](#options)
14 14
   - [Sidebar menu](#sidebar-menu)
15
+  - [Sidebar description](#sidebar-description)
15 16
   - [Sticky sidebar content](#sticky-sidebar-content)
16 17
   - [Themes](#themes)
17 18
   - [Reverse layout](#reverse-layout)
@@ -25,6 +26,16 @@ It pairs a prominent sidebar with uncomplicated content.
25 26
 
26 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 39
 To install Hyde as your default theme, first install this repository in the `themes/` directory:
29 40
 
30 41
     $ cd themes/
@@ -44,7 +55,49 @@ Hyde includes some customizable options, typically applied via classes on the `<
44 55
 
45 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 103
 ### Sticky sidebar content

+ 3
- 0
go.mod Просмотреть файл

@@ -0,0 +1,3 @@
1
+module github.com/spf13/hyde
2
+
3
+go 1.12

+ 6
- 4
layouts/_default/baseof.html Просмотреть файл

@@ -1,10 +1,12 @@
1 1
 {{ partial "head.html" . }}
2 2
   <body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
3 3
   {{ partial "sidebar.html" . }}
4
-    <div class="content container">
4
+    <main class="content container">
5 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 11
   </body>
10
-</html>
12
+</html>

+ 2
- 2
layouts/_default/list.html Просмотреть файл

@@ -2,8 +2,8 @@
2 2
 <ul class="posts">
3 3
 {{ range .Data.Pages -}}
4 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 6
   </li>
7 7
 {{- end }}
8 8
 </ul>
9
-{{- end }}
9
+{{- end }}

+ 1
- 1
layouts/_default/single.html Просмотреть файл

@@ -1,7 +1,7 @@
1 1
 {{ define "main" -}}
2 2
 <div class="post">
3 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 5
   {{ .Content }}
6 6
 </div>
7 7
 

+ 3
- 3
layouts/index.html Просмотреть файл

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

+ 10
- 7
layouts/partials/head.html Просмотреть файл

@@ -1,22 +1,20 @@
1 1
 <!DOCTYPE html>
2 2
 <html xmlns="http://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
3 3
 <head>
4
-  <link href="http://gmpg.org/xfn/11" rel="profile">
4
+  <link href="https://gmpg.org/xfn/11" rel="profile">
5 5
   <meta http-equiv="content-type" content="text/html; charset=utf-8">
6
-  {{ .Hugo.Generator }}
6
+  {{ hugo.Generator }}
7 7
 
8 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 11
   {{ if .IsHome -}}
12 12
   <title>{{ .Site.Title }}</title>
13
-  <meta name="description" content="{{ .Site.Params.description }}" />
14 13
   <meta property="og:title" content="{{ .Site.Title }}" />
15 14
   <meta property="og:description" content="{{ .Site.Params.description }}" />
16 15
   <meta property="og:type" content="website" />
17 16
   {{- else -}}
18 17
   <title>{{ .Title }} &middot; {{ .Site.Title }}</title>
19
-  <meta name="description" content="{{ .Description }}" />
20 18
   <meta property="og:title" content="{{ .Title }} &middot; {{ .Site.Title }}" />
21 19
   <meta property="og:description" content="{{ .Description }}" />
22 20
   <meta property="og:type" content="article" />
@@ -29,6 +27,7 @@
29 27
   <meta name="identifier-url" content="{{ .Site.BaseURL }}" />
30 28
   <meta property="og:site_name" content="{{ .Site.Title }}"/>
31 29
   <meta property="og:url" content="{{ .Permalink }}"/>
30
+  <meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />
32 31
 
33 32
   <!-- CSS -->
34 33
   <link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
@@ -42,6 +41,10 @@
42 41
   <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
43 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 50
 </head>

+ 16
- 14
layouts/partials/sidebar.html Просмотреть файл

@@ -1,4 +1,4 @@
1
-<div class="sidebar">
1
+<aside class="sidebar">
2 2
   <div class="container sidebar-sticky">
3 3
     <div class="sidebar-about">
4 4
 	    <a href="{{ .Site.BaseURL }}"><img src="{{ .Site.BaseURL }}images/logo.png" alt="{{ .Site.Title }} logo" /></a>
@@ -7,21 +7,23 @@
7 7
       </p>
8 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 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 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 28
   </div>
27
-</div>
29
+</aside>

+ 5
- 4
static/css/poole.css Просмотреть файл

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

+ 1
- 1
theme.toml Просмотреть файл

@@ -4,7 +4,7 @@ licenselink = "https://github.com/spf13/hyde/blob/master/LICENSE.md"
4 4
 description = "An elegant open source and mobile first theme"
5 5
 tags = ["blog", "company"]
6 6
 features = ["blog", "themes", "disqus"]
7
-min_version = 0.21
7
+min_version = 0.53
8 8
 
9 9
 [author]
10 10
     name = "spf13"