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.

configuration.md 7.6KB

6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. +++
  2. title = "Configuration"
  3. weight = 40
  4. +++
  5. The default configuration is sufficient to get Zola running locally but not more than that.
  6. It follows the philosophy of paying for only what you need; almost everything is turned off by default.
  7. To change the configuration, edit the `config.toml` file.
  8. If you are not familiar with TOML, have a look at [the TOML spec](https://github.com/toml-lang/toml).
  9. Only the `base_url` variable is mandatory; everything else is optional. All configuration variables
  10. used by Zola as well as their default values are listed below:
  11. ```toml
  12. # The base URL of the site; the only required configuration variable.
  13. base_url = "mywebsite.com"
  14. # The site title and description; used in RSS by default.
  15. title = ""
  16. description = ""
  17. # The default language; used in RSS.
  18. default_language = "en"
  19. # The site theme to use.
  20. theme = ""
  21. # When set to "true", all code blocks are highlighted.
  22. highlight_code = false
  23. # The theme to use for code highlighting.
  24. # See below for list of allowed values.
  25. highlight_theme = "base16-ocean-dark"
  26. # When set to "true", an RSS feed is automatically generated.
  27. generate_rss = false
  28. # The number of articles to include in the RSS feed. All items are included if
  29. # this limit is not set (the default).
  30. # rss_limit = 20
  31. # When set to "true", files in the `static` directory are hard-linked. Useful for large
  32. # static files. Note that for this to work, both `static` and the
  33. # output directory need to be on the same filesystem. Note that the theme's `static`
  34. # files are always copied, regardles of this setting.
  35. # hard_link_static = false
  36. # The taxonomies to be rendered for the site and their configuration.
  37. # Example:
  38. # taxonomies = [
  39. # {name = "tags", rss = true}, # each tag will have its own RSS feed
  40. # {name = "tags", lang = "fr"}, # you can have taxonomies with the same name in multiple languages
  41. # {name = "categories", paginate_by = 5}, # 5 items per page for a term
  42. # {name = "authors"}, # Basic definition: no RSS or pagination
  43. # ]
  44. #
  45. taxonomies = []
  46. # The additional languages for the site.
  47. # Example:
  48. # languages = [
  49. # {code = "fr", rss = true}, # there will be a RSS feed for French content
  50. # {code = "fr", search = true}, # there will be a Search Index for French content
  51. # {code = "it"}, # there won't be a RSS feed for Italian content
  52. # ]
  53. #
  54. languages = []
  55. # When set to "true", the Sass files in the `sass` directory are compiled.
  56. compile_sass = false
  57. # When set to "true", a search index is built from the pages and section
  58. # content for `default_language`.
  59. build_search_index = false
  60. # A list of glob patterns specifying asset files to ignore when the content
  61. # directory is processed. Defaults to none, which means that all asset files are
  62. # copied over to the `public` directory.
  63. # Example:
  64. # ignored_content = ["*.{graphml,xlsx}", "temp.*"]
  65. ignored_content = []
  66. # A list of directories used to search for additional `.sublime-syntax` files.
  67. extra_syntaxes = []
  68. # Optional translation object. The key if present should be a language code.
  69. # Example:
  70. # default_language = "fr"
  71. #
  72. # [translations]
  73. # [translations.fr]
  74. # title = "Un titre"
  75. #
  76. # [translations.en]
  77. # title = "A title"
  78. # Configuration of the link checker.
  79. [link_checker]
  80. # Skip link checking for external URLs that start with these prefixes
  81. skip_prefixes = [
  82. "http://[2001:db8::]/",
  83. ]
  84. # Skip anchor checking for external URLs that start with these prefixes
  85. skip_anchor_prefixes = [
  86. "https://caniuse.com/",
  87. ]
  88. # Various slugification strategies, see below for details
  89. # Defauls to everything being a slug
  90. [slugify]
  91. paths = "on"
  92. taxonomies = "on"
  93. anchors = "on"
  94. # Optional translation object. Keys should be language codes.
  95. [translations]
  96. # You can put any kind of data here. The data
  97. # will be accessible in all templates.
  98. [extra]
  99. ```
  100. ## Syntax highlighting
  101. Zola currently has the following highlight themes available:
  102. - [1337](https://tmtheme-editor.herokuapp.com/#!/editor/theme/1337)
  103. - [agola-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Agola%20Dark)
  104. - [ascetic-white](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Ascetic%20White)
  105. - [axar](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Axar)
  106. - [base16-ocean-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Base16%20Ocean%20Dark)
  107. - [base16-ocean-light](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Base16%20Ocean%20Light)
  108. - [bbedit](https://tmtheme-editor.herokuapp.com/#!/editor/theme/BBEdit)
  109. - [boron](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Boron)
  110. - [charcoal](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Charcoal)
  111. - [cheerfully-light](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Cheerfully%20Light)
  112. - [classic-modified](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Classic%20Modified)
  113. - [demain](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Demain)
  114. - [dimmed-fluid](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Dimmed%20Fluid)
  115. - [dracula](https://draculatheme.com/)
  116. - [gray-matter-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Gray%20Matter%20Dark)
  117. - [gruvbox-dark](https://github.com/morhetz/gruvbox)
  118. - [gruvbox-light](https://github.com/morhetz/gruvbox)
  119. - [idle](https://tmtheme-editor.herokuapp.com/#!/editor/theme/IDLE)
  120. - [inspired-github](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Inspiredgithub)
  121. - [ir-white](https://tmtheme-editor.herokuapp.com/#!/editor/theme/IR_White)
  122. - [kronuz](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Kronuz)
  123. - [material-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Material%20Dark)
  124. - [material-light](https://github.com/morhetz/gruvbox)
  125. - [monokai](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Monokai)
  126. - [solarized-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Solarized%20(dark))
  127. - [solarized-light](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Solarized%20(light))
  128. - [subway-madrid](https://github.com/idleberg/Subway.tmTheme)
  129. - [subway-moscow](https://github.com/idleberg/Subway.tmTheme)
  130. - [visual-studio-dark](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Visual%20Studio%20Dark)
  131. - [ayu-light](https://github.com/dempfi/ayu)
  132. - [ayu-dark](https://github.com/dempfi/ayu)
  133. - [ayu-mirage](https://github.com/dempfi/ayu)
  134. - [Tomorrow](https://tmtheme-editor.herokuapp.com/#!/editor/theme/Tomorrow)
  135. - [one-dark](https://github.com/andresmichel/one-dark-theme)
  136. - [zenburn](https://github.com/colinta/zenburn)
  137. Zola uses the Sublime Text themes, making it very easy to add more.
  138. If you want a theme not listed above, please open an issue or a pull request on the [Zola repo](https://github.com/getzola/zola).
  139. ## Slugification strategies
  140. By default, Zola will turn every path, taxonomies and anchors to a slug, an ASCII representation with no special characters.
  141. You can however change that strategy for each kind of item, if you want UTF-8 characters in your URLs for example. There are 3 strategies:
  142. - `on`: the default one, everything is turned into a slug
  143. - `safe`: characters that cannot exist in files on Windows (`<>:"/\|?*`) or Unix (`/`) are removed, everything else stays
  144. - `off`: nothing is changed, your site might not build on some OS and/or break various URL parsers
  145. Since there are no filename issues with anchors, the `safe` and `off` strategies are identical in their case: the only change
  146. is space being replaced by `_` since a space is not valid in an anchor.
  147. Note that if you are using a strategy other than the default, you will have to manually escape whitespace and Markdown
  148. tokens to be able to link to your pages. For example an internal link to a file named `some space.md` will need to be
  149. written like `some%20space.md` in your Markdown files.