Skip to content

Commit 79eba51

Browse files
author
Corentin Ribeyre
committed
Merge branch 'release/1.0.0' into master
2 parents 3a47241 + b7ed2c5 commit 79eba51

37 files changed

+1417
-748
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Core Components TypeScript
3+
Copyright (c) 2020 Alex!
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 64 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[release-image]:https://img.shields.io/github/release/etermind/alex.svg?style=flat-square
77
[release-url]:https://github.com/etermind/alex/releases/latest
88
[license-image]:http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
9-
[license-url]:LICENSE.txt
9+
[license-url]:LICENSE
1010

1111
Welcome to Alex!
1212

@@ -32,6 +32,7 @@ Alex is powerful enough! He supports:
3232
- Themes
3333
- Code highlighting (using [highlightjs](https://highlightjs.org))
3434
- Markdown (Github flavor) with YAML metadata
35+
- Math support using [KaTeX](https://katex.org/) (with the help of \`\`\`latex \`\`\` for block math and $$ $$ for inline math)
3536
- User defined files
3637
- Pages and subpages
3738
- Easy configuration with YAML
@@ -44,7 +45,16 @@ But if you expect a fully-featured static site generator, you should use somethi
4445
npm install @etermind/alex -g
4546
```
4647

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:
4858

4959
```sh
5060
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
6171
Let's try it out:
6272

6373
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;
6575
3. Then run `alex` with `alex generate -i skeleton -o mysite`;
6676
4. You should end up with a folder called `mysite`;
6777
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:
7080

7181
An Alex website is composed of:
7282

73-
- `config.yaml` where the main config of the website lies;
83+
- `config.yml` where the main config of the website lies;
7484
- `content` where all your markdown files are;
7585
- `data` for user generated files and images;
7686
- `theme` for the theme and the rendering of your site;
@@ -80,11 +90,8 @@ An Alex website is composed of:
8090
Here is a simple `config.yaml` file:
8191

8292
```yaml
83-
title:
84-
fr: 'Mon titre'
85-
en: 'Your title'
86-
8793
config:
94+
rootPath: ''
8895
langs:
8996
- en
9097
- fr
@@ -97,15 +104,24 @@ config:
97104
keywords:
98105
- awesome
99106
- site
100-
- alex
107+
- alex
108+
scripts:
109+
-
110+
content: >
111+
const test = 'Blablabla';
112+
-
113+
source: 'https://cdn.jsdelivr.net/npm/katex@0.11.0/dist/katex.js'
101114
menu:
102-
home:
115+
-
116+
content: home
103117
name:
104118
fr: 'Accueil'
105119
en: 'Home'
106120
external: false
107-
hide: false
108-
code:
121+
hide: false
122+
submenus: []
123+
-
124+
content: code
109125
name:
110126
fr: 'Code'
111127
en: 'Code'
@@ -114,11 +130,11 @@ menu:
114130
target: '_blank'
115131
```
116132
117-
A `config.yaml` is composed of 3 sections:
133+
A `config.yml` is composed of 3 sections:
118134

119-
- `title` which is the title of your website (often used in the `title` tag).
120135
- `config` which allow you to define all supported languages for your website, the default language and the meta information
121136
- `menu` which defines the main menu of your website.
137+
- `theme` which defines variables specific to the theme you are using. This is optional.
122138

123139
#### Config section
124140

@@ -127,7 +143,9 @@ The `config` section is divided into:
127143
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).
128144
2. `defaultLang`: The default language of your website.
129145
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.
131149

132150
*Meta*
133151

@@ -140,9 +158,13 @@ The `config` section is divided into:
140158

141159
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.
142160

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+
143165
#### Menu section
144166

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).
146168

147169
In our example, `home` is going to be the first menu item and `code` the last one.
148170

@@ -152,8 +174,11 @@ Each menu item is composed of:
152174
2. A boolean called `external` to know if the item should redirect to an external page or not.
153175
3. A boolean called `hide` to know if the item should be hidden in the menu.
154176
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.
155179

156180
### Managing content
181+
157182
All the content of your website lies in the `content` directory.
158183

159184
The content of the directory should look like this:
@@ -166,21 +191,34 @@ content
166191
│   ├── description.md
167192
│   └── subpage
168193
│   ├── content.md
169-
│   └── subsubpage
170-
│   └── content.md
171194
└── fr
172195
└── home
173196
├── content.md
174197
├── description.md
175198
└── subpage
176199
├── content.md
177-
└── subsubpage
178-
└── content.md
179200
```
180201

181202
1. 1 directory per language: here we have two languages: `fr` and `en`).
182203
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+
```
184222

185223
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.
186224

@@ -216,10 +254,12 @@ data
216254

217255
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`.
218256

219-
## Writing new themes
257+
## Themes
258+
259+
Alex comes with multiple themes. Check out the [dedicated repo](https://github.com/etermind/alex-themes).
220260

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).
222262

223263
## Contributing
224264

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

Comments
 (0)