Skip to content

Commit

Permalink
readd hyde theme not as submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
Hessu committed Feb 5, 2020
1 parent 606ee73 commit 980f10b
Show file tree
Hide file tree
Showing 24 changed files with 1,110 additions and 1 deletion.
1 change: 0 additions & 1 deletion themes/hyde
Submodule hyde deleted from a56b6f
7 changes: 7 additions & 0 deletions themes/hyde/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

## Version 1.0

- Due to the switch to the base template feature the minimum required version of Hugo changed to v0.21
- Support for Google Analytics have been added
- Hugo's internal Disqus template replaced the custom one of this theme. The Disqus shortname now has to be defined outsite the `[params]` blog
9 changes: 9 additions & 0 deletions themes/hyde/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Released under MIT License

Copyright (c) 2013 Mark Otto.

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.
219 changes: 219 additions & 0 deletions themes/hyde/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
# Hyde

Hyde is a brazen two-column [hugo](https://gohugo.io) theme based on the [Jekyll](https://jekyllrb.com) theme of the same name.
It pairs a prominent sidebar with uncomplicated content.

![Hyde screenshot](https://f.cloud.github.com/assets/98681/1831228/42af6c6a-7384-11e3-98fb-e0b923ee0468.png)


## Contents

- [Installation](#installation)
- [Options](#options)
- [Sidebar menu](#sidebar-menu)
- [Sidebar description](#sidebar-description)
- [Sticky sidebar content](#sticky-sidebar-content)
- [Themes](#themes)
- [Reverse layout](#reverse-layout)
- [Disqus](#disqus)
- [Google Analytics](#google-analytics)
- [Author](#author)
- [Ported by](#ported-by)
- [License](#license)


## Installation

### Quick Start

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.

_[Forestry](https://forestry.io) Starter-Kit:_

[![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)

### Standard Installation

To install Hyde as your default theme, first install this repository in the `themes/` directory:

$ cd themes/
$ git clone https://github.com/spf13/hyde.git

Second, specify `hyde` as your default theme in the `config.toml` file. Just add the line

theme = "hyde"

at the top of the file.


## Options

Hyde includes some customizable options, typically applied via classes on the `<body>` element.


### Sidebar menu

Create a list of nav links in the sidebar by assigning "menu=main" in the front matter, like so:

**TOML**
```toml
theme = "hyde"

[Menus]
main = [
{Name = "Github", URL = "https://github.com/username/"},
{Name = "LinkedIn", URL = "https://www.linkedin.com/in/username/"}
]
```

**YAML**
```yaml
theme: "hyde"

Menus:
main:
- Name: "Github"
URL: "https://github.com/username/"
- Name: "LinkedIn"
URL: "https://www.linkedin.com/in/username/"
```
### Sidebar description
Customise the describe of your page using `description`, like so:

**TOML**
```toml
theme = "hyde"
[params]
description = "Your custom description"
```

**YAML**
```yaml
theme: "hyde"
params:
description = "Your custom description"
```


### Sticky sidebar content

By default Hyde ships with a sidebar that affixes it's content to the bottom of the sidebar. You can optionally disabled this by removing the `.sidebar-sticky` class from the sidebar's `.container`. Sidebar content will then normally flow from top to bottom.

```html
<!-- Default sidebar -->
<div class="sidebar">
<div class="container sidebar-sticky">
...
</div>
</div>
<!-- Modified sidebar -->
<div class="sidebar">
<div class="container">
...
</div>
</div>
```


### Themes

Hyde ships with eight optional themes based on the [base16 color scheme](https://github.com/chriskempson/base16). Apply a theme to change the color scheme (mostly applies to sidebar and links).

![Hyde in red](https://f.cloud.github.com/assets/98681/1831229/42b0b354-7384-11e3-8462-31b8df193fe5.png)

There are eight themes available at this time.

![Hyde theme classes](https://f.cloud.github.com/assets/98681/1817044/e5b0ec06-6f68-11e3-83d7-acd1942797a1.png)

To use a theme, add the `themeColor` variable under `params`, like so:

**TOML**
```toml
theme = "hyde"
[params]
themeColor = "theme-base-09"
```

**YAML**
```yaml
theme: "hyde"
params:
themeColor: "theme-base-09"
```

To create your own theme, look to the Themes section of [included CSS file](https://github.com/poole/hyde/blob/master/public/css/hyde.css). Copy any existing theme (they're only a few lines of CSS), rename it, and change the provided colors.

### Reverse layout

![Hyde with reverse layout](https://f.cloud.github.com/assets/98681/1831230/42b0d3ac-7384-11e3-8d54-2065afd03f9e.png)

To reverse page orientation, add the `layoutReverse` variable under `params`, like so:

**TOML**
```toml
theme = "hyde"
[params]
layoutReverse = true
```

**YAML**
```yaml
theme: "hyde"
params:
layoutReverse: true
```

### Disqus

You can optionally enable a comment system powered by Disqus for the posts. Simply add the variable `disqusShortname` to your config file.

**TOML**
```toml
disqusShortname = "spf13"
```

**YAML**
```yaml
disqusShortname : spf13
```

> **Note:** Previous version 1.0 the Disqus shortname had to be defined inside the `[params]` block.


## Google Analytics

Google Analytics can be enabled by assigning your tracking code to the `googleAnalytics` variable in the config file:

**TOML**
```toml
googleAnalytics = "Your tracking code"
```

**YAML**
```yaml
googleAnalytics: Your tracking code
```

## Author
**Mark Otto**
- <https://github.com/mdo>
- <https://twitter.com/mdo>

## Ported By
**Steve Francia**
- <https://github.com/spf13>
- <https://twitter.com/spf13>

## License

Open sourced under the [MIT license](LICENSE.md).

<3
6 changes: 6 additions & 0 deletions themes/hyde/archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
Description = ""
Tags = ["Development", "golang"]
Categories = ["Development", "GoLang"]
menu = "main"
+++
3 changes: 3 additions & 0 deletions themes/hyde/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/spf13/hyde

go 1.12
Binary file added themes/hyde/images/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added themes/hyde/images/tn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions themes/hyde/layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ define "main" -}}
<h1>404: Page not found</h1>
<p class="lead">Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. <a href="{{ .Site.BaseURL }}">Head back home</a> to try finding it again.</p>
{{- end }}
10 changes: 10 additions & 0 deletions themes/hyde/layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{ partial "head.html" . }}
<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">
{{ partial "sidebar.html" . }}
<main class="content container">
{{ block "main" . -}}{{- end }}
</main>

{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>
9 changes: 9 additions & 0 deletions themes/hyde/layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{ define "main" -}}
<ul class="posts">
{{ range .Data.Pages -}}
<li>
<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>
</li>
{{- end }}
</ul>
{{- end }}
12 changes: 12 additions & 0 deletions themes/hyde/layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{ define "main" -}}
<div class="post">
<h1>{{ .Title }}</h1>
<time datetime={{ .Date.Format "2006-01-02T15:04:05Z0700" }} class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
{{ .Content }}
</div>

{{ if .Site.DisqusShortname -}}
<h2>Comments</h2>
{{ template "_internal/disqus.html" . }}
{{- end }}
{{- end }}
18 changes: 18 additions & 0 deletions themes/hyde/layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ define "main" -}}
<div class="posts">
{{ range .Site.RegularPages -}}
<article class="post">
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title }}</a>
</h1>
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}" class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</time>
{{ .Summary }}
{{ if .Truncated }}
<div class="read-more-link">
<a href="{{ .RelPermalink }}">Read More…</a>
</div>
{{ end }}
</article>
{{- end }}
</div>
{{- end }}
35 changes: 35 additions & 0 deletions themes/hyde/layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml"{{with .Site.LanguageCode}} xml:lang="{{.}}" lang="{{.}}"{{end}}>
<head>
<link href="https://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
{{ hugo.Generator }}

<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">

{{ if .IsHome -}}
<title>{{ .Site.Title }}</title>
{{- else -}}
<title>{{ .Title }} &middot; {{ .Site.Title }}</title>
{{- end }}
<meta name="description" content="{{if .IsHome}}{{ $.Site.Params.description }}{{else}}{{.Description}}{{end}}" />

<!-- CSS -->
<link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/print.css" media="print">
<link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/poole.css">
<link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/syntax.css">
<link type="text/css" rel="stylesheet" href="{{ .Site.BaseURL }}css/hyde.css">
{{ partial "head_fonts.html" . }}

<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/favicon.png">

<!-- RSS etc -->
{{ range .AlternativeOutputFormats -}}
{{ printf `<link href="%s" rel="%s" type="%s" title="%s" />` .Permalink .Rel .MediaType.Type $.Site.Title | safeHTML }}
{{ end -}}

{{ partial "hook_head_end.html" . }}
</head>
1 change: 1 addition & 0 deletions themes/hyde/layouts/partials/head_fonts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|PT+Sans:400,400i,700">
Empty file.
21 changes: 21 additions & 0 deletions themes/hyde/layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<aside class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<a href="{{ .Site.BaseURL }}"><h1>{{ .Site.Title }}</h1></a>
<p class="lead">
{{ with .Site.Params.description }} {{.}} {{ else }}An elegant open source and mobile first theme for <a href="https://hugo.spf13.com">hugo</a> made by <a href="https://twitter.com/mdo">@mdo</a>. Originally made for Jekyll.{{end}}
</p>
</div>

<nav>
<ul class="sidebar-nav">
<li><a href="{{ .Site.BaseURL }}">Home</a> </li>
{{ range .Site.Menus.main -}}
<li><a href="{{.URL}}"> {{ .Name }} </a></li>
{{- end }}
</ul>
</nav>

<p>{{ with .Site.Params.copyright }}{{.}}{{ else }}&copy; {{ now.Format "2006"}}. All rights reserved. {{end}}</p>
</div>
</aside>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 980f10b

Please sign in to comment.