You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.md 2.1KB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. +++
  2. title = "book"
  3. description = "A book theme inspired from GitBook/mdBook"
  4. template = "theme.html"
  5. date = 2018-01-28T10:53:19+01:00
  6. [extra]
  7. created = 2018-02-22T19:13:36+01:00
  8. updated = 2018-01-28T10:53:19+01:00
  9. repository = "https://github.com/Keats/book"
  10. homepage = "https://github.com/Keats/book"
  11. minimum_version = "0.4.0"
  12. license = "MIT"
  13. demo = "https://gutenberg-book.netlify.com"
  14. [extra.author]
  15. name = "Vincent Prouillet"
  16. homepage = "https://vincent.is"
  17. +++
  18. # book
  19. A theme based on [Gitbook](https://www.gitbook.com), to write documentation
  20. or books.
  21. ![book screenshot](https://github.com/Keats/book/blob/master/screenshot.png?raw=true)
  22. ## Contents
  23. - [Installation](#installation)
  24. - [Options](#options)
  25. - [Numbered chapters](#numbered-chapters)
  26. ## Installation
  27. First download this theme to your `themes` directory:
  28. ```bash
  29. $ cd themes
  30. $ git clone https://github.com/Keats/book.git
  31. ```
  32. and then enable it in your `config.toml`:
  33. ```toml
  34. theme = "book"
  35. # Optional, if you want search
  36. build_search_index = true
  37. ```
  38. ## Usage
  39. Book will generate a book from the files you place in the `content` directory. Your book
  40. can have two levels of hierarchy: chapters and subchapters.
  41. Each chapter should be a `section` within the Gutenberg site and should have an `_index.md`
  42. file that sets its `weight` front-matter variable to its chapter number. For example,
  43. chapter 2 should have `weight = 2`. Additionally, each chapter should also set the
  44. `sort_by = "weight"` in its front matter.
  45. Each subchapter should be a `page` and should have its `weight` variable set to the subchapter
  46. number. For example, subchapter 3.4 should have `weight = 4`.
  47. Finally, you should create an `_index.md` file and set the `redirect_to` front-matter variable
  48. to redirect to the first section of your content. For example, if your first section has the
  49. slug `introduction`, then you would set `redirect_to = "introduction"`.
  50. ## Options
  51. ### Numbered chapters
  52. By default, the `book` theme will number the chapters and pages in the left menu.
  53. You can disable that by setting the `book_numbered_chapters` in `extra`:
  54. ```toml
  55. book_numbered_chapters = false
  56. ```