Source

Yakha amathuluzi

Funda ukuthi zisetshenziswa kanjani izikripthi ze-Bootstrap ezifakiwe ze-npm ukuze wakhe amadokhumenti ethu, uhlanganise ikhodi yomthombo, wenze izivivinyo, nokuningi.

Ukusethwa kwamathuluzi

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:

  1. Landa futhi ufake i-Node.js , esiyisebenzisela ukuphatha ukuncika kwethu.
  2. Zulazulela kuhlu /bootstraplwemibhalo oluyimpande bese ugijima npm installukuze ufake okuncika kwethu kwendawo okusohlwini lwe- package.json .
  3. Faka iRuby , faka i - Bundler nge gem install bundler, bese ekugcineni uyisebenzise bundle 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.

Ukusebenzisa imibhalo ye-NPM

I- package.json yethu ifaka phakathi imiyalo nemisebenzi elandelayo:

Umsebenzi Incazelo
npm run dist npm run distidala /distuhla lwemibhalo olunamafayela ahlanganisiwe. Isebenzisa i- Sass , i-Autoprefixer , ne- UgifyJS .
npm test Kuyafana nokuthi npm run distyenza izivivinyo endaweni
npm run docs Yakha futhi ixhuma i-CSS ne-JavaScript yamadokhumenti. Ungabese uqhuba amadokhumenti endaweni nge- npm run docs-serve.

Gijimani npm runukuze ubone zonke izikripthi ze-npm.

Isiqalo esizenzakalelayo

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.

Amadokhumenti wendawo

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:

  1. Sebenzisa ukusetha kwamathuluzi ngenhla ukuze ufake i-Jekyll (umakhi wesayithi) nokunye okuncike ku-Ruby nge- bundle install.
  2. Kusuka /bootstrapkumkhombandlela wezimpande, sebenzisa npm run docs-serveumugqa womyalo.
  3. Vula http://localhost:9001esipheqululini sakho, futhi voilà.

Funda kabanzi ngokusebenzisa i-Jekyll ngokufunda imibhalo yayo .

Ukuxazulula inkinga

Uma kwenzeka uhlangabezana nezinkinga ngokufaka okuncikile, khipha zonke izinguqulo zangaphambilini zokuncika (ezomhlaba wonke nezasendaweni). Bese, phinda npm install.