├── .gitignore
├── .npmignore
├── README.md
├── _i18n
└── en.json
├── _layouts
└── website
│ ├── layout.html
│ └── page.html
├── package.json
└── src
└── less
├── panel.less
├── search.less
├── variables.less
└── website.less
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17 | .grunt
18 |
19 | # Compiled binary addons (http://nodejs.org/api/addons.html)
20 | build/Release
21 |
22 | # Dependency directory
23 | # Deployed apps should consider commenting this line out:
24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25 | node_modules
26 |
27 | # vim swapfile
28 | *.swp
29 |
30 | _assets
31 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Allow _assets folder
2 | !_assets
3 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # GitBook FAQ Theme
2 |
3 | Theme for using GitBook to publish an FAQ or Knowledge Base. This theme works perfectly with search plugins (as the [default one](https://github.com/GitbookIO/plugin-search) or [algolia](https://github.com/GitbookIO/plugin-algolia)).
4 |
5 | ## Usage
6 |
7 | This theme requires GitBook version 3 or later.
8 |
9 | Add the theme to your book's configuration (`book.json`):
10 |
11 | ```js
12 | {
13 | "plugins": [
14 | "theme-faq",
15 | "-fontsettings",
16 | "-sharing"
17 | ]
18 | }
19 | ```
20 |
21 | **NOTE** `theme-faq` is not compatible with plugins that modify the toolbar (since there is no toolbar). Embedded search will not work as a result. This includes the default plugins `fontsettings` and `sharing` that need to be disabled explicitly (add a minus flag "-" before each plugin parameter).
22 |
23 | ### Add relations between articles
24 |
25 | Suggestions for other articles can be shown at the bottom of an article.
26 |
27 | Relationships are specified in the YAML frontmatter of a page:
28 |
29 | ```md
30 | ---
31 | related:
32 | - some/other/page.md
33 | - another_related_article.md
34 |
35 | ---
36 |
37 | Content of my article!
38 | ```
39 |
40 | ### Add logo to header
41 |
42 | Extend the theme by creating a file `_layouts/website/page.html` in your book with:
43 |
44 | ```html
45 | {% extends template.self %}
46 |
47 | {% block faq_header_brand %}
48 |
49 | {% endblock %}
50 | ```
51 |
52 | ### Add navigation links to the header
53 |
54 | Extend the theme by creating a file `_layouts/website/page.html` in your book with:
55 |
56 | ```html
57 | {% extends template.self %}
58 |
59 | {% block faq_menu %}
60 |