Skip to content

Commit a72471e

Browse files
committed
cleanup
1 parent 523ca9d commit a72471e

8 files changed

Lines changed: 51 additions & 249 deletions

File tree

.jshintrc

Lines changed: 0 additions & 19 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

CONTRIBUTORS.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

INSTALL.md

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
Документация на русском - см. INSTALL.ru.md (Russian docs -- see INSTALL.ru.md).
3-
42
# Up and running locally
53

64
## 1. OS
@@ -19,136 +17,138 @@ MongoDB - can be either 2.6+ or newer.
1917

2018
Use packages for Linux, [MacPorts](http://www.macports.org/install.php) or [Homebrew](http://brew.sh) for Mac.
2119

22-
Если через MacPorts, то:
20+
If you have macports then:
2321
```
2422
sudo port install mongodb
2523
sudo port load mongodb
2624
```
2725

28-
## 3. Клонируйте репозитарий
26+
## 3. Clone the tutorial server
27+
28+
Hopefully, you have Git installed and running.
2929

30-
Предположу, что Git у вас уже стоит и вы умеете им пользоваться.
30+
Clone the tutorial server:
3131

32-
Клонируйте только ветку `master` движка:
3332
```
3433
cd /js
35-
git clone -b master --single-branch https://github.com/iliakan/javascript-nodejs
34+
git clone https://github.com/iliakan/javascript-tutorial-server
3635
```
3736

37+
## 4. Install global modules
3838

39-
## 4. Глобальные модули
40-
41-
Поставьте глобальные модули:
39+
Install these:
4240

4341
```
4442
npm install -g mocha bunyan gulp nodemon
4543
```
4644

47-
Чтобы автоматически ставилась переменная `NODE_PATH`, для запуска `gulp` далее используется команда: `npm --silent run gulp --`.
45+
To set up `NODE_PATH` environment variable, further on we use an alias for running `gulp`:
4846

49-
На практике для удобства используется alias:
5047
```
5148
alias glp="npm --silent run gulp -- "
5249
```
5350

54-
Или же можно запускать gulp как: `NODE_PATH=./handlers:./modules gulp`.
51+
Or, without the alias, you can run gulp as: `NODE_PATH=./handlers:./modules gulp ...`.
5552

56-
## 5. Системные пакеты
53+
Or like this: `npm --silent run gulp -- ...`.
5754

58-
Для работы также нужны Nginx, GraphicsMagick и ImageMagick (обычно используется GM, он лучше, но иногда IM).
55+
## 5. System packages
5956

60-
Под Macports команды такие:
57+
You'll also need to install nginx and GraphicsMagick (for image resizing).
58+
59+
For MacPorts, the commands are:
6160

6261
```
63-
sudo port install ImageMagick GraphicsMagick
62+
sudo port install GraphicsMagick
6463
sudo port install nginx +debug+gzip_static+realip+geoip
6564
6665
sudo port load nginx
6766
```
6867

6968
## 6. npm install
7069

71-
В директории, в которую клонировали, запустите:
70+
In the directory with javascript-tutorial-server, run:
7271

7372
```
7473
npm install
7574
```
7675

77-
## 7. Конфигурация Nginx с нуля
76+
## 7. Configuring Nginx from scratch
77+
78+
If you had no nginx before, then everything is simple.
7879

79-
Если в системе ранее не стоял nginx, то поставьте его.
80+
The logs directory is `/var/log/nginx`.
8081

81-
Логи nginx пишет в директорию `/var/log/nginx`.
82+
Create it and set owner/permissions. For a personal computer, can do it like this:
8283

83-
Если её нет, то нужно создать и поставить пермишны/владельца. Например, если компьютер – ваш личный, то запустить от рута:
8484
```
8585
mkdir /var/log/nginx
8686
chmod 777 /var/log/nginx
8787
```
8888

89-
Cтавим настройки для сайта запуском:
89+
Create configs by running:
9090
```
91-
npm --silent run gulp -- config:nginx --prefix /opt/local/etc/nginx --root /js/javascript-nodejs --env development --clear
91+
npm --silent run gulp -- config:nginx --prefix /opt/local/etc/nginx --root /js/javascript-tutorial-server --env development --clear
9292
```
9393

94-
Здесь `--prefix` -- место для конфигов nginx, обычно `/etc/nginx`, в случае MacPorts это `/opt/local/etc/nginx`.
95-
В параметр `--root` запишите место установки сайта.
94+
Here `--prefix` -- is the directory for nginx config, usually `/etc/nginx`, for MacPorts it's `/opt/local/etc/nginx`.
9695

97-
В `--root` находится путь к движку: если вы использовали другой путь для сайта, вместо `/js/javascript-nodejs`, то измените его.
96+
The `--root` is where the server is located. If you used another path instead of `/js/javascript-tutorial-server`, then change it.
9897

99-
Опция `--clear` полностью удалит старые конфиги nginx.
98+
The `--clear` option clears all configs before creating the new ones. That's fine if you had no nginx before.
10099

101-
Также рекомендуется в `/etc/hosts` добавить строку:
100+
Also it's recommended to add this line to `/etc/hosts`:
102101
```
103102
127.0.0.1 javascript.in
104103
```
105104

106-
Такое имя хоста стоит в конфигурации Nginx.
105+
This host name is in the Nginx config already.
107106

108107
## 7.1. Если Nginx у вас уже стоит
109108

110-
Если уже есть nginx, то сделайте резервную копию всех его конфигов.
109+
If you already have nginx, make a backup of it's config files.
111110

112-
После этого выполните предыдущую секцию без `--clear` в команде:
111+
Then execute the prevous section without the `--clear` at the end:
113112

114113
```
115114
npm --silent run gulp -- config:nginx --prefix /opt/local/etc/nginx --root /js/javascript-nodejs --env development
116115
```
117116

118-
Такая команда скопирует файлы из директории `/js/javascript-nodejs/nginx` в указанную директорию `--prefix`, но без перезаписывания.
119-
При копировании используется небольшая шаблонизация конфигов, т.е. это не просто `cp`, но структура файлов остаётся такой же.
117+
The command copies files from the directory `/js/javascript-tutorial-server/nginx` into the folder `--prefix`, but without removing old configs.
120118

121-
Основные конфиги будут перезаписаны, но в `sites-enabled` останутся и будут подключены и другие сайты.
119+
So if you had other sites in `sites-enabled`, they will not be removed.
122120

123-
Перезапустите Nginx. Проверьте, что ваши предыдущие проекты работают.
121+
Rerun nginx. Make sure your existing projects work.
124122

123+
## 8. Database
125124

126-
## 8. База
125+
Copy the tutorial repo, for instance `javascript-tutorial-en`
127126

128-
Клонируйте ветку учебника, например `ru`:
129127
```
130128
cd /js
131-
git clone -b ru --single-branch https://github.com/iliakan/javascript-tutorial
129+
git clone https://github.com/iliakan/javascript-tutorial-en
132130
```
133131

134-
После клонирования импортируйте учебник в базу командой:
132+
After that, import it with the command:
135133
```
136-
PLUNK_REMOTE_OFF=1 npm --silent run gulp -- tutorial:import --root /js/javascript-tutorial
134+
PLUNK_REMOTE_OFF=1 npm --silent run gulp -- tutorial:import --root /js/javascript-tutorial-en
137135
```
138136

139-
Здесь `/js/javascript-tutorial` -- директория с репозитарием учебника.
137+
Here `/js/javascript-tutorial-en` -- the directory with the tutorial repository.
140138

141-
`PLUNK_REMOTE_OFF=1` отключает автоматическую загрузку примеров из учебников на сервис plnkr.co.
142-
Она требует настройки сессии на plnkr.co и нужна при публикации учебника.
143-
Для запуска проекта она не нужна, особенно если вас интересуют другие модули.
139+
`PLUNK_REMOTE_OFF=1` disables automatic uploading of examples to plnkr.co.
140+
That requires to setup a plnkr session, and is not necessary to run the tutorial.
144141

145-
## 9. Запуск сайта
142+
## 9. Run the site
146143

147-
Запуск сайта в режиме разработки:
144+
Run the site with the language in `NODE_LANG` variable:
148145
```
149-
NODE_LANG=ru ./dev
146+
NODE_LANG=en ./dev
150147
```
151148

149+
That builds all styles and runs the website.
150+
151+
Please note: Node.JS server is running at `127.0.0.1:3000`, but to get styles and scripts, you should use `127.0.0.1:80`
152152
Это поднимет сразу и сайт и механизмы автосборки стилей-скриптов и livereload.
153153

154154
Обратите внимание: ходить на сайт нужно через Nginx (обычно порт 80), не напрямую в Node.JS (не будет статики).

browserslist

Lines changed: 0 additions & 2 deletions
This file was deleted.

ecosystem.json

Lines changed: 0 additions & 81 deletions
This file was deleted.
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
11
include /blocks/sidebar
22

3-
+e.section
4-
+e.section-title= t('site.share')
5-
+b('a').share._tw.sidebar__share(href="https://twitter.com/share?url="+encodeURIComponent(url.href))
6-
//- [] encoded as %5B %5D to make validator happy
7-
+b('a').share._fb.sidebar__share(href="https://www.facebook.com/sharer/sharer.php?s=100&p%5Burl%5D="+encodeURIComponent(url.href))
8-
+b('a').share._gp.sidebar__share(href="https://plus.google.com/share?url="+encodeURIComponent(url.href))
9-
if env.NODE_LANG=='ru'
10-
+b('a').share._vk.sidebar__share(href="https://vkontakte.ru/share.php?url="+encodeURIComponent(url.href))
11-
12-
if githubLink
13-
+e.section
14-
+e('a').link(href=githubLink)= t('site.edit_on_github')
15-

0 commit comments

Comments
 (0)