You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Math support using [KaTeX](https://katex.org/) (with the help of \`\`\`latex \`\`\` for block math and $$$$ for inline math)
35
36
- User defined files
36
37
- Pages and subpages
37
38
- Easy configuration with YAML
@@ -44,7 +45,16 @@ But if you expect a fully-featured static site generator, you should use somethi
44
45
npm install @etermind/alex -g
45
46
```
46
47
47
-
You'll end up with `alex` in your PATH and then you can just do:
48
+
You'll end up with `alex` in your PATH. Then look at a theme [here](https://github.com/etermind/alex-themes) and download one.
49
+
50
+
Then you can do:
51
+
52
+
53
+
```sh
54
+
alex init -t PATH_TO_THEME -o OUTPUT_DIR_WITH_THEME_AND_CONTENT
55
+
```
56
+
57
+
Once you have configured and written your content, generate the HTML/CSS/JS for your website:
48
58
49
59
```sh
50
60
alex generate -i INPUT_DIR_WITH_CONTENT -o OUTPUT_DIR_WITH_GENERATED_SITE
@@ -61,7 +71,7 @@ which is going to serve your website on [http://localhost:4444](http://localhost
61
71
Let's try it out:
62
72
63
73
1. Download the example skeleton [here](./skeleton.tar.gz);
64
-
2. Then unzip the skeleton (`tar xzfv skeleton.tar.gz` should do);
74
+
2. Then unzip the skeleton (`tar xzfv skeleton.tar.gz` should do). The skeleton contains the [minimal-rb theme]() and some dummy content; if you want to use another theme, use `alex init` instead;
65
75
3. Then run `alex` with `alex generate -i skeleton -o mysite`;
66
76
4. You should end up with a folder called `mysite`;
67
77
5. Finally run `alex serve -p mysite -P 4444`, open [http://localhost:4444](http://localhost:4444) and admire your new site.
@@ -70,7 +80,7 @@ Let's try it out:
70
80
71
81
An Alex website is composed of:
72
82
73
-
-`config.yaml` where the main config of the website lies;
83
+
-`config.yml` where the main config of the website lies;
74
84
-`content` where all your markdown files are;
75
85
-`data` for user generated files and images;
76
86
-`theme` for the theme and the rendering of your site;
@@ -80,11 +90,8 @@ An Alex website is composed of:
- `title`which is the title of your website (often used in the `title` tag).
120
135
- `config`which allow you to define all supported languages for your website, the default language and the meta information
121
136
- `menu`which defines the main menu of your website.
137
+
- `theme`which defines variables specific to the theme you are using. This is optional.
122
138
123
139
#### Config section
124
140
@@ -127,7 +143,9 @@ The `config` section is divided into:
127
143
1. `langs`: A list of languages following the [ISO-639-1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (two letters to describe the language such as `fr` for French or `en` for English).
128
144
2. `defaultLang`: The default language of your website.
129
145
3. `defaultPage`: The default page of your website (it should match one of your menu item).
130
-
3. `meta`: The meta tags for your website.
146
+
4. `meta`: The meta tags for your website.
147
+
5. `scripts`: Optional list of JS scripts.
148
+
6. `rootPath`: When hosting your website under a subdirectory (useful for Gitlab pages or Github pages). This is optional.
131
149
132
150
*Meta*
133
151
@@ -140,9 +158,13 @@ The `config` section is divided into:
140
158
141
159
You can activate or deactivate a language by adding or removing a language here. Be aware that the theme you are using should support your default language, because if one of your other languages is not supported, we fallback to the default one.
142
160
161
+
*Scripts*
162
+
163
+
`scripts` is a list of JS scripts. This is optional. You have two flavors: using `content` or using `source`. The former is for inline scripts, while the latter is for scripts hosted elsewhere (on a CDN for instance). This is useful if you want to add [Google Analytics](https://analytics.google.com) or [Countly](https://count.ly) to your website.
164
+
143
165
#### Menu section
144
166
145
-
You can as many menu items as you want.
167
+
You can as many menu items as you want (the same goes for submenus).
146
168
147
169
In our example, `home` is going to be the first menu item and `code` the last one.
148
170
@@ -152,8 +174,11 @@ Each menu item is composed of:
152
174
2. A boolean called `external` to know if the item should redirect to an external page or not.
153
175
3. A boolean called `hide` to know if the item should be hidden in the menu.
154
176
4. If the item is external, you can specify a `link` and an optional `target`.
177
+
5. An icon (not supported by all themes). This is optional.
178
+
6. Submenus (not supported by all themes). This is optional.
155
179
156
180
### Managing content
181
+
157
182
All the content of your website lies in the `content` directory.
158
183
159
184
The content of the directory should look like this:
@@ -166,21 +191,34 @@ content
166
191
│ ├── description.md
167
192
│ └── subpage
168
193
│ ├── content.md
169
-
│ └── subsubpage
170
-
│ └── content.md
171
194
└── fr
172
195
└── home
173
196
├── content.md
174
197
├── description.md
175
198
└── subpage
176
199
├── content.md
177
-
└── subsubpage
178
-
└── content.md
179
200
```
180
201
181
202
1. 1 directory per language: here we have two languages: `fr` and `en`).
182
203
2. 1 directory per internal menu item: here we have only one internal menu item which is home (since `external: false`).
183
-
3. As many directories as you want per subpages in a recursive manner. We have `subpage` and `subsubpage` in the example.
204
+
3. As many directories as you want per subpages in a recursive manner. They need to be linked into a submenu. For instance:
205
+
206
+
```yaml
207
+
menu:
208
+
-
209
+
content: home
210
+
name:
211
+
fr: 'Accueil'
212
+
en: 'Home'
213
+
external: false
214
+
hide: false
215
+
submenus:
216
+
-
217
+
content: subpage
218
+
name:
219
+
fr: 'Sous-page'
220
+
en: 'Subpage'
221
+
```
184
222
185
223
The default content is written in a file called `content.md`. Your theme may allow you to have more than one markdown file per template (see the *Writing themes* section for details), but it is not mandatory.
186
224
@@ -216,10 +254,12 @@ data
216
254
217
255
In your markdown you can the images in data using `/assets/user/imgs/test.png` and the other files using `/assets/user/files/article.pdf`.
218
256
219
-
## Writing new themes
257
+
## Themes
258
+
259
+
Alex comes with multiple themes. Check out the [dedicated repo](https://github.com/etermind/alex-themes).
220
260
221
-
If you would like to customize or create a new theme. Please read [this](./THEMES.md)
261
+
If you would like to customize or create a new theme. Please read [this](https://github.com/etermind/alex-themes/blob/master/THEMES.md).
222
262
223
263
## Contributing
224
264
225
-
If you would like to contributing, please read [this](./CONTRIBUTING.md)
265
+
If you would like to contributing, please read [this](./CONTRIBUTING.md).
0 commit comments