Giter VIP home page Giter VIP logo

hyde's Introduction

Hyde

Hyde is a brazen two-column hugo theme based on the Jekyll theme of the same name. It pairs a prominent sidebar with uncomplicated content.

Hyde screenshot

Contents

Installation

Quick Start

To give you a running start this installation puts a fully configured starter repo into your Git account and sets it up in a content manager / CMS.

Forestry Starter-Kit:

Import this project into Forestry

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

theme = "hyde"

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

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

theme = "hyde"

[params]
  description = "Your custom description"

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.

<!-- 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. Apply a theme to change the color scheme (mostly applies to sidebar and links).

Hyde in red

There are eight themes available at this time.

Hyde theme classes

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

TOML

theme = "hyde"

[params]
  themeColor = "theme-base-09"

YAML

theme: "hyde"

params:
  themeColor: "theme-base-09"

To create your own theme, look to the Themes section of included CSS file. 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

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

TOML

theme = "hyde"

[params]
  layoutReverse = true

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

disqusShortname = "spf13"

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

googleAnalytics = "Your tracking code"

YAML

googleAnalytics: Your tracking code

Author

Mark Otto

Ported By

Steve Francia

License

Open sourced under the MIT license.

<3

hyde's People

Contributors

alexgs avatar anthonyfok avatar azylinski avatar bep avatar bigwhite avatar binarydahash avatar buckett avatar dato avatar digitalcraftsman avatar dineshba avatar eitzei avatar germoe avatar giodamelio avatar iepathos avatar jyee avatar kwiliarty avatar kwo avatar marc-jones avatar matt40k avatar melo avatar olsio avatar oshliaer avatar plippe avatar polybuildr avatar s7anley avatar sorin-davidoi avatar spf13 avatar z0li avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hyde's Issues

Partials head.html Needs CSS Type Attribute

With just the default installation I'm running into an issue in Chrome 65 where it reports that it won't load the CSS Pages because the MIME type defaults to "text/plain" and strict type checking is turned on by default in 65. To fix this I simply added the attribute 'type="text/css"' to the individual tags in head.html.

I've never worked extensively with submodules before so I'm not sure on how to submit a pull request on it, but I would gladly do so.

mobile support?

When opening on chrome on my android device, a very rudimentary version of the site appears.

Theme does not load on Netlify

Hi. I tried to change my theme from ananke to hyde on this docs : https://rsyncosx.netlify.app/. It loads perfectly on my Mac utilizing hugo server -D, but it does not load properly when building the docs on Netlify. I am not a Javascript developer, and I dont know what is missing in theme regarding Netlify. Switching back to theme ananke builds OK on Netlify.. I would prefer utilizing the hydetheme, seems as a better theme for docs..

MIME type issue in Chrome

I'm running a local setup and Chrome is refusing to render the CSS:

MIME problem

Is this an actual issue or something wrong with my setup? 🤔

add google analytics

Hi,
Thanks for the theme. I'm wondering if it's simple to add the google analytics feature to the theme. It seems from this post that you only need to add a one-liner to the template file.

I added that line to the single.html file right before </body> like below

  {{ template "_internal/google_analytics.html" . }}
</body>

And I added the tracking ID in the config.toml file. But my google analytics page doesn't seem to record any traffic. Any ideas?

Google Analytics Not Working/Better Example?

I wanted to turn on Google Analytics but it seems to be not working for me. I simply set up a new "Account" in GA then created a new "Property" that is pointed to the correct URL, including making sure it's https://.

At that point, I have a new "Tracking ID" which is of the form UA-XXXXXXXXX-X So as per the docs I put

googleAnalytics = "UA-XXXXXXXXX-X"

in the root config.toml file of my site. Nothing seems to happen though. I've tried viewing the site on other devices and it's not registering users.

Looking at the src, it appears you've tried to include a Google Analytics script by injecting it in 'layouts/_default/baseof.html' on line 8 where you are including '_internal/google_analytics_async.html' but I don't see that file anywhere in the hyde repo. Is it missing? Is it something that the user needs to implements in their root layouts folder?

Thanks for the help.

Chrome 44.0.2403.157 render issues at 1440x900

It looks like there is something about Chrome's handling of the responsive design that keeps the sidebar expanded for somewhat extreme widths. See the included screenshots. I was unable to reproduce this issue with Safari or Firefox.

screen shot 2015-09-01 at 7 48 13 pm

