Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-shpak committed Sep 5, 2018
0 parents commit 43974d0
Show file tree
Hide file tree
Showing 20 changed files with 427 additions and 0 deletions.
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2018 Alex Shpak

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.
2 changes: 2 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
+++
+++
39 changes: 39 additions & 0 deletions assets/markdown.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@import 'variables';

$block-border-radius: 0.15rem;

.markdown {
a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
}

code {
font-family: 'Roboto Mono', monospace;
}

p code {
padding: $padding-1 $padding-4;
background: $gray-100;
border-radius: $block-border-radius;
}

pre {
padding: $padding-16;
background: $gray-100;
border-radius: $block-border-radius;
font-size: $font-size-14;
}

blockquote {
border-left: $padding-1*2 solid $gray-300;
margin: 0;
padding: $padding-1 $padding-16;

:first-child { margin-top: 0; }
:last-child { margin-bottom: 0; }
}
}
55 changes: 55 additions & 0 deletions assets/pure-extension.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@import 'variables';

html, button, input, select, textarea, .pure-g [class *= "pure-u"] {
font-family: "Open Sans", "Roboto", sans-serif;
font-weight: 300;

}

.pure-g {
[class *= "pure-u"] {
box-sizing: border-box;
}
}

.pure-u {
flex-grow: 1;
width: 0;
}

.pure-menu-list ul ul {
// left padding for nested sections
padding-left: $padding-16;
}

.pure-menu-root {
// vertical space between root sections
> li {
padding-bottom: $padding-16;
}

// font weight only for root sections
> li > .section {
font-weight: 600;
}
}

.pure-menu-link, .pure-menu-heading {
color: $gray-800;
padding: $padding-4 $padding-16;
text-transform: capitalize;
}

.pure-menu-link {
&:hover, &.active {
background: none;
}

&:hover {
color: $gray-600;
}

&.active {
color: #1F37E6;
}
}
97 changes: 97 additions & 0 deletions assets/styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
@import 'variables';
@import 'pure-extension';
@import 'markdown';

html {
font-size: $font-size-base;
}

html, body {
width: 100%;
min-height: 100%;
min-width: $body-min-width;
}

body {
color: $gray-800;
line-height: $body-line-height;
}

.book-content {
max-width: $content-max-width;
margin: 0 auto;
}

.book-page {
padding: 0 $size-48;
}

.book-brand {
padding: 0 $padding-16;
font-weight: 300;

a {
color: $gray-800;
text-decoration: none;
}
}

.book-nav {
width: $nav-menu-width;
flex-grow: 0;

nav {
position: fixed;
height: 100%;
width: $nav-menu-width;

overflow-x: hidden;
overflow-y: auto;

font-size: $font-size-14;
background: $gray-100;
padding-left: $padding-16;
}
}

.book-toc {
flex-grow: 0;
width: $toc-menu-width;
font-size: $font-size-12;

nav {
position: fixed;
height: 100%;
width: $toc-menu-width;

overflow-x: hidden;
overflow-y: auto;

> ul {
margin: $size-48 0;
padding: 0 $padding-16;
border-left: $padding-1 solid $gray-200;
}
}

ul {
padding-left: $padding-4;
list-style: none;
}

a {
text-decoration: none;
line-height: 1.25;
padding: $padding-4 0;
display: block;

img {
max-height: $font-size-16;
}
}
}

// Print styles
@media print {

}
36 changes: 36 additions & 0 deletions assets/variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
$padding-1: 1px; //minimal
$padding-4: .25rem;
$padding-8: .5rem;
$padding-16: 1rem;

$font-size-base: 16px;
$font-size-12: .75rem;
$font-size-14: .875rem;
$font-size-16: 1rem;

$size-48: 3rem;
$size-56: 3.5rem;
$size-72: 4.5rem;

// Grayscale
$white: #fff;
$gray-100: #f8f9fa;
$gray-200: #e9ecef;
$gray-300: #dee2e6;
$gray-400: #ced4da;
$gray-500: #adb5bd;
$gray-600: #868e96;
$gray-700: #495057;
$gray-800: #343a40;
$gray-900: #212529;
$black: #000;

// $color-link:
// $color-visited-link:


$body-line-height: 1.75;
$body-min-width: 25rem;
$content-max-width: 64rem;
$nav-menu-width: 18rem;
$toc-menu-width: 14rem;
8 changes: 8 additions & 0 deletions layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

{{ define "main"}}
<main id="main">
<div>
<h1 id="title"><a href="{{ "/docs" }}">Go Home</a></h1>
</div>
</main>
{{ end }}
25 changes: 25 additions & 0 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
{{ partial "book-html-head" . }}
<title>{{ .Site.Title }}</title>
</head>

<body>
<div class="pure-g">
<div class="pure-u book-nav">
{{ partial "book-nav" . }}
</div>
<div class="pure-u book-content">
<div class="pure-g">
<div class="pure-u book-page markdown">
{{ block "main" . }}{{ end }}
</div>
<div class="pure-u book-toc">
{{ partial "book-toc" . }}
</div>
</div>
</div>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions layouts/docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ define "title" }}
{{ .Title }} &ndash; {{ .Site.Title }}
{{ end }}

{{ define "main" }}
<div>{{ .Content }}</div>
{{ end }}
7 changes: 7 additions & 0 deletions layouts/docs/list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{ define "title" }}
{{ .Title }} &ndash; {{ .Site.Title }}
{{ end }}

{{ define "main" }}
<div>{{ .Content }}</div>
{{ end }}
3 changes: 3 additions & 0 deletions layouts/docs/single.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ define "main" }}
<div>{{ .Content }}</div>
{{ end }}
3 changes: 3 additions & 0 deletions layouts/partials/book-brand.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<h2 class="book-brand">
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</h2>
9 changes: 9 additions & 0 deletions layouts/partials/book-html-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,600" rel="stylesheet">
<link href="/css/pure-min.css" rel="stylesheet">
<link href="/css/grids-responsive-min.css" rel="stylesheet">

{{ $styles := resources.Get "styles.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink }}">
61 changes: 61 additions & 0 deletions layouts/partials/book-nav.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{{ $bookSection := default "docs" .Site.Params.BookSection }}
{{ if eq $bookSection "*" }}
{{ .Scratch.Set "BookSections" .Site.Sections }}
{{ else }}
{{ $bookSections := where .Site.Sections "Section" $bookSection }}
{{ .Scratch.Set "BookSections" $bookSections }}

{{ if eq (len $bookSections) 1 }}
{{ $singleSection := index $bookSections 0 }}
{{ .Scratch.Set "BookSections" $singleSection.Sections }}
{{ end }}

{{ end }}

<nav role="navigation" class="pure-menu">
{{ partial "book-brand" . }}

<ul class="pure-menu-list pure-menu-root">
{{ range .Scratch.Get "BookSections" }}
{{ template "book-section" (dict "Section" . "CurrentPage" $.Permalink) }}
{{ end }}
</ul>
</nav>

<!-- Single section of menu (recursive) -->
{{ define "book-section" }}
<li class="pure-menu-item">
{{ template "book-heading" .Section }}
<ul class="pure-menu-list">
{{ range .Section.Sections }}
{{ template "book-section" (dict "Section" . "CurrentPage" $.CurrentPage) }}
{{ end }}
{{ range .Section.Pages }}
<li class="pure-menu-item">
<a href="{{ .RelPermalink }}" class="pure-menu-link {{ if eq $.CurrentPage .Permalink }}active{{ end }}">
{{ default .Title (.File | humanize | title) }}
</a>
</li>
{{ end }}
</ul>
</li>
{{ end }}

<!-- Menu Heading -->
{{ define "book-heading" }}

{{ $sections := split (trim .Dir "/") "/" }}
{{ $title := index ($sections | last 1) 0 | humanize | title }}
{{ $title := default .Title $title }}

{{ if .Content }}
<a href="{{ .RelPermalink }}" class="pure-menu-link {{ if .IsSection }}section{{ end }}">
{{- $title -}}
</a>
{{ else }}
<span class="pure-menu-heading {{ if .IsSection }}section{{ end }}">
{{- $title -}}
</span>
{{ end }}

{{ end }}
1 change: 1 addition & 0 deletions layouts/partials/book-toc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ .Page.TableOfContents }}
Loading

0 comments on commit 43974d0

Please sign in to comment.