Source

Baarakɛminɛnw jɔ

Bootstrap ka npm sɛbɛnni minnu bɛ a kɔnɔ, olu baaracogo dɔn walasa ka an ka sɛbɛnw jɔ, ka source code lajɛ, ka sɛgɛsɛgɛliw kɛ, ani fɛn wɛrɛw.

Baarakɛminɛnw sigicogo

Bootstrap bɛ baara Kɛ ni NPM sɛbɛnniw ye a ka jɔli siratigɛ la. An ka package.json kɔnɔ, fɛɛrɛ nɔgɔmanw bɛ yen minnu bɛ se ka kɛ ka baara kɛ ni framework ye, i n’a fɔ kode dalajɛli, sɛgɛsɛgɛliw bolicogo, ani fɛn wɛrɛw.

Walasa ka baara kɛ ni an ka build system ye ani k’an ka sɛbɛnw baara sigida la, i mago bɛ Bootstrap ka source files ni Node kopi dɔ la. Aw bɛ nin fɛɛrɛ ninnu labato ani aw ka kan ka labɛn ka girin:

  1. Node.js , an bɛ baara Kɛ ni min ye walasa k’an ka dannayakow ɲɛnabɔ, o telesarse k’a Blà a la.
  2. aw bɛ taa root /bootstrapdirectory la ka boli npm installwalasa k' an ka sigida dantigɛliw sigi sen kan minnu kofɔlen bɛ package.json kɔnɔ .
  3. Ruby sigi , Bundler sigi ni gem install bundler, ka laban ka boli bundle install. O bɛna Ruby ka bolomafaraw bɛɛ sigi sen kan, i n’a fɔ Jekyll ani plugins.
    • Windows baarakɛlaw: Aw ye nin gafe in kalan walasa ka Jekyll daminɛ ka baara kɛ ni gɛlɛya tɛ.

Ni a dafara, i bɛ se ka cikan suguya minnu di ka bɔ cikan yɔrɔ la, i bɛ se ka olu baara.

Baara kɛ ni NPM sɛbɛnniw ye

An ka package.json kɔnɔ, nin cikanw ni baara ninnu bɛ yen:

Baara Cogojirali
npm run dist npm run dist/distɲɛbilasɛbɛn Dabɔ ni dosiyew lajɛlenw ye. A bɛ baara kɛ ni Sass , Autoprefixer ani UglifyJS ye .
npm test Same as npm run distplus a bɛ sɛgɛsɛgɛliw kɛ sigida la
npm run docs A bɛ CSS ni JavaScript jɔ ani ka lint kɛ docs kama. o kɔfɛ aw bɛ se ka sɛbɛnw boli sigida la npm run docs-serve.

Boli npm runka npm sɛbɛnniw bɛɛ ye.

Yɛrɛ-prefixer (Yɔrɔ-fɔcogo)

Bootstrap bɛ baara Kɛ ni Autoprefixer ye (min bɛ an ka jɔli taabolo la) walasa ka feerekɛlaw ka ɲɛfɔlisenw Fàra a yɛrɛma CSS nafolo dɔw kan jɔli waati la. O kɛli bɛ waati ni kode kisi an ma ni a b’a to an bɛ se k’an ka CSS yɔrɔ kolomaw sɛbɛn siɲɛ kelen k’a sɔrɔ an bɛ feerekɛlaw ka mixinw mago bɔ i n’a fɔ minnu bɛ sɔrɔ v3 kɔnɔ.

An bɛ navigatɔrɔw lisɛli mara minnu bɛ dɛmɛ sɔrɔ Autoprefixer fɛ dosiye wɛrɛ kɔnɔ an ka GitHub marayɔrɔ kɔnɔ. Aw ye /package.json lajɛ walasa ka kunnafoni wɛrɛw sɔrɔ.

Sigida sɛbɛnw

An ka sɛbɛnw bolicogo sigida la, o bɛ Jekyll baara de wajibiya, n’o ye site generator static ye min bɛ se ka wuli ka bɔ a nɔ na, ​​n’o bɛ se ka fɛn caman di an ma: basic includes, Markdown-based files, templates, ani fɛn wɛrɛw. A daminɛcogo filɛ nin ye:

  1. Boli ka tɛmɛ baarakɛminɛnw sigicogo kan sanfɛ walasa ka Jekyll (site dilanbaga) ni Ruby bolofara wɛrɛw sigi sen kan ni bundle install.
  2. Ka bɔ root /bootstrapdirectory la, i ka boli npm run docs-servecikan yɔrɔ la.
  3. Da wuli http://localhost:9001i ka navigatɛri kɔnɔ, ani voilà.

Aw ye kunnafoni caman sɔrɔ Jekyll baaracogo kan n' a ka sɛbɛnw kalanni ye .

Gɛlɛyaw ɲɛnabɔli

Ni i ye gɛlɛya sɔrɔ dependencies (daɲɛw sigili) la, i ka dependency version kɔrɔw bɛɛ bɔ a la (dugukolo kan ani sigida). O kɔfɛ, i ka segin ka npm installbaara kɛ .