Skip to content

Commit

Permalink
Add alexander-heimbuch/millidocs jekyll theme
Browse files Browse the repository at this point in the history
  • Loading branch information
benhylau committed Nov 29, 2019
1 parent e9f3616 commit 4232a07
Show file tree
Hide file tree
Showing 32 changed files with 1,463 additions and 0 deletions.
5 changes: 5 additions & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*.gem
.bundle
.sass-cache
_site
Gemfile.lock
8 changes: 8 additions & 0 deletions site/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: default
---

<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
2 changes: 2 additions & 0 deletions site/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source "https://rubygems.org"
gemspec
21 changes: 21 additions & 0 deletions site/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Alexander Heimbuch

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.
81 changes: 81 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Millidocs Theme

Simple documentation theme for Jekyll featuring [Milligram CSS framework](http://milligram.io/), [PrismJS syntax highlighter](http://prismjs.com/) and [LunrJS search](https://lunrjs.com/).

One of the core features is a full text client side search and full responsiveness. It has zero dependencies with other gems and should be easily build with Github.

## Installation

Add this line to your Jekyll site's `Gemfile`:

```ruby
gem "millidocs"
```

Adapt your Jekyll site config `_config.yml`:

```yaml
title: My Docs Page Title
description: MY description
url: "https://base/url/site"
theme: millidocs

markdown: kramdown
kramdown:
syntax_highlighter_opts:
disable : true

exclude:
- Gemfile
- Gemfile.lock
- README.md
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install millidocs
## Usage
### Github Pages
You can use this theme by simply adding `remote_theme: alexander-heimbuch/millidocs` to your `_config.yml` (Thanks to @kogli for the hint).

### Available Themes

This theme is made for _pages_ only and doesn't support _posts_ by default. So the only available layouts are `default` and `page`.

### Navigation

The navigation supports especially only one level. If you need deep nested structures you propably should use a larger documentation system like [GitBook](https://www.gitbook.com/).

Not every page by default is part of the navigation. If you want to add a page to the navigation you have to add the `navigation` attribute with a desired `index`:

```
---
layout: page
title: Navigation
navigation: 2
---
```

The navigation `index` is starting with 1 representing the first item.


## Development

To set up your environment to develop this theme, run `bundle install`.

Your theme is setup just like a normal Jekyll site! To test your theme, run `bundle exec jekyll serve` and open your browser at `http://localhost:4000`. This starts a Jekyll server using your theme. Add pages, documents, data, etc. like normal to test your theme's contents. As you make modifications to your theme and to your content, your site will regenerate and you should see the changes in the browser after a refresh, just like normal.

When your theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.

## License

The theme is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

18 changes: 18 additions & 0 deletions site/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
title: Millidocs Theme
description: Documentation for small projects
url: "https://github.com/alexander-heimbuch/millidocs" # the base hostname & protocol for your site, e.g. http://example.com

# Build settings
markdown: kramdown
kramdown:
syntax_highlighter_opts:
disable : true

exclude:
- Gemfile
- Gemfile.lock
- README.md

sass:
sass_dir: _sass
style: compressed
13 changes: 13 additions & 0 deletions site/_includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
<meta name="description" content="{{ page.excerpt | default: site.description | strip_html | normalize_whitespace | truncate: 160 | escape }}">

<link rel="icon" href="{{ "/assets/images/favicon.ico" | relative_url }}">
<link rel="canonical" href="{{ page.url | replace:'index.html','' | absolute_url }}">

{% include styles.html %}
</head>
14 changes: 14 additions & 0 deletions site/_includes/navigation.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% capture html %}
<ul class="navigation" id="navigation">
{% assign entries = site.pages | sort: "navigation" %}
{% for entry in entries %}
{% if entry.navigation %}
<li>
<a class="{% if page.url == entry.url entry.url %}active{% endif %}" href="{{ entry.url | relative_url }}">
{{ entry.title }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
{% endcapture %}{{ html | strip_newlines | replace:' ','' | replace:' ','' | replace:' ',' ' }}
6 changes: 6 additions & 0 deletions site/_includes/scripts.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script src="{{ "/assets/js/zepto.min.js" | relative_url }}"></script>
<script src="{{ "/assets/js/lunar.min.js" | relative_url }}"></script>
<script src="{{ "/assets/js/prism.min.js" | relative_url }}"></script>
<script src="{{ "/assets/js/database.js" | relative_url }}"></script>
<script src="{{ "/assets/js/search.js" | relative_url }}"></script>
<script src="{{ "/assets/js/mobile-navigation.js" | relative_url }}"></script>
1 change: 1 addition & 0 deletions site/_includes/search-results.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ul id="search-results" class="navigation"></ul>
3 changes: 3 additions & 0 deletions site/_includes/search.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="search">
<input type="text" class="search-input" id="search-input" placeholder="Type to search" />
</div>
11 changes: 11 additions & 0 deletions site/_includes/sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<sidebar class="sidebar" id="sidebar">
<div class="sidebar-mobile">
<img src="{{ "/assets/images/menu.svg" | relative_url }}" class="menu-icon" id="menu" />
<img src="{{ "/assets/images/close.svg" | relative_url }}" class="close-icon" id="close" />
</div>
{% include search.html %}
<div class="sidebar-main">
{% include navigation.html %}
{% include search-results.html %}
</div>
</sidebar>
1 change: 1 addition & 0 deletions site/_includes/styles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="stylesheet" href="{{ "/assets/css/docs.css" | relative_url }}">
15 changes: 15 additions & 0 deletions site/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">
{% include head.html %}
<body>
<div class="wrapper">
{% include sidebar.html %}
<main class="content">
<div class="inner">
{{ content }}
</div>
</main>
</div>
{% include scripts.html %}
</body>
</html>
5 changes: 5 additions & 0 deletions site/_layouts/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
layout: default
---

{{ content }}
Loading

0 comments on commit 4232a07

Please sign in to comment.