Skip to content

Commit

Permalink
chore: merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
cgiacomi committed Oct 17, 2019
2 parents 470638b + edf7470 commit 7d9bec3
Show file tree
Hide file tree
Showing 12 changed files with 194 additions and 125 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ Clean and minimal personal blog and portfolio theme for Hugo.

[View demo](https://ezhil-hugo.netlify.com/)

![Screenshot](images/screenshot.png "Ezhil")
![Screenshot](images/screenshot-light.png "Ezhil light theme")
![Screenshot](images/screenshot-dark.png "Ezhil dark theme")

## Features

* Clean and minimal
* Dark mode (Auto detect from OS)
* Responsive
* Supports tags
* Social media links
Expand Down Expand Up @@ -65,6 +67,9 @@ paginate = 10
featherIconsCDN = true
# Specify favicon (icons/i.png maps to static/icons/i.png). No favicon if not defined.
favicon = "icons/myicon.png"
# Switch to dark mode or auto detect mode from OS (Optional).
# "dark" will set mode to dark and "auto" will switch to dark mode if OS is in dark mode.
mode = "dark" # "dark" or "auto"

# Main menu which appears below site header.
[[menu.main]]
Expand Down
8 changes: 2 additions & 6 deletions exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ pygmentscodefences = true
pygmentscodefencesguesssyntax = true

googleAnalytics = "UA-123-45"
disqusShortname = "localhost"
disqusShortname = "ezhil-demo"

[params]
subtitle = "Clean and minimal personal [blog theme for Hugo](https://github.com/vividvilla/ezhil)"
disableDisqusTypes = ["page"]
featherIconsCDN = true
mode = "auto" # "dark" or "auto"

[[menu.main]]
name = "Home"
Expand All @@ -43,11 +44,6 @@ name = "Github"
icon = "github"
url = "https://github.com/vividvilla/ezhil"

[[params.social]]
name = "Twitter"
icon = "twitter"
url = "https://twitter.com/gohugoio"

[[params.social]]
name = "RSS"
icon = "rss"
Expand Down
14 changes: 14 additions & 0 deletions exampleSite/content/posts/post-7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: "How to test dark mode?"
description: "Here is how you can setup dark mode for Ezhil and test on various OS like iOS, Android, macOS and Windows 10."
date: 2018-03-18T12:13:38+05:30
---

You can set dark mode as default by setting `params.mode` to `dark` in `config.toml` or set it to `auto` which will detect based on your OS and switch to dark mode. For more details [refer documentation](https://github.com/vividvilla/ezhil#configuration)

Here is how you can switch based on your OS

* [iOS](https://www.howtogeek.com/440078/how-to-enable-dark-mode-on-your-iphone-and-ipad/)
* [Android](https://9to5google.com/2018/12/17/android-dark-mode-theme-pie/)
* [macOS](https://support.apple.com/en-in/HT208976)
* [Windows 10](https://www.cnet.com/how-to/turn-on-the-dark-mode-in-windows-10/)
Binary file added images/screenshot-dark.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 images/screenshot-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h1 class="page-title">All articles</h1>
{{- if (in (.Site.Params.excludedTypes | default (slice "page")) .Type) -}}
{{- else -}}
<li class="post">
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}</span>
<a href="{{ .RelPermalink }}">{{.Title}}</a> <span class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</span>
</li>
{{- end -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/_default/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<div class="post-header">
<h1 class="title">{{ .Title }}</h1>
<div class="meta">Posted at &mdash; {{ dateFormat "Jan 2, 2006" .Date }}</div>
<div class="meta">Posted at &mdash; {{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
</div>

<div class="markdown">
Expand Down
4 changes: 2 additions & 2 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ partial "header.html" . }}
<body>
<div class="container wrapper">
{{ partial "head.html" . }}
{{ partial "head.html" . }}

<div class="recent-posts section">
<h2 class="section-header">
Expand All @@ -14,7 +14,7 @@ <h2 class="section-header">
{{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) }}
{{ range $paginator.Pages }}
<div class="post">
<div class="meta">{{ dateFormat "Jan 2, 2006" .Date }}</div>
<div class="meta">{{ dateFormat "Jan 2, 2006" .Date }}{{ if .Draft }} <span class="draft-label">DRAFT</span> {{ end }}</div>
<a class="title" href="{{ .RelPermalink }}">{{.Title}}</a> &mdash;
<span class="description">
{{ if isset .Params "description" }}
Expand Down
5 changes: 4 additions & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@

{{- template "_internal/opengraph.html" . -}}
{{- template "_internal/twitter_cards.html" . -}}
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,300italic,400italic|Raleway:500,100,300" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,300italic,400italic|Raleway:200,300" rel="stylesheet">

<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/normalize.css" />
<link rel="stylesheet" type="text/css" media="screen" href="{{ .Site.BaseURL }}css/main.css" />
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") }}
<link rel="stylesheet" type="text/css" href="{{ .Site.BaseURL }}css/dark.css" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} />
{{ end }}

{{- if and (isset .Site.Params "social") (isset .Site.Params "feathericonscdn") (eq .Site.Params.featherIconsCDN true) -}}
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
Expand Down
44 changes: 44 additions & 0 deletions static/css/dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
body {
color: #fff;
background-color: #000;
}

::-moz-selection {
background: #666;
text-shadow: none
}

::selection {
background: #666;
text-shadow: none
}

hr {
border-color: #333;
}

blockquote {
border-color: #fff;
}

h1,h2,h3,h4,h5,h6 {
color: #fff;
}

a,a:hover {
color: #fff;
text-decoration: underline;
}

a:hover {
opacity: 0.8;
}

.header nav,
.footer {
border-color: #333;
}

.highlight {
background-color: #333;
}
Loading

0 comments on commit 7d9bec3

Please sign in to comment.