Skip to content

Commit 26de700

Browse files
Update themes.md
1 parent c078228 commit 26de700

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

recipes/jekyll/themes.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
11
# Themes
22
> Creating and maintaining a GitHub theme
33
4+
## Notes
5+
6+
See the docs for structure in general not just Jekyll - [What is a gem?](https://guides.rubygems.org/what-is-a-gem/).
7+
8+
See [Specification](https://ruby-doc.org/stdlib-2.7.0/libdoc/rubygems/rdoc/Gem/Specification.html) in Ruby docs.
9+
10+
### Gemspec
11+
12+
- The `*.gemspec` file is used to package the theme as gem.
13+
- Here are ways to add required dependencies. These are not actually installed when you install the gem, but the theme will give an error to say they are missing (at least this is the way it works with Remote Theme.
14+
```ruby
15+
spec.add_runtime_dependency 'example'
16+
spec.add_runtime_dependency 'example', '~> 1.1', '>= 1.1.4'
17+
18+
spec.add_dependency 'example' # alias for add_runtime_dependency
19+
20+
spec.add_development_dependency 'example'
21+
```
22+
23+
### Gemfile
24+
25+
- A `Gemfile` is not needed in the theme. If it is included, it is only for testing the project and it is not passed to a downstream project.
26+
- The `gemspec` command in the `Gemfile` will install dependencies from the `*.gemspec` file.
27+
428

529
## Samples
630

@@ -10,12 +34,18 @@ My own quickstart theme project.
1034

1135
[![MichaelCurrin - jekyll-theme-quickstart](https://img.shields.io/static/v1?label=MichaelCurrin&message=jekyll-theme-quickstart&color=blue&logo=github)](https://github.com/MichaelCurrin/jekyll-theme-quickstart)
1236

37+
### Installed
38+
39+
Have a look at gemspec files for installed gems in your project:
40+
41+
```sh
42+
$ ls vendor/bundle/ruby/2.7.0/specifications
43+
```
44+
1345
### Minima
1446

1547
Pieces from the [Minima](https://github.com/jekyll/minima) theme, to help with build your theme.
1648

17-
As in Minima, you can add gems to your theme's `*.gemspec` file. That means you don't have to add them to your project's `Gemfile`.
18-
1949
- `Gemfile`
2050
```ruby
2151
# frozen_string_literal: true

0 commit comments

Comments
 (0)