screen shot 2015-09-01 at 7 48 45 pm

Additional sidebar on right?

How can I add an additional sidebar to the right side of the screen? I don't want to reverse the layout, but have a second, slightly narrower sidebar for additional content. It should flow to the bottom or hide on mobile.

Thanks!

Not rendering equations properly

I'm using this theme for a small project and I'm trying to add equations to one of my posts.

Here's what I have:
$$
\pi_t = \frac{P_t - P_{t-12}}{P_{t-12}} = \frac{226.40 - 188.09}{188.09} = 0.2036
$$

However, when rendering, it does not show the equation properly.

I have tried with other themes and they work fine. My guess is that it has something to do with the /layout/partial/foot_custom.html file (which is missing).

Any help?

The touch icon

The icon filename is "touch-icon-144-precomposed.png", but referred to as "apple-touch-icon-144-precomposed.png" in head.html

Pagination

Go Hyde uses Poole, which has styling for pagination:

hyde/static/css/poole.css

Lines 354 to 359 in 62d338f

/*
* Pagination
*
* Super lightweight (HTML-wise) blog pagination. `span`s are provide for when
* there are no more previous or next posts to show.
*/

Poole utilizes this pagination for Jekyll:

https://github.com/poole/poole/blob/c0d52e1e/index.html#L22-L33

as does Jekyll Hyde:

https://github.com/poole/hyde/blob/7c7f7550/index.html#L22-L37

but Go Hyde doesnt utilize the pagination:

hyde/layouts/index.html

Lines 1 to 18 in 62d338f

{{ 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 }}

Is it possible to hide the date?

I've got some pages where the date doesn't matter (I don't even remember when I last updated them), is it possible to hide the dates?

Suggestion: SASS/SCSS ?

The theme is very nice.

it would be nice to make quick changes of this and that, and integrated your own stylesheet too, especially because hugo have all tools to process SASS/SCSS.

Accommodate custom CSS and JS

While exploring how best to apply a few style overrides I ran across your suggestion about modifying a theme's head partial.

https://discourse.gohugo.io/t/how-to-override-css-classes-with-hugo/3033/4

It seems that Hyde does not yet do this, but I've made a fork and tried it out, and it works very nicely, so I'll make a pull request shortly after creating this issue.

I've also made a special accommodation for the Google font handling. If I'm overriding the font then I want not only to add a new link element; I also want to disable the unused font link.

Thanks so much for the great theme!

.Site.Params

See: https://github.com/spf13/hyde/blob/master/layouts/_default/single.html#L12

and https://gohugo.io/functions/isset/

All site-level configuration keys are stored as lower case. Therefore, a myParam key-value set in your site configuration file needs to be accessed with {{if isset .Site.Params "myparam"}} and not with {{if isset .Site.Params "myParam"}}. Note that you can still access the same config key with .Site.Params.myParam or .Site.Params.myparam, for example, when using with.

so

(isset .Site.Params "disqusShortname") will always is FALSE

please rewrite is just lowercase, it works well

{{ if and (isset .Site.Params "disqusshortname") (ne .Site.Params.disqusShortname "") }}

Multiple ports of Hyde theme

I was looking through the different themes available for Hugo and settled on using Hyde but I see that there are multiple ports. There is this and @zyro's hyde-x and @enten's hyde-y. Now, I am all for variety but looking at the differences between each project, I am not seeing any major differences between the three. At least none that could not be implemented behind config flags.

Is there any reason why the difference projects can't be combined?

Adding a 404 page

This ported theme does not come with a 404 page by default like the original theme of Jekyll. Look here.

console error: "hljs is not defined" even when highlightjs is not set

in layouts/partials/highlight-js.html - I fixed by:

diff --git a/layouts/partials/highlight-js.html b/layouts/partials/highlight-js.html
index 87c347d..917399d 100644
--- a/layouts/partials/highlight-js.html
+++ b/layouts/partials/highlight-js.html
@@ -7,12 +7,12 @@
                 <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/languages/{{.}}.min.js"></script>
             {{ end }}
         {{ end }}
-    {{ end }}
     <script type="text/javascript">
         {{ with $.Scratch.Get "hl_languages" }}
         hljs.configure({languages: [{{(delimit . ", ")}}]});
         {{ end }}
         hljs.initHighlightingOnLoad();
     </script>
+    {{ end }}
     {{ $.Scratch.Delete "hl_languages" }}
 {{ end }}
(END)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.