Skip to content

Commit c2c567c

Browse files
author
Sumit Khanna
committed
Updated usage instructions
1 parent 16c4473 commit c2c567c

File tree

1 file changed

+101
-9
lines changed

1 file changed

+101
-9
lines changed

README.md

Lines changed: 101 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ To install the current release, run the following:
1919

2020
To install from source:
2121

22-
* Install the [jekyll-unsanitize](https://github.com/sumdog/jekyll-unsanitize) dependency.
23-
2422
git clone https://github.com/sumdog/jekyll-multisite
2523
cd jekyll-multisite
2624
gem build jekyll-multisite.gemspec
@@ -35,15 +33,109 @@ In your `_config.yml`, add the following section:
3533
gems:
3634
- jekyll-multisite
3735

38-
shared: ../_shared
36+
shared: _shared
3937
shared_pagination: true
4038
...
4139

42-
Each individual site needs to have it's own configuration file with it's own source and destination. Let's use `_example.yml` to demonstrate:
40+
Each individual site needs to have it's own configuration file with it's own source and destination. Let's use `_example_com.yml` to demonstrate:
41+
42+
...
43+
title: Example dot Com
44+
url: http://example.com
45+
destination: _site/example.com
46+
source: '_example.com'
47+
exclude: ['some-file.md']
48+
...
49+
50+
Now, lets' create a second site as well, in a file called `_example_net.yml`
4351

4452
...
45-
url: "http://example.com"
46-
destination: _site/example
47-
source: '_example'
48-
49-
Due to the way things are done internally in Jekyll, the shared source directory must be relative to to the source path. More information can be found on the [Jekyll Multi-site](http://penguindreams.org/insert-address-here) blog post.
53+
title: Example dot Net
54+
url: http://example.net
55+
destination: _site/example.net
56+
source: '_example.net'
57+
exclude: ['some-other-file.md']
58+
...
59+
60+
Finally, we need a base `_config.yml` that declares all the settings that are shared:
61+
62+
63+
baseurl: ""
64+
paginate: 10
65+
gems:
66+
- jekyll-multisite
67+
- jekyll-paginate
68+
69+
markdown: kramdown
70+
71+
layouts_dir: _layouts
72+
includes_dir: _includes
73+
plugins_dir: _plugins
74+
shared_dir: _shared
75+
shared_pagination: true
76+
77+
include: ['.htaccess']
78+
79+
sass:
80+
sass_dir: _sass
81+
style: compressed
82+
83+
84+
Due to the way things are done internally in Jekyll and the limitation of my plugin, the shared source directory must be one directory down from the source path. Your directory structure should look like the following:
85+
86+
```
87+
.
88+
├── _config.yml
89+
├── _example.com
90+
│   ├── about.md
91+
│   ├── css
92+
│   ├── _data
93+
│   ├── _drafts
94+
│   ├── favicon.ico
95+
│   ├── files
96+
│   ├── images
97+
│   ├── _plugins -> ../_plugins/
98+
│   ├── _posts
99+
│   └── videos.html
100+
├── _example_com.yml
101+
├── _example.net
102+
│   ├── about.md
103+
│   ├── css
104+
│   ├── _data
105+
│   ├── _drafts
106+
│   ├── favicon.ico
107+
│   ├── files
108+
│   ├── images
109+
│   ├── _plugins -> ../_plugins/
110+
│   ├── _posts
111+
│   └── videos.html
112+
├── _example_net.yml
113+
├── _shared
114+
│   ├── 404.html
115+
│   ├── archives.md
116+
│   ├── contact.md
117+
│   ├── css
118+
│   ├── feed.xml
119+
│   ├── fonts
120+
│   ├── index.html
121+
│   └── js
122+
├── _includes
123+
├── _layouts
124+
└── _plugins
125+
```
126+
127+
Take care to notice you still need a symbolic link for `_plugins` to work correctly (I'm working on fixing that). When you build you sites, built them like so:
128+
129+
jekyll build --config _config.yml,_example_net.yml
130+
jekyll build --config _config.yml,_example_com.yml
131+
132+
Things to note:
133+
134+
# Due to a bug, you still need to symbolic link `_plugins` from your base to the site source
135+
# Watching and dynamic updating of changed to the `_shared` directory doesn't currently work
136+
# `_shared` must be one directory below (../) the source for each website.
137+
# If you have something in both the site source and the shared source, the shared will overwrite what is in the site source
138+
# I had to monkey patch the pagination plugin to work with this setup. You may have to adjust other plugins for multi-site support
139+
# The shared output is actually generated in `_site` and moved after generation is complete
140+
# This entire plugin is very hacky and does some interesting stuff under the hood to get multi-site working.
141+
# Only tested on Jekyll 3.0.1. Other versions will most likely not work.

0 commit comments

Comments
 (0)