Documentation : `new-theme` command

This commit is contained in:
Frank Taillandier 2016-08-05 21:11:39 +02:00
parent bc7eb70385
commit 6ab8b5ffe1
1 changed files with 20 additions and 13 deletions

View File

@ -36,20 +36,27 @@ Refer to your selected theme's documentation and source repository for more info
## Creating a theme ## Creating a theme
Jekyll themes are distributed as Ruby gems. The only required file is the [Ruby Gemspec](http://guides.rubygems.org/specification-reference/). Here's an example of a minimal Gemspec for the `my-awesome-jekyll-theme` theme, saved as `/my-awsome-jekyll-theme.gemspec`: Jekyll themes are distributed as Ruby gems. Don't worry Jekyll will help you scaffold a new theme with the `new-theme` command. Just run `jekyll new-theme` with the theme name as an argument:
{% highlight ruby %} {% highlight shell %}
Gem::Specification.new do |s| jekyll new-theme my-awesome-theme
s.name = '<THEME TITLE>' create /path/to/my-awesome-theme/_layouts
s.version = '0.1.0' create /path/to/my-awesome-theme/_includes
s.license = 'MIT' create /path/to/my-awesome-theme/_sass
s.summary = '<THEME DESCRIPTION>' create /path/to/my-awesome-theme/_layouts/page.html
s.author = '<YOUR NAME>' create /path/to/my-awesome-theme/_layouts/post.html
s.email = '<YOUR EMAIL>' create /path/to/my-awesome-theme/_layouts/default.html
s.homepage = 'https://github.com/jekyll/my-awesome-jekyll-theme' create /path/to/my-awesome-theme/Gemfile
s.files = `git ls-files -z`.split("\x0").grep(%r{^_(sass|includes|layouts)/}) create /path/to/my-awesome-theme/my-awesome-theme.gemspec
end create /path/to/my-awesome-theme/README.md
{% endhighlight %} create /path/to/my-awesome-theme/LICENSE.txt
initialize /path/to/my-awesome-theme/.git
create /path/to/my-awesome-theme/.gitignore
Your new Jekyll theme, my-awesome-theme, is ready for you in /path/to/my-awesome-theme!
For help getting started, read /path/to/my-awesome-theme/README.md.
{% hightlight %}
Add your template files in the corresponding folders, complete the `.gemspec` and the README files according to your needs.
### Layouts and includes ### Layouts and includes