Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Habdas committed Sep 16, 2016
0 parents commit 2dc53c2
Show file tree
Hide file tree
Showing 29 changed files with 687 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
node_modules/
20 changes: 20 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2016 Josh Habdas

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.
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# After Dark

A retro dark theme for [Hugo](https://gohugo.io/).

![Theme screenshot](https://cloud.githubusercontent.com/assets/440298/18599964/ae2ea6de-7c20-11e6-889c-db5ca4afef67.png)

> Simplicity is the ultimate sophistication<br>
> --- Leonardo da Vinci
## Features

- Dark theme intended for low-light reading
- Entire page served in a single HTTP request (including favicon)
- Grid layouts and more using [hack.css](hackcss.com)
- Responsive typography optimized for mobile, tablet and desktop
- [Block Templates](https://gohugo.io/templates/blocks/) for foolproof layouts
- Google Analytics tracking using the [internal async template](https://gohugo.io/extras/analytics#configuring-google-analytics)
- Rich post byline including word count and reading time
- Extensible [taxonomy terms template](https://gohugo.io/templates/terms)
- Related posts feature guides users to similar content
- Configurable [menu system](https://gohugo.io/extras/menus/) for global site navigation
- Simple list pagination with page indicators
- Custom archetypes, meta descriptions and rel meta for SEO control
- Default 404 page with engaging MP4 background video
- Full site keyboard accessibility
- No JavaScript for predictable use on terminal-based browsers

## Getting started

From your Hugo site directory, run:

```shell
(cd themes; git clone [email protected]:comfusion/after-dark.git)
hugo serve --theme=after-dark
```

Copy the custom archetypes to your site:

```shell
cp themes/after-dark/archetypes/* archetypes
```

Include the following in your site's `config.toml`:

```toml
baseurl = "https://c74ce35e.ngrok.io" # Controls base URL
languageCode = "en-US" # Controls html lang attribute
title = "After Dark" # Homepage title and page title suffix
paginate = 5 # Number of posts to show before paginating

enableRobotsTXT = true # Suggested, enable robots.txt file
googleAnalytics = "" # Optional, add tracking Id for analytics
SectionPagesMenu = "main" # Enable menu system for lazy bloggers

[params]
description = "" # Suggested, controls homepage description meta
author = "" # Optional, controls author name display on posts
show_menu = false # Optional, set false to disable menu entirely
powered_by = true # Optional, set false to disable theme credits
```

Configure menu in `config.toml` if desired:

```toml
[menu]
[[menu.main]]
name = "Home"
weight = 0
identifier = "home"
url = "/"
[[menu.main]]
name = "Posts"
weight = 1
identifier = "post"
url = "/post/"
```

Add pages to the menu from page frontmatter:

```toml
menu = "main"
weight = 3
```

## Upgrading hack.css

The specific version of [`hack.css`](hackcss.com) used is _pinned_ in the `package.json` dependency manifest. To check for updates do an `npm i` and run `npm run ncu`.

If an update is available consider taking the automatic update, but keep the version pinned in the manifest. Once the new `hack` dependency version is pulled down to the `node_modules` directory, copy the contents of `hack.css` and `dark.css` into the `critical-vendor.css.html` file.

Once the vendor file is updated pop open your favorite dev tools and test the changes by previewing your site on mobile, tablet and desktop at different display resolutions and orientations. Make any tweaks necessary to the `hack.css` style overrides indicated in `critical-custom.css.html`.

## Contributing

Issues have been disabled for this repo. If you feel passionate something needs to be changed please feel free to submit a pull with your suggested changes.
3 changes: 3 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
+++
description = ""
+++
6 changes: 6 additions & 0 deletions archetypes/post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
+++
description = ""
draft = true
categories = [""]
tags = ["", ""]
+++
Binary file added 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 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.
32 changes: 32 additions & 0 deletions layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<head>
{{ .Hugo.Generator }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }}</title>
<style media="screen">
body {
background-color: black;
margin: 0;
}
.container {
position: absolute;
height: 100%;
width: 100%;
overflow: hidden;
}
.container video {
min-width: 100%;
min-height: 100%;
}
</style>
</head>
<body>
<a href="{{ .Site.BaseURL }}">
<div class="container">
<video autoplay>
<source src="{{ .Site.BaseURL }}videos/after-dark_720p.mp4" type="video/mp4">
404. That's an error.
</video>
</div>
</a>
</body>
31 changes: 31 additions & 0 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ .Hugo.Generator }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{ with .Description }}
<meta name="description" content="{{ . }}">
{{ end }}
{{ if .RSSlink }}
<link href="{{ .RSSlink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
<link rel="canonical" href="{{ .Permalink }}">
{{ if (isset .Params "prev") }}
<link rel="prev" href="{{ .Params.prev }}">
{{ end }}
{{ if (isset .Params "next") }}
<link rel="next" href="{{ .Params.next }}">
{{ end }}
{{ partial "favicon" . }}
{{ partial "critical-vendor.css" }}
{{ partial "critical-custom.css" }}
</head>
<body class="hack dark main container">
<header>{{ block "header" . }}{{ end }}</header>
<main>{{ block "main" . }}{{ end }}</main>
<footer>{{ block "footer" . }}{{ end }}</footer>
{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>
16 changes: 16 additions & 0 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ define "header" }}
{{ partial "menu" . }}
{{ end }}
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ range .Data.Pages }}
<article>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p>{{ .Summary }}</p>
</article>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ partial "pagination" . }}
{{ partial "powered-by" . }}
{{ end }}
13 changes: 13 additions & 0 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{ define "title" -}}
{{ .Title }} &ndash; {{ .Site.Title }}
{{- end }}
{{ define "header" }}
{{ partial "menu" . }}
{{ end }}
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
{{ define "footer" }}
{{ partial "powered-by" . }}
{{ end }}
16 changes: 16 additions & 0 deletions layouts/_default/taxonomy.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{ define "header" }}
{{ partial "menu" . }}
{{ end }}
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ range .Data.Pages }}
<article>
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p>{{ .Summary }}</p>
</article>
{{ end }}
{{ end }}
{{ define "footer" }}
{{ partial "pagination" . }}
{{ partial "powered-by" . }}
{{ end }}
14 changes: 14 additions & 0 deletions layouts/_default/terms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{ define "header" }}
{{ partial "menu" . }}
{{ end }}
{{ define "main" }}
<h1>{{ .Title }}</h1>
<ul>
{{ range $key, $value := .Data.Terms }}
<li><a href="{{ $key | urlize }}">{{ $key }}</a> {{ len $value }}
{{ end }}
</ul>
{{ end }}
{{ define "footer" }}
{{ partial "powered-by" . }}
{{ end }}
34 changes: 34 additions & 0 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
<head>
{{ .Hugo.Generator }}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Site.Title }}</title>
<meta name="description" content="{{ .Site.Params.description }}">
{{ if .RSSlink }}
<link href="{{ .RSSlink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
<link rel="canonical" href="{{ .Permalink }}">
{{ partial "favicon" . }}
{{ partial "critical-vendor.css" . }}
{{ partial "critical-custom.css" . }}
</head>
<body class="hack dark main container">
<header>
{{ partial "menu" . }}
</header>
<main>
<h1>{{ .Title }}</h1>
{{ range (.Paginate (where .Data.Pages "Type" "post")).Pages }}
<h2><a href="{{ .Permalink }}">{{ .Title }}</a></h2>
<p>{{ .Summary }}</p>
{{ end }}
</main>
<footer>
{{ partial "pagination" . }}
{{ partial "powered-by" . }}
</footer>
{{ template "_internal/google_analytics_async.html" . }}
</body>
</html>
36 changes: 36 additions & 0 deletions layouts/partials/critical-custom.css.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<style media="screen">
@keyframes intro {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.powered-by {
color: rgba(95, 95, 95, 0.78);
}
main, footer {
animation: intro 0.3s both;
animation-delay: 0.15s;
}
/* hack.css overrides and enhancements */
.main {
padding: 20px 10px;
}
nav a.active {
background-color: #ff2e88;
color: #fff;
}
html {
font-size: 13px;
}
@media screen and (min-width: 768px) {
html {
font-size: 1em;
}
.container {
max-width: 50rem;
}
}
</style>
Loading

0 comments on commit 2dc53c2

Please sign in to comment.