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.

creating-a-theme.md 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. +++
  2. title = "Creating a theme"
  3. weight = 30
  4. +++
  5. Creating is exactly like creating a normal site with Gutenberg, except you
  6. will want to use many [Tera blocks](https://tera.netlify.com/docs/templates/#inheritance) to
  7. allow users to easily modify it.
  8. A theme also need to have a `theme.toml` configuration file with the
  9. following fields, here's the one from a [real template](https://github.com/Keats/hyde):
  10. ```toml
  11. name = "hyde"
  12. description = "A classic blog theme"
  13. license = "MIT"
  14. homepage = "https://github.com/Keats/gutenberg-hyde"
  15. # The minimum version of Gutenberg required
  16. min_version = "0.1"
  17. # Any variable there can be overriden in the end user `config.toml`
  18. # You don't need to prefix variables by the theme name but as this will
  19. # be merged with user data, some kind of prefix or nesting is preferable
  20. # Use snake_casing to be consistent with the rest of Gutenberg
  21. [extra]
  22. hyde_sticky = true
  23. hyde_reverse = false
  24. hyde_theme = ""
  25. hyde_links = [
  26. {url = "https://google.com", name = "Google.com"},
  27. {url = "https://google.fr", name = "Google.fr"},
  28. ]
  29. # The theme author info: you!
  30. [author]
  31. name = "Vincent Prouillet"
  32. homepage = "https://vincent.is"
  33. # If this is porting a theme from another static site engine, provide
  34. # the info of the original author here
  35. [original]
  36. author = "mdo"
  37. homepage = "http://markdotto.com/"
  38. repo = "https://www.github.com/mdo/hyde"
  39. ```
  40. A theme will also need three directories to work:
  41. - `static`: any static files used in this theme
  42. - `templates`: all templates used in this theme
  43. - `sass`: Sass stylesheets for this theme, can be empty
  44. To be featured on this site, the theme will require two more things:
  45. - `screenshot.png`: a screenshot of the theme in action, its size needs to be reasonable
  46. - `README.md`: a thorough README explaining how to use the theme and any other information
  47. of importance
  48. A simple theme you can use as example is [Hyde](https://github.com/Keats/hyde).