-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnotes.txt
126 lines (110 loc) · 5.14 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
DEPENDENCIES:
* Run all of the following as admin
1. [OPTIONAL] Install chocolatey.org (package manager for easier installation and upgrade)
2. Install NodeJS using `choco install nodejs --version 11.15.0`
3. Install Ruby with Devkit (https://rubyinstaller.org/add-ons/devkit.html)
4. Install Bundler (bundler.io) using `gem install bundler`
5. Install http://www.msys2.org/ (`bundle install` and `bundle update` need this)
6. Install gulp using `npm install gulp@3.9.1` (gulpfile.js is written for gulp v3)
7. Link gulp using `npm link gulp` to use the global version of gulp
8. Install other dependencies (i.e. gulp-concat, gulp-sass, gulp-string-replace,
gulp-rename, gulp-clean) by running `npm install` on root folder
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
[ALT 1] TO USE MINIBUNDLE (alternative to Gulp concat + jekyll-assets):
Simply include this block (no tabs!) --replace 'js' with css for bundling stylesheets:
{% minibundle js %}
source_dir: _assets/js
destination_path: assets
minifier_cmd: node_modules/uglifyjs/bin/uglifyjs
assets:
- mo.min
- jquery-2.1.4.min
- bootstrap.min
- owl.carousel.min
- magnific-popup.min
- circle-progress.min
- main
attributes:
id: my-scripts
{% endminibundle %}
or put minifier command inside the _config.yml like this:
minibundle:
minifier_commands:
css: node_modules/.bin/uglifycss
js: node_modules/.bin/uglifyjs
(note: to get the minifier, do npm install uglifyjs and npm install uglifycss,
then retrieve the folders/files from node_modules)
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
[ALT 2 (1/2)] TO USE GULP (for bundling):
Create gulpfile.js consisting of concatJS and concatCSS tasks (using sass and gulp-concat)
and don't forget to exclude it in _config.yml like this:
exclude:
- package.json
- node_modules
- gulpfile.js
Run 'gulp' for default task, or e.g. gulp taskName for any other tasks.
Current setup: run 'gulp clean' to delete all.js and all.scss, then run 'gulp' to concat JS
and CSS (followed by jekyll to build to _site)
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
[ALT 2 (2/2)] TO USE JEKYLL-ASSETS:
Rename all .css files to .scss (sass compatibility)
To minify, put this inside the _config.yml file:
compression: true
assets:
compress:
css: sass
js: uglifier
(note: sass and uglifier must be installed)
Then put this to include files in html:
<!-- Google Fonts -->
{% css fonts.googleapis.com.josefin.min.css %}
<!-- Stylesheets -->
{% css bootstrap.min.css %}
{% css font-awesome.min.css %}
{% css owl.carousel.min.css %}
{% css magnific-popup.min.css %}
{% css style.css %}
<!--====== Javascripts & Jquery ======-->
{% js mo.min.js %}
{% js jquery-2.1.4.min.js %}
{% js bootstrap.min.js %}
{% js owl.carousel.min.js %}
{% js magnific-popup.min.js %}
{% js circle-progress.min.js %}
{% js main.js %}
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
TO RUN JEKYLL SITE LOCALLY:
Add this to Gemfile
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
Then using Git Bash, navigate to root and do `bundle install`
Also do `bundle update` ocassionally
To run, do `bundle exec jekyll serve`
NOTE: Jekyll will overwrite the _site folder, so make sure you have what you need, e.g.
make sure CNAME and other important files are not deleted
To ensure the site is production ready, run `bundle exec jekyll build` before pushing changes.
This will ensure that the sitemap is overwritten with the production url.
Sitemap is automatically generated by 'jekyll-sitemap' plugin.
But please ensure to include:
```
url: "url: https://natashapetrus.com"
plugins:
- jekyll-sitemap
```
in _config.yml. Otherwise, the plugin may not work correctly.
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
KNOWN ERRORS:
1. ERROR: `ffi-1.9.25-x64-mingw32 requires ruby version < 2.6, which is incompatible with
the current version, ruby 2.6.4p104` when running `bundle install`
SOLUTION: Simply run `bundle update` instead
2. ERROR: `ReferenceError: primordials is not defined`
SOLUTION: Make sure to install and run NodeJS < v12
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------