Yakha amathuluzi
Funda ukuthi zisetshenziswa kanjani izikripthi ze-Bootstrap ezifakiwe ze-npm ukuze wakhe amadokhumenti ethu, uhlanganise ikhodi yomthombo, wenze izivivinyo, nokuningi.
I-Bootstrap isebenzisa imibhalo ye-NPM kusistimu yayo yokwakha. I- package.json yethu ihlanganisa izindlela ezikahle zokusebenza ngohlaka, okuhlanganisa ukuhlanganisa ikhodi, ukuqalisa ukuhlola, nokunye okwengeziwe.
Ukuze usebenzise isistimu yethu yokwakha nokusebenzisa imibhalo yethu endaweni, uzodinga ikhophi yamafayela omthombo we-Bootstrap kanye ne-Node. Landela lezi zinyathelo futhi kufanele ulungele ukuzamazama:
- Landa futhi ufake i-Node.js , esiyisebenzisela ukuphatha ukuncika kwethu.
- Zulazulela kuhlu
/bootstrap
lwemibhalo oluyimpande bese ugijimanpm install
ukuze ufake okuncika kwethu kwendawo okusohlwini lwe- package.json . - Faka iRuby , faka i - Bundler nge
gem install bundler
, bese ekugcineni uyisebenzisebundle install
. Lokhu kuzofaka konke okuncike ku-Ruby, njenge-Jekyll nama-plugin.- Abasebenzisi beWindows: Funda lo mhlahlandlela ukuze wenze i-Jekyll isebenze ngaphandle kwezinkinga.
Uma usuqedile, uzokwazi ukusebenzisa imiyalo ehlukahlukene enikelwe emugqeni womyalo.
I- package.json yethu ifaka phakathi imiyalo nemisebenzi elandelayo:
Umsebenzi | Incazelo |
---|---|
npm run dist |
npm run dist idala /dist uhla lwemibhalo olunamafayela ahlanganisiwe. Isebenzisa i- Sass , i-Autoprefixer , ne- UgifyJS . |
npm test |
Kuyafana nokuthi npm run dist yenza izivivinyo endaweni |
npm run docs |
Yakha futhi ixhuma i-CSS ne-JavaScript yamadokhumenti. Ungabese uqhuba amadokhumenti endaweni nge- npm run docs-serve . |
Gijimani npm run
ukuze ubone zonke izikripthi ze-npm.
I -Bootstrap isebenzisa i -Autoprefixer (efakwe kunqubo yethu yokwakha) ukwengeza ngokuzenzakalelayo iziqalo zomthengisi kwezinye izakhiwo ze-CSS ngesikhathi sokwakha. Ukwenza kanjalo kusisindisa isikhathi nekhodi ngokusivumela ukuthi sibhale izingxenye ezibalulekile ze-CSS yethu ngesikhathi esisodwa kuyilapho sisusa isidingo sezingxube zabathengisi njengalezo ezitholakala ku-v3.
Sigcina uhlu lweziphequluli ezisekelwa nge-Autoprefixer kufayela elihlukile ngaphakathi kwendawo yethu ye-GitHub. Bona /package.json ukuze uthole imininingwane.
Ukuqalisa amadokhumenti ethu endaweni kudinga ukusetshenziswa kwe-Jekyll, ijeneretha yesayithi eguqukayo eguquguquka kahle esinikeza: okuyisisekelo kuhlanganisa, amafayela asekelwe ku-Markdown, izifanekiso, nokuningi. Nansi indlela yokuyiqalisa:
- Sebenzisa ukusetha kwamathuluzi ngenhla ukuze ufake i-Jekyll (umakhi wesayithi) nokunye okuncike ku-Ruby nge-
bundle install
. - Kusuka
/bootstrap
kumkhombandlela wezimpande, sebenzisanpm run docs-serve
umugqa womyalo. - Vula
http://localhost:9001
esipheqululini sakho, futhi voilà.
Funda kabanzi ngokusebenzisa i-Jekyll ngokufunda imibhalo yayo .
Uma kwenzeka uhlangabezana nezinkinga ngokufaka okuncikile, khipha zonke izinguqulo zangaphambilini zokuncika (ezomhlaba wonke nezasendaweni). Bese, phinda npm install
.