mirror of
https://github.com/snachodog/just-the-docs.git
synced 2025-09-16 06:13:32 -06:00
Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
74693a0b2a | ||
|
6400e79e02 | ||
|
6a6efba27a | ||
|
d554236ba3 | ||
|
6d14c454f1 | ||
|
9d51b4601c | ||
|
62fc067441 | ||
|
ea61589b12 | ||
|
89f9c5f38c | ||
|
caf5311feb | ||
|
3a32d20f18 | ||
|
651ed922b0 | ||
|
64ed5ef369 | ||
|
82e1873460 | ||
|
46782d9352 | ||
|
d558234885 | ||
|
b6ed3643f1 | ||
|
6ebfb5c77e | ||
|
86402106e7 | ||
|
53b093474f | ||
|
c8a93a9a3c | ||
|
8bffcd06cd | ||
|
dc0d4a0c84 | ||
|
886654d86d | ||
|
4177f965df | ||
|
f97f504284 | ||
|
45abf03b48 | ||
|
debc7d3310 | ||
|
ea23134560 | ||
|
2ad43933cf | ||
|
1afc26cc33 | ||
|
b64368873c | ||
|
89a3e86ebf | ||
|
952a016807 | ||
|
6c05ef8b9d | ||
|
3752c58af2 | ||
|
6e534b63c2 | ||
|
ced66a0056 | ||
|
ce3fd856dd | ||
|
4df5736ca4 | ||
|
aa9e2ab8e3 | ||
|
b38f9863cd | ||
|
ca06df3776 | ||
|
e9943f90c9 | ||
|
3d4e1de008 | ||
|
bdfdf1bb42 | ||
|
bf0d7eaa5f | ||
|
1b715049eb | ||
|
049d1f50d7 | ||
|
3af81c7f36 | ||
|
97743c1c18 | ||
|
7d4ce89e9b | ||
|
778e142411 | ||
|
c45297c5cb | ||
|
c1cacf277c | ||
|
fc58bd0c04 | ||
|
b5de18ec2d | ||
|
7ba3b3e5fd | ||
|
62c7ac4729 | ||
|
0611696c2d | ||
|
25cd289df5 | ||
|
d60338910b |
@@ -1,4 +1,7 @@
|
|||||||
{
|
{
|
||||||
|
"ignoreFiles" : [
|
||||||
|
"assets/css/just-the-docs.scss"
|
||||||
|
],
|
||||||
"extends": [
|
"extends": [
|
||||||
"stylelint-config-primer"
|
"stylelint-config-primer"
|
||||||
]
|
]
|
||||||
|
13
.travis.yml
Normal file
13
.travis.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
language: ruby
|
||||||
|
rvm:
|
||||||
|
- 2.3.0
|
||||||
|
env:
|
||||||
|
- TRAVIS_NODE_VERSION="9.3.0"
|
||||||
|
|
||||||
|
install:
|
||||||
|
- npm install
|
||||||
|
- bundle install
|
||||||
|
|
||||||
|
script:
|
||||||
|
- npm run test
|
||||||
|
- bundle exec jekyll build
|
22
README.md
22
README.md
@@ -1,8 +1,9 @@
|
|||||||
# Just the Docs
|
# Just the Docs
|
||||||
|
|
||||||
A nice looking, high customizable, responsive Jekyll theme for documention with built-in search. Easily hosted on GitHub pages.
|
A nice looking, high customizable, responsive Jekyll theme for documentation with built-in search. Easily hosted on GitHub pages.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -34,6 +35,13 @@ Or install it yourself as:
|
|||||||
|
|
||||||
Bug reports and pull requests are welcome on GitHub at https://github.com/pmarsceill/just-the-docs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
Bug reports and pull requests are welcome on GitHub at https://github.com/pmarsceill/just-the-docs. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
||||||
|
|
||||||
|
### Submitting code changes:
|
||||||
|
|
||||||
|
- Open a [Pull Request](https://github.com/pmarsceill/just-the-docs/pulls)
|
||||||
|
- Ensure all CI tests pass
|
||||||
|
- Await code review
|
||||||
|
- Bump the version number in `just-the-docs.gemspec` and `package.json` according to [semantic versioning](https://semver.org/).
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
To set up your environment to develop this theme, run `bundle install`.
|
To set up your environment to develop this theme, run `bundle install`.
|
||||||
@@ -42,16 +50,6 @@ Your theme is setup just like a normal Jekyll site! To test your theme, run `bun
|
|||||||
|
|
||||||
When the theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
|
When the theme is released, only the files in `_layouts`, `_includes`, and `_sass` tracked with Git will be released.
|
||||||
|
|
||||||
|
|
||||||
### When your changes are ready:
|
|
||||||
|
|
||||||
- Open a [Pull Request](https://github.com/pmarsceill/just-the-docs/pulls)
|
|
||||||
- Await code review
|
|
||||||
- Bump the version number in `just-the-docs.gemspec`
|
|
||||||
- Run `script/build` to package the gem
|
|
||||||
- Run `gem push just-the-docs-<version>.gem` to publish the gem to Rubygems.org
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The theme is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
The theme is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
# in the templates via {{ site.myvariable }}.
|
# in the templates via {{ site.myvariable }}.
|
||||||
title: Just the Docs
|
title: Just the Docs
|
||||||
description: A Jekyll theme for documentation
|
description: A Jekyll theme for documentation
|
||||||
# baseurl: "" # the subpath of your site, e.g. /blog
|
baseurl: "/just-the-docs/" # the subpath of your site, e.g. /blog
|
||||||
# url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
# url: "" # the base hostname & protocol for your site, e.g. http://example.com
|
||||||
|
|
||||||
sass:
|
sass:
|
||||||
|
5
_layouts/about.html
Normal file
5
_layouts/about.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
{{ content }}
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<div class="page-wrap">
|
<div class="page-wrap">
|
||||||
<div class="side-bar">
|
<div class="side-bar">
|
||||||
<a href="{{ site.url }}" class="site-title fs-6 text-grey-dk-300 lh-tight">{{ site.title }}</a>
|
<a href="{{ site.url }}{{ site.baseurl }}" class="site-title fs-6 text-grey-dk-300 lh-tight">{{ site.title }}</a>
|
||||||
<span class="fs-3"><button class="js-main-nav-trigger navigation-list-toggle btn btn-outline" type="button" data-text-toggle="Hide">Menu</button></span>
|
<span class="fs-3"><button class="js-main-nav-trigger navigation-list-toggle btn btn-outline" type="button" data-text-toggle="Hide">Menu</button></span>
|
||||||
<div class="navigation main-nav js-main-nav">
|
<div class="navigation main-nav js-main-nav">
|
||||||
{% include nav.html %}
|
{% include nav.html %}
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="main-content pb-0">
|
<div class="main-content pb-0">
|
||||||
<div class="search js-search">
|
<div class="search js-search">
|
||||||
<div class="search-input-wrap">
|
<div class="search-input-wrap">
|
||||||
<input type="text" class="js-search-input search-input fs-2" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
|
<input type="text" class="js-search-input search-input" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
|
||||||
<svg width="14" height="14" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" class="search-icon"><title>Search</title><g fill-rule="nonzero"><path d="M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z"/><path d="M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z"/></g></svg>
|
<svg width="14" height="14" viewBox="0 0 28 28" xmlns="http://www.w3.org/2000/svg" class="search-icon"><title>Search</title><g fill-rule="nonzero"><path d="M17.332 20.735c-5.537 0-10-4.6-10-10.247 0-5.646 4.463-10.247 10-10.247 5.536 0 10 4.601 10 10.247s-4.464 10.247-10 10.247zm0-4c3.3 0 6-2.783 6-6.247 0-3.463-2.7-6.247-6-6.247s-6 2.784-6 6.247c0 3.464 2.7 6.247 6 6.247z"/><path d="M11.672 13.791L.192 25.271 3.02 28.1 14.5 16.62z"/></g></svg>
|
||||||
</div>
|
</div>
|
||||||
<div class="js-search-results search-results-wrap"></div>
|
<div class="js-search-results search-results-wrap"></div>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
{% if page.parent != nil and page.parent != page.title %}
|
{% if page.parent != nil and page.parent != page.title %}
|
||||||
<nav class="breadcrumb-nav">
|
<nav class="breadcrumb-nav">
|
||||||
<ol class="breadcrumb-nav-list">
|
<ol class="breadcrumb-nav-list">
|
||||||
<li class="breadcrumb-nav-list-item"><a href="{{ site.url }}/{{ page.parent | slugify }}">{{ page.parent }}</a></li>
|
<li class="breadcrumb-nav-list-item"><a href="{{ site.url }}{{ site.baseurl }}/{{ page.parent | slugify }}">{{ page.parent }}</a></li>
|
||||||
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
|
5
_layouts/home.html
Normal file
5
_layouts/home.html
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
{{ content }}
|
@@ -5,8 +5,7 @@
|
|||||||
|
|
||||||
.page-content {
|
.page-content {
|
||||||
ul,
|
ul,
|
||||||
ol,
|
ol {
|
||||||
dl {
|
|
||||||
padding-left: 1.5em;
|
padding-left: 1.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,4 +63,27 @@
|
|||||||
h1:first-of-type {
|
h1:first-of-type {
|
||||||
margin-top: 0.5em;
|
margin-top: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: max-content 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt,
|
||||||
|
dd {
|
||||||
|
margin: 0.25em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dt {
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: ":";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-left: 1em;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,9 +12,9 @@
|
|||||||
margin-right: $sp-1;
|
margin-right: $sp-1;
|
||||||
margin-left: $sp-1;
|
margin-left: $sp-1;
|
||||||
color: $white;
|
color: $white;
|
||||||
|
text-transform: uppercase;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
background-color: $blue-100;
|
background-color: $blue-100;
|
||||||
text-transform: uppercase;
|
|
||||||
@include fs-2;
|
@include fs-2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,13 +17,15 @@
|
|||||||
|
|
||||||
.side-bar {
|
.side-bar {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
padding-top: $gutter-spacing-sm;
|
padding-top: $gutter-spacing-sm;
|
||||||
padding-bottom: $gutter-spacing-sm;
|
padding-bottom: $gutter-spacing-sm;
|
||||||
background-color: $grey-lt-000;
|
background-color: $grey-lt-000;
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
|
flex-wrap: nowrap;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: flex;
|
|
||||||
width: $nav-width + 16px;
|
width: $nav-width + 16px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
padding-top: $gutter-spacing * 2;
|
padding-top: $gutter-spacing * 2;
|
||||||
@@ -107,14 +109,13 @@
|
|||||||
|
|
||||||
.navigation {
|
.navigation {
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
height: 100%;
|
|
||||||
padding-top: $sp-8;
|
padding-top: $sp-8;
|
||||||
|
overflow-y: auto;
|
||||||
|
flex: 1 1 auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// stylelint-disable selector-no-type
|
||||||
body {
|
body {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: $sp-10;
|
padding-bottom: $sp-10;
|
||||||
@@ -124,12 +125,18 @@ body {
|
|||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// stylelint-enable selector-no-type
|
||||||
|
|
||||||
.site-footer {
|
.site-footer {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: $sp-3;
|
bottom: 0;
|
||||||
|
padding-top: $sp-4;
|
||||||
|
padding-bottom: $sp-4;
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
right: 0;
|
position: static;
|
||||||
|
align-self: flex-end;
|
||||||
|
justify-self: end;
|
||||||
|
background-color: $grey-lt-000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,16 +4,17 @@
|
|||||||
|
|
||||||
.site-title {
|
.site-title {
|
||||||
display: block;
|
display: block;
|
||||||
flex-grow: 1;
|
flex: 1 1 auto;
|
||||||
flex-shrink: 1;
|
|
||||||
flex-basis: auto;
|
|
||||||
background-color: $grey-lt-000;
|
background-color: $grey-lt-000;
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: $gutter-spacing;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: 101;
|
z-index: 101;
|
||||||
|
height: 60px;
|
||||||
|
padding-top: $sp-4;
|
||||||
|
box-shadow: inset 0 -1px 0 $border-color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
list-style: none;
|
list-style: none;
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
margin-top: $sp-10;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,16 +89,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.side-bar {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
|
|
||||||
@include mq(md) {
|
|
||||||
display: block;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.navigation-list-toggle {
|
.navigation-list-toggle {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: $sp-4;
|
right: $sp-4;
|
||||||
|
@@ -7,10 +7,11 @@
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
display: none;
|
display: none;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
padding-bottom: $gutter-spacing / 2;
|
|
||||||
background-color: $white;
|
|
||||||
padding: $sp-2;
|
padding: $sp-2;
|
||||||
margin-bottom: $sp-3;
|
margin-bottom: $sp-3;
|
||||||
|
background-color: $white;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 3px 10px rgba(0, 0, 0, 0.05);
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.nav-open {
|
&.nav-open {
|
||||||
@@ -65,6 +67,16 @@
|
|||||||
fill: $purple-000;
|
fill: $purple-000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include fs-5;
|
||||||
|
|
||||||
|
@include mq(sm) {
|
||||||
|
@include fs-3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@include mq(md) {
|
||||||
|
@include fs-2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-icon {
|
.search-icon {
|
||||||
|
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
@mixin btn-color($fg, $bg) {
|
@mixin btn-color($fg, $bg) {
|
||||||
color: $fg;
|
color: $fg;
|
||||||
|
background-color: darken($bg, 2%);
|
||||||
background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%));
|
background-image: linear-gradient(lighten($bg, 5%), darken($bg, 2%));
|
||||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12);
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 10px rgba(0, 0, 0, 0.12);
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&.zeroclipboard-is-hover {
|
&.zeroclipboard-is-hover {
|
||||||
color: $fg;
|
color: $fg;
|
||||||
|
background-color: darken($bg, 4%);
|
||||||
background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%)));
|
background-image: linear-gradient((lighten($bg, 2%), darken($bg, 4%)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,20 +15,22 @@
|
|||||||
@media (min-width: rem($value)) {
|
@media (min-width: rem($value)) {
|
||||||
@content;
|
@content;
|
||||||
}
|
}
|
||||||
} @else {
|
}
|
||||||
|
|
||||||
|
@else {
|
||||||
@warn "No value could be retrieved from `#{$media-query}`. "
|
@warn "No value could be retrieved from `#{$media-query}`. "
|
||||||
+ "Please make sure it is defined in `$media-queries` map.";
|
+ "Please make sure it is defined in `$media-queries` map.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Responsive container
|
// Responsive container
|
||||||
|
|
||||||
@mixin container {
|
@mixin container {
|
||||||
padding-left: $gutter-spacing-sm;
|
|
||||||
padding-right: $gutter-spacing-sm;
|
padding-right: $gutter-spacing-sm;
|
||||||
|
padding-left: $gutter-spacing-sm;
|
||||||
|
|
||||||
@include mq(md) {
|
@include mq(md) {
|
||||||
padding-left: $gutter-spacing;
|
|
||||||
padding-right: $gutter-spacing;
|
padding-right: $gutter-spacing;
|
||||||
|
padding-left: $gutter-spacing;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,14 +35,29 @@ function initSearch() {
|
|||||||
var index = lunr(function () {
|
var index = lunr(function () {
|
||||||
this.ref('id');
|
this.ref('id');
|
||||||
this.field('title', { boost: 20 });
|
this.field('title', { boost: 20 });
|
||||||
this.field('content');
|
this.field('content', { boost: 10 });
|
||||||
this.field('url');
|
this.field('url');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get the generated search_data.json file so lunr.js can search it locally.
|
// Get the generated search_data.json file so lunr.js can search it locally.
|
||||||
|
|
||||||
|
sc = document.getElementsByTagName("script");
|
||||||
|
source = '';
|
||||||
|
|
||||||
|
for(idx = 0; idx < sc.length; idx++)
|
||||||
|
{
|
||||||
|
s = sc.item(idx);
|
||||||
|
|
||||||
|
if(s.src && s.src.match(/just-the-docs\.js$/))
|
||||||
|
{ source = s.src; }
|
||||||
|
}
|
||||||
|
|
||||||
|
jsPath = source.replace('just-the-docs.js', '');
|
||||||
|
|
||||||
|
jsonPath = jsPath + '/search-data.json';
|
||||||
|
|
||||||
var request = new XMLHttpRequest();
|
var request = new XMLHttpRequest();
|
||||||
request.open('GET', '/search-data.json', true);
|
request.open('GET', jsonPath, true);
|
||||||
|
|
||||||
request.onload = function() {
|
request.onload = function() {
|
||||||
if (request.status >= 200 && request.status < 400) {
|
if (request.status >= 200 && request.status < 400) {
|
||||||
@@ -103,11 +118,12 @@ function initSearch() {
|
|||||||
var resultsLink = document.createElement('a');
|
var resultsLink = document.createElement('a');
|
||||||
var resultsUrlDesc = document.createElement('span');
|
var resultsUrlDesc = document.createElement('span');
|
||||||
var resultsUrl = store[results[i].ref].url;
|
var resultsUrl = store[results[i].ref].url;
|
||||||
|
var resultsRelUrl = store[results[i].ref].relUrl;
|
||||||
var resultsTitle = store[results[i].ref].title;
|
var resultsTitle = store[results[i].ref].title;
|
||||||
|
|
||||||
resultsLink.setAttribute('href', store[results[i].ref].url);
|
resultsLink.setAttribute('href', resultsUrl);
|
||||||
resultsLink.innerText = resultsTitle;
|
resultsLink.innerText = resultsTitle;
|
||||||
resultsUrlDesc.innerText = resultsUrl;
|
resultsUrlDesc.innerText = resultsRelUrl;
|
||||||
|
|
||||||
resultsList.classList.add('search-results-list');
|
resultsList.classList.add('search-results-list');
|
||||||
resultsListItem.classList.add('search-results-list-item');
|
resultsListItem.classList.add('search-results-list-item');
|
||||||
|
@@ -4,8 +4,9 @@
|
|||||||
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
|
{% for page in site.html_pages %}"{{ forloop.index0 }}": {
|
||||||
"id": "{{ forloop.index0 }}",
|
"id": "{{ forloop.index0 }}",
|
||||||
"title": "{{ page.title | xml_escape }}",
|
"title": "{{ page.title | xml_escape }}",
|
||||||
"content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | remove: page.title | strip_newlines | replace: '\', ' '}}",
|
"content": "{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\', ' ' }}",
|
||||||
"url": "{{ page.url | xml_escape }}"
|
"url": "{{ page.url | absolute_url | xml_escape }}",
|
||||||
|
"relUrl": "{{ page.url | xml_escape }}"
|
||||||
}{% if forloop.last %}{% else %},
|
}{% if forloop.last %}{% else %},
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
}
|
}
|
@@ -23,7 +23,7 @@ $ bundle exec just-the-docs rake search:init
|
|||||||
|
|
||||||
This command creates the `search-data.json` file that Jekyll uses to create
|
This command creates the `search-data.json` file that Jekyll uses to create
|
||||||
your search index. Alternatively, you can create the file manually in the
|
your search index. Alternatively, you can create the file manually in the
|
||||||
root of your Jekyll site with this content:
|
`assets/js/` of your Jekyll site with this content:
|
||||||
|
|
||||||
```{% raw %}
|
```{% raw %}
|
||||||
---
|
---
|
||||||
@@ -39,4 +39,4 @@ root of your Jekyll site with this content:
|
|||||||
}{% endraw %}
|
}{% endraw %}
|
||||||
```
|
```
|
||||||
|
|
||||||
You can modify this by modifying the forloop in `search-data.json` and the javascript in `just-the-docs.js` on line 30.
|
_Note: If you don't run this rake command or create this file manually, search will not work (or it will use the search index data from this docs site, not your site's content)._
|
||||||
|
@@ -111,4 +111,4 @@ Text can be **bold**, _italic_, or ~~strikethrough~~.
|
|||||||
|
|
||||||
There are a number of specific typographic CSS classes that allow you to do override default styling for font size, font-weight, line height, and capitalization.
|
There are a number of specific typographic CSS classes that allow you to do override default styling for font size, font-weight, line height, and capitalization.
|
||||||
|
|
||||||
[View typography utilities]({{ site.base_url }}{% link docs/utilities/utilities.md %}#typography){: .btn .btn-outline }
|
[View typography utilities]({{ site.baseurl }}{% link docs/utilities/utilities.md %}#typography){: .btn .btn-outline }
|
||||||
|
6
index.md
6
index.md
@@ -2,6 +2,7 @@
|
|||||||
layout: default
|
layout: default
|
||||||
title: Home
|
title: Home
|
||||||
nav_order: 1
|
nav_order: 1
|
||||||
|
permalink: /
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +17,7 @@ Just the Docs gives your documentation a jumpstart with a responsive Jekyll them
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
### Dependancies
|
### Dependencies
|
||||||
Just the Docs is built for [Jekyll](https://jekyllrb.com), a static site generator. View the [quick start guide](https://jekyllrb.com/docs/quickstart/) for more information. Just the Docs requires no special Jekyll plugins and can run on GitHub Pages standard Jekyll compiler.
|
Just the Docs is built for [Jekyll](https://jekyllrb.com), a static site generator. View the [quick start guide](https://jekyllrb.com/docs/quickstart/) for more information. Just the Docs requires no special Jekyll plugins and can run on GitHub Pages standard Jekyll compiler.
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
@@ -59,9 +60,8 @@ Just the Docs is distributed by an [MIT license](https://github.com/pmarsceill/j
|
|||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
When contributing to this repository, please first discuss the change you wish to make via issue,
|
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||||
email, or any other method with the owners of this repository before making a change. Read more about becoming a contributor in [our GitHub repo][954661c7].
|
email, or any other method with the owners of this repository before making a change. Read more about becoming a contributor in [our GitHub repo](https://github.com/pmarsceill/just-the-docs#contributing).
|
||||||
|
|
||||||
[954661c7]: https://github.com/pmarsceill/just-the-docs/tree/master/CONTRIBUTING.md "Contributing.md on Just the Docs GitHub repository"
|
|
||||||
|
|
||||||
### Code of Conduct
|
### Code of Conduct
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = "just-the-docs"
|
spec.name = "just-the-docs"
|
||||||
spec.version = "0.1.1"
|
spec.version = "0.1.5"
|
||||||
spec.authors = ["Patrick Marsceill"]
|
spec.authors = ["Patrick Marsceill"]
|
||||||
spec.email = ["patrick.marsceill@gmail.com"]
|
spec.email = ["patrick.marsceill@gmail.com"]
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|||||||
spec.executables << 'just-the-docs'
|
spec.executables << 'just-the-docs'
|
||||||
|
|
||||||
spec.add_runtime_dependency "jekyll", "~> 3.3"
|
spec.add_runtime_dependency "jekyll", "~> 3.3"
|
||||||
|
spec.add_runtime_dependency "rake", "~> 10.0"
|
||||||
|
|
||||||
spec.add_development_dependency "bundler", "~> 1.12"
|
spec.add_development_dependency "bundler", "~> 1.12"
|
||||||
spec.add_development_dependency "rake", "~> 10.0"
|
|
||||||
end
|
end
|
||||||
|
@@ -2,10 +2,13 @@ namespace :search do
|
|||||||
desc 'Generate the files needed for search functionality'
|
desc 'Generate the files needed for search functionality'
|
||||||
task :init do
|
task :init do
|
||||||
puts 'Creating search data json file...'
|
puts 'Creating search data json file...'
|
||||||
touch 'search-data.json'
|
mkdir_p 'assets/js'
|
||||||
|
touch 'assets/js/search-data.json'
|
||||||
content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}]
|
content = %Q[{{ page.content | markdownify | strip_html | xml_escape | remove: 'Table of contents' | strip_newlines | replace: '\\', ' ' }}]
|
||||||
|
puts 'Done.'
|
||||||
|
puts 'Generating content...'
|
||||||
|
|
||||||
File.open('search-data.json', 'w') do |f|
|
File.open('assets/js/search-data.json', 'w') do |f|
|
||||||
f.puts '---
|
f.puts '---
|
||||||
---
|
---
|
||||||
{
|
{
|
||||||
@@ -13,10 +16,12 @@ namespace :search do
|
|||||||
"id": "{{ forloop.index0 }}",
|
"id": "{{ forloop.index0 }}",
|
||||||
"title": "{{ page.title | xml_escape }}",
|
"title": "{{ page.title | xml_escape }}",
|
||||||
"content": "'+content+'",
|
"content": "'+content+'",
|
||||||
"url": "{{ page.url | xml_escape }}"
|
"url": "{{ page.url | absolute_url | xml_escape }}",
|
||||||
|
"relUrl": "{{ page.url | xml_escape }}"
|
||||||
}{% if forloop.last %}{% else %},
|
}{% if forloop.last %}{% else %},
|
||||||
{% endif %}{% endfor %}
|
{% endif %}{% endfor %}
|
||||||
}'
|
}'
|
||||||
end
|
end
|
||||||
|
puts 'Done.'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@@ -10,5 +10,8 @@
|
|||||||
"stylelint": "^7.9.0",
|
"stylelint": "^7.9.0",
|
||||||
"stylelint-config-primer": "^1.4.0"
|
"stylelint-config-primer": "^1.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {}
|
"dependencies": {},
|
||||||
|
"scripts": {
|
||||||
|
"test": "stylelint '**/*.scss'"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user