Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 7064682

Browse files
ammarionhooyr
authored andcommitted
Add sidebar to site
1 parent ef9c945 commit 7064682

File tree

27 files changed

+131
-83
lines changed

27 files changed

+131
-83
lines changed

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
// Disable formatting so Go templates can be properly indented.
3+
"html.format.enable": false
4+
}

site/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# Sail's site
22

3-
This directory contains source code to [sail.dev](https://sail.dev).
3+
This directory contains source code to [sail.dev](https://sail.dev).
4+
5+
## Hugo Menus
6+
7+
Couldn't figure out the point to Hugo menus, or how to get them work in a
8+
non-janky way, so we just use the [Site.Pages](https://gohugo.io/variables/site/)
9+
variable instead.

site/config.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
theme = "sail"
22
languageCode = "en-us"
33
defaultContentLanguage="en"
4-
title = "My New Hugo Site"
4+
title = "My New Hugo Site"
5+
6+
sectionPagesMenu = "main"

site/content/docs/commands/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
+++
2+
title="Commands"
3+
+++

site/content/docs/commands/edit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="edit"
44
browser_title="Sail - Commands - edit"
55
+++

site/content/docs/commands/ls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="ls"
44
browser_title="Sail - Commands - ls"
55
+++

site/content/docs/commands/run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="run"
44
browser_title="Sail - Commands - run"
55
+++

site/content/docs/commands/shell.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="shell"
44
browser_title="Sail - Commands - shell"
55
+++

site/content/docs/concepts/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
+++
2+
title="Concepts"
3+
+++

site/content/docs/concepts/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Configuration"
44
browser_title="Sail - Docs - Configuration"
55
+++

site/content/docs/concepts/docker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
+++
3-
type="doc"
3+
type="docs"
44
title="Docker"
55
browser_title="Sail - Docs - Docker"
66
draft=true

site/content/docs/concepts/hats.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Hats"
44
browser_title="Sail - Docs - Hats"
55
+++

site/content/docs/concepts/immutability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Immutability"
44
browser_title="Sail - Docs - Immutability"
55
draft=true

site/content/docs/concepts/permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Permissions"
44
browser_title="Sail - Docs - Permissions"
55
+++

site/content/docs/concepts/projects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Projects"
44
browser_title="Sail - Docs - Projects"
55
+++

site/content/docs/concepts/shares.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Shares"
44
browser_title="Sail - Docs - Shares"
55
+++

site/content/docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
+++
2-
type="doc"
3-
title="Getting Started"
2+
type="docs"
3+
title="Introduction"
44
browser_title="Sail - Docs - Getting Started"
55
+++
66
Welcome to the the Sail docs.

site/content/docs/workflow/_index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
+++
2+
title="Workflow"
3+
+++

site/content/docs/workflow/fuzzy_run.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
type="doc"
2+
type="docs"
33
title="Fuzzy Run"
44
browser_title="Sail - Docs - Fuzzy Run"
55
+++

site/themes/sail/assets/doc.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// This file supercedes main.scss with documentation-specific styling.
22

3+
@import "vars.scss";
4+
35
body {
46
max-width: 100em;
57
}
@@ -30,3 +32,21 @@ nav > ul, nav > ul > li > ul {
3032
#TableOfContents > li {
3133
padding-inline-start: 25px;
3234
}
35+
36+
aside > dl > ul {
37+
list-style-type: none;
38+
padding-inline-start: 0;
39+
}
40+
41+
.active {
42+
background-color: darken($background-color, 20%);
43+
}
44+
45+
.content-box > .content {
46+
min-height: 30em;
47+
}
48+
49+
// Pagination stuff
50+
.pagination > .next {
51+
margin-left: auto;
52+
}

site/themes/sail/assets/main.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
// Colors: https://color.adobe.com/create/color-wheel/
2-
$primary-color: #3364dd;
3-
$font-color: black;
4-
$background-color: desaturate(#fcfaf3, 80%);
5-
6-
@import url('https://fonts.googleapis.com/css?family=Roboto');
7-
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono');
1+
@import "vars.scss";
82

93
body {
104
margin: 0 auto;

site/themes/sail/assets/vars.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Colors: https://color.adobe.com/create/color-wheel/
2+
$primary-color: #3364dd;
3+
$font-color: black;
4+
$background-color: white;
5+
6+
@import url('https://fonts.googleapis.com/css?family=Roboto');
7+
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono');

site/themes/sail/layouts/doc/single.html

Lines changed: 0 additions & 60 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{{ define "main" }}
2+
3+
{{ $style := resources.Get "doc.scss" | resources.ToCSS | resources.Minify | resources.Fingerprint }}
4+
<link rel="stylesheet" href="{{ $style.Permalink }}">
5+
6+
<div class="container-fluid">
7+
<div class="row">
8+
<div class="col-lg">
9+
<h1>Sail Documentation</h1>
10+
</div>
11+
</div>
12+
<hr />
13+
<div class="row">
14+
<div class="col-lg-2 d-xs-none">
15+
{{ partial "sidebar.html" . }}
16+
</div>
17+
18+
<div class="col-lg content-box">
19+
<div class="content">
20+
<h1> {{ .Title }} </h1>
21+
{{ .Content }}
22+
23+
</div>
24+
<hr />
25+
<!-- <div class="row pagination">
26+
{{if .PrevInSection }}
27+
<a href="{{ .PrevInSection.Permalink }}" class="last btn btn-outline-primary btn-lg">Last Page: {{ .PrevInSection.Title }}</a>
28+
{{end}}
29+
{{if .NextInSection }}
30+
<a href="{{ .NextInSection.Permalink }}" class="next btn btn-outline-primary btn-lg">Next Page: {{ .NextInSection.Title }}</a>
31+
{{end}}
32+
</div> -->
33+
</div>
34+
<!-- <div class="col-lg-3 d-xs-none">
35+
<span class="text-muted"><strong> In This Page </strong></span>
36+
{{ .TableOfContents }}
37+
</div> -->
38+
</div>
39+
</div>
40+
{{ end }}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!-- sidebar start -->
2+
<aside>
3+
<dl>
4+
{{ $currentPage := . }}
5+
6+
{{ $docPages := where ( where $.Site.Pages "Type" "docs") "Kind" "page" }}
7+
8+
{{ $sections := slice "" "Concepts" "Commands" "Workflow" }}
9+
10+
{{ range $sections }}
11+
{{ $section := . }}
12+
{{ $sectionPages := where $docPages "Parent.Title" $section}}
13+
14+
<dt> {{ $section }}</dt>
15+
<ul>
16+
{{ range $sectionPages }}
17+
<!-- Match "{{ $section }}" -> {{ .Kind}}<>{{ .Type }}<>{{ .Parent.Title }}<>"{{ .Title }}" -->
18+
<li class="{{ if eq $currentPage.URL .URL }}active{{ end}}">
19+
<a href="{{ .URL }}">{{ .Title }}</a>
20+
</li>
21+
{{ end }}
22+
</ul>
23+
{{ end }}
24+
25+
</dl>
26+
</aside>

0 commit comments

Comments
 (0)