Source

Yakha izixhobo

Funda indlela yokusebenzisa i-Bootstrap equkiweyo yemibhalo eshicilelweyo ye-npm ukwakha amaxwebhu ethu, ukuqokelela ikhowudi yemvelaphi, ukuqhuba iimvavanyo, kunye nokunye.

Ukuseta izixhobo

I-Bootstrap isebenzisa izikripthi ze-NPM zenkqubo yayo yokwakha. Iphakheji.json yethu ibandakanya iindlela ezifanelekileyo zokusebenza kunye nesakhelo, kubandakanya ukuqulunqa ikhowudi, ukuqhuba iimvavanyo, kunye nokunye.

Ukusebenzisa inkqubo yethu yokwakha kwaye usebenzise amaxwebhu ethu ekuhlaleni, uya kufuna ikopi yeefayile zemvelaphi yeBootstrap kunye neNode. Landela la manyathelo kwaye kuya kufuneka ukuba ulungele ukushukuma:

  1. Khuphela kwaye ufake i-Node.js , esiyisebenzisayo ukulawula ukuxhomekeka kwethu.
  2. Lawula kulawulo lweengcambu /bootstrapkwaye ubaleke npm installukufaka ukuxhomekeka kwethu kwendawo edweliswe kwi package.json .
  3. Faka iRuby , faka iBundler nge gem install bundler, kwaye ekugqibeleni usebenze bundle install. Oku kuya kufaka zonke izinto ezixhomekeke kuRuby, ezifana neJekyll kunye neeplagi.
    • Abasebenzisi beWindows: Funda esi sikhokelo ukuze ufumane i-Jekyll kwaye isebenze ngaphandle kweengxaki.

Xa ugqityiwe, uya kukwazi ukusebenzisa imiyalelo eyahlukeneyo enikezelweyo kumgca womyalelo.

Ukusebenzisa imibhalo ye-NPM

Ipakethe yethu.json ibandakanya le miyalelo kunye nemisebenzi elandelayo:

Umsebenzi Inkcazo
npm run dist npm run distyenza /distuvimba weefayili ngeefayile eziqokelelweyo. Isebenzisa iSass , iAutoprefixer , kunye ne UglipJS .
npm test Ngokufana ne- npm run distplus iqhuba iimvavanyo ekuhlaleni
npm run docs Yakha kunye ne-CSS kunye neJavaScript yamaxwebhu. Ungaqhuba uxwebhu ngoku npm run docs-serve.

Baleka npm runukuze ubone zonke izikripthi ze-npm.

Autoprefixer

I- Bootstrap isebenzisa i -Autoprefixer (ebandakanyiweyo kwinkqubo yethu yokwakha) ukongeza ngokuzenzekelayo izimaphambili zomthengisi kwezinye iipropathi zeCSS ngexesha lokwakha. Ukwenza oko kusigcina ixesha kunye nekhowudi ngokusivumela ukuba sibhale iinxalenye eziphambili zeCSS yethu ngexesha elinye ngelixa sisusa imfuno yokuxutywa komthengisi njengabo bafumaneka kwi-v3.

Sigcina uluhlu lwezikhangeli ezixhaswayo nge-Autoprefixer kwifayile eyahlukileyo ngaphakathi kwendawo yethu yokugcina iGitHub. Bona /package.json ngeenkcukacha.

Amaxwebhu asekuhlaleni

Ukuqhuba amaxwebhu ethu ekuhlaleni kufuna ukusetyenziswa kweJekyll, ijenereyitha yesiza esinesidima esinesidima esisibonelela: isiseko sibandakanya, iifayile ezisekelwe kuMarkdown, iitemplates, kunye nokunye. Nantsi indlela yokuyiqalisa:

  1. Qhuba ngokuseta isixhobo esingentla ukuze ufake i-Jekyll (umakhi wesiza) kunye nezinye ezixhomekeke kuRuby nge bundle install.
  2. Ukusuka /bootstrapkulawulo lweengcambu, sebenzisa npm run docs-servekumgca womyalelo.
  3. Vula kwisikhangeli http://localhost:9001sakho, kwaye voilà.

Funda ngakumbi malunga nokusebenzisa i-Jekyll ngokufunda amaxwebhu ayo .

Ukulungisa ingxaki

Ukuba udibana neengxaki ngokufakela ukuxhomekeka, khupha zonke iinguqulelo zangaphambili zokuxhomekeka (kwihlabathi jikelele kunye nelasekhaya). Emva koko, phinda wenze npm install.