├── .gitignore ├── README.md ├── _config.yml ├── _includes ├── disqus.html ├── footer.html ├── google_analytics.html ├── header.html └── navigation.html ├── _layouts ├── default.html └── page.html ├── _posts └── .gitkeep ├── bin └── jekyll-page ├── css ├── main.css └── syntax.css └── index.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw? 2 | _site 3 | _pages 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bruth/jekyll-docs-template/trend.png)](https://bitdeli.com/free "Bitdeli Badge") 2 | 3 | Read the docs: http://bruth.github.io/jekyll-docs-template 4 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # Site title and subtitle. This is used in _includes/header.html 2 | title: 'jekyll-docs-template' 3 | subtitle: 'Painless documentation for your projects' 4 | 5 | # if you wish to integrate disqus on pages set your shortname here 6 | disqus_shortname: '' 7 | 8 | # if you use google analytics, add your tracking id here 9 | google_analytics_id: '' 10 | 11 | # Enable/show navigation. There are there options: 12 | # 0 - always hide 13 | # 1 - always show 14 | # 2 - show only if posts are present 15 | navigation: 2 16 | 17 | # URL to source code, used in _includes/footer.html 18 | codeurl: 'https://github.com/bruth/jekyll-docs-template' 19 | 20 | # Default categories (in order) to appear in the navigation 21 | sections: [ 22 | ['doc', 'Documentation'], 23 | ['tut', 'Tutorial'], 24 | ['ref', 'Reference'], 25 | ['dev', 'Developers'], 26 | ['post', 'Posts'] 27 | ] 28 | 29 | # Keep as an empty string if served up at the root. If served up at a specific 30 | # path (e.g. on GitHub pages) leave off the trailing slash, e.g. /my-project 31 | baseurl: '' 32 | 33 | # Dates are not included in permalinks 34 | permalink: none 35 | 36 | # Syntax highlighting 37 | highlighter: rouge 38 | 39 | # Since these are pages, it doesn't really matter 40 | future: true 41 | 42 | # Exclude non-site files 43 | exclude: ['bin', 'README.md'] 44 | 45 | # Use the kramdown Markdown renderer 46 | markdown: kramdown 47 | redcarpet: 48 | extensions: [ 49 | 'no_intra_emphasis', 50 | 'fenced_code_blocks', 51 | 'autolink', 52 | 'strikethrough', 53 | 'superscript', 54 | 'with_toc_data', 55 | 'tables', 56 | 'hardwrap' 57 | ] 58 | -------------------------------------------------------------------------------- /_includes/disqus.html: -------------------------------------------------------------------------------- 1 |
2 | 13 | 14 | -------------------------------------------------------------------------------- /_includes/footer.html: -------------------------------------------------------------------------------- 1 | Documentation for {{ site.title }} 2 | -------------------------------------------------------------------------------- /_includes/google_analytics.html: -------------------------------------------------------------------------------- 1 | 10 | -------------------------------------------------------------------------------- /_includes/header.html: -------------------------------------------------------------------------------- 1 |

{{ site.title }} 2 | {% if site.subtitle %}{{ site.subtitle }}{% endif %} 3 |

4 | -------------------------------------------------------------------------------- /_includes/navigation.html: -------------------------------------------------------------------------------- 1 | 17 | -------------------------------------------------------------------------------- /_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ site.title }}{% if page.title %} : {{ page.title }}{% endif %} 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 | 22 |
23 | 24 |
25 | {% assign post_count = site.posts|size %} 26 | {% if site.navigation != 0 and site.navigation == 1 or post_count > 0 %} 27 | 30 | 31 |
32 | {{ content }} 33 |
34 | {% else %} 35 |
36 | {{ content }} 37 |
38 | {% endif %} 39 |
40 | 41 | {% if page.disqus == 1 %} 42 |
43 | {% if site.navigation == 1 or post_count > 0 %} 44 | 45 |
46 | {% include disqus.html %} 47 |
48 | {% else %} 49 |
50 | {% include disqus.html %} 51 |
52 | {% endif %} 53 |
54 | {% endif %} 55 | 56 |
57 | 60 |
61 |
62 | 63 | 119 | {% if site.google_analytics_id != "" %} 120 | {% include google_analytics.html %} 121 | {% endif %} 122 | 123 | 124 | -------------------------------------------------------------------------------- /_layouts/page.html: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | --- 4 | 5 | 10 | 11 | {{ content }} 12 | -------------------------------------------------------------------------------- /_posts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bruth/jekyll-docs-template/83000ef95dc3c225ae8d2a53275a0dfcce09738e/_posts/.gitkeep -------------------------------------------------------------------------------- /bin/jekyll-page: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | require 'date' 4 | require 'optparse' 5 | 6 | options = { 7 | # Expects to be in the bin/ sub-directory by default 8 | :path => File.dirname(File.dirname(__FILE__)) 9 | } 10 | 11 | parser = OptionParser.new do |opt| 12 | opt.banner = 'usage: jekyll-page TITLE CATEGORY [FILENAME] [OPTIONS]' 13 | opt.separator '' 14 | opt.separator 'Options' 15 | opt.on('-e', '--edit', 'Edit the page') do |edit| 16 | options[:edit] = true 17 | end 18 | opt.on('-l', '--link', 'Relink pages') do |link| 19 | options[:link] = true 20 | end 21 | opt.on('-p PATH', '--path PATH', String, 'Path to project root') do |path| 22 | options[:path] = path 23 | end 24 | opt.separator '' 25 | end 26 | 27 | parser.parse! 28 | 29 | title = ARGV[0] 30 | category = ARGV[1] 31 | filename = ARGV[2] 32 | 33 | # Resolve any relative links 34 | BASE_DIR = File.expand_path(options[:path]) 35 | POSTS_DIR = "#{BASE_DIR}/_posts" 36 | PAGES_DIR = "#{BASE_DIR}/_pages" 37 | 38 | # Ensure the _posts directory exists (we are in the correct directory) 39 | if not Dir.exists?(POSTS_DIR) 40 | puts "#{POSTS_DIR} directory does not exists" 41 | exit 42 | end 43 | 44 | # Create _pages directory if it doesn't exist 45 | if not Dir.exists?(PAGES_DIR) 46 | Dir.mkdir(PAGES_DIR) 47 | end 48 | 49 | if options[:link] 50 | Dir.foreach(POSTS_DIR) do |name| 51 | next if name[0] == '.' 52 | nodate = name[/\d{4}-\d{2}-\d{2}-(?.*)/, 'rest'] 53 | if File.symlink?("#{PAGES_DIR}/#{nodate}") 54 | File.delete("#{PAGES_DIR}/#{nodate}") 55 | end 56 | abspath = File.absolute_path("#{POSTS_DIR}/#{name}") 57 | File.symlink(abspath, "#{PAGES_DIR}/#{nodate}") 58 | end 59 | end 60 | 61 | if not title or not category 62 | # This flag can be used by itself, exit silently if no arguments 63 | # are defined 64 | if not options[:link] 65 | puts parser 66 | end 67 | exit 68 | end 69 | 70 | if not filename 71 | filename = title.downcase.gsub(/[^a-z0-9\s]/, '').gsub(/\s+/, '-') 72 | end 73 | 74 | today=Date.today().strftime('%F') 75 | now=DateTime.now().strftime('%F %T') 76 | 77 | filepath = "#{POSTS_DIR}/#{today}-#{filename}.md" 78 | symlink = "#{PAGES_DIR}/#{filename}.md" 79 | 80 | if File.exists?(filepath) 81 | puts "File #{filepath} already exists" 82 | exit 83 | end 84 | 85 | content = < .page-header:first-child { 41 | margin-top: 0; 42 | } 43 | 44 | #content > .page-header:first-child h2 { 45 | margin-top: 0; 46 | } 47 | 48 | 49 | #navigation { 50 | font-size: 0.9em; 51 | } 52 | 53 | #navigation li a { 54 | padding-left: 10px; 55 | padding-right: 10px; 56 | } 57 | 58 | #navigation .nav-header { 59 | padding-left: 0; 60 | padding-right: 0; 61 | } 62 | 63 | .nav-header { 64 | font-size: 1em; 65 | cursor: default; 66 | text-transform: uppercase; 67 | font-weight: bold; 68 | } 69 | 70 | body.rtl { 71 | direction: rtl; 72 | } 73 | 74 | body.rtl #header .brand { 75 | float: right; 76 | margin-left: 5px; 77 | } 78 | body.rtl .row-fluid [class*="span"] { 79 | float: right !important; 80 | margin-left: 0; 81 | margin-right: 2.564102564102564%; 82 | } 83 | body.rtl .row-fluid [class*="span"]:first-child { 84 | margin-right: 0; 85 | } 86 | 87 | body.rtl ul, body.rtl ol { 88 | margin: 0 25px 10px 0; 89 | } 90 | 91 | table { 92 | margin-bottom: 1rem; 93 | border: 1px solid #e5e5e5; 94 | border-collapse: collapse; 95 | } 96 | 97 | td, th { 98 | padding: .25rem .5rem; 99 | border: 1px solid #e5e5e5; 100 | } 101 | -------------------------------------------------------------------------------- /css/syntax.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #ffffff; } 3 | .highlight .c { color: #888888 } /* Comment */ 4 | .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ 5 | .highlight .k { color: #008800; font-weight: bold } /* Keyword */ 6 | .highlight .cm { color: #888888 } /* Comment.Multiline */ 7 | .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ 8 | .highlight .c1 { color: #888888 } /* Comment.Single */ 9 | .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ 10 | .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ 11 | .highlight .ge { font-style: italic } /* Generic.Emph */ 12 | .highlight .gr { color: #aa0000 } /* Generic.Error */ 13 | .highlight .gh { color: #333333 } /* Generic.Heading */ 14 | .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ 15 | .highlight .go { color: #888888 } /* Generic.Output */ 16 | .highlight .gp { color: #555555 } /* Generic.Prompt */ 17 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 18 | .highlight .gu { color: #666666 } /* Generic.Subheading */ 19 | .highlight .gt { color: #aa0000 } /* Generic.Traceback */ 20 | .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ 21 | .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ 22 | .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ 23 | .highlight .kp { color: #008800 } /* Keyword.Pseudo */ 24 | .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ 25 | .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ 26 | .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ 27 | .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ 28 | .highlight .na { color: #336699 } /* Name.Attribute */ 29 | .highlight .nb { color: #003388 } /* Name.Builtin */ 30 | .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ 31 | .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ 32 | .highlight .nd { color: #555555 } /* Name.Decorator */ 33 | .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ 34 | .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ 35 | .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ 36 | .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ 37 | .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ 38 | .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ 39 | .highlight .nv { color: #336699 } /* Name.Variable */ 40 | .highlight .ow { color: #008800 } /* Operator.Word */ 41 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 42 | .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ 43 | .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ 44 | .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ 45 | .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ 46 | .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ 47 | .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ 48 | .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ 49 | .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ 50 | .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ 51 | .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ 52 | .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ 53 | .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ 54 | .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ 55 | .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ 56 | .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ 57 | .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ 58 | .highlight .vc { color: #336699 } /* Name.Variable.Class */ 59 | .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ 60 | .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ 61 | .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ 62 | -------------------------------------------------------------------------------- /index.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: default 3 | title: "Jekyll Docs Template" 4 | --- 5 | 6 | ### Get Started 7 | 8 | Start by [creating a new post](http://jekyllrb.com/docs/posts/) one of the categories listed in `_config.yml`. It will appear in the navigation on the left once recompiled. Or use the supplied script to make creating pages easier: 9 | 10 | ```bash 11 | ruby bin/jekyll-page "Some Page Title" ref 12 | ``` 13 | 14 | #### Don't Forget 15 | 16 | - Add your own content to this page (i.e. `index.md`) and change the `title` 17 | - Change `title` and `subtitle` defined in `config.yml` for your site 18 | - Set the `baseurl` in `_config.yml` for your repo if deploying to GitHub pages 19 | --------------------------------------------------------------------------------