An warware: shigar gatsby cli

Tabbas, a nan yana tafiya:

Gatsby tsari ne na kyauta kuma buษ—aษ—ษ—en tushe dangane da React wanda ke taimaka wa masu haษ“aka haษ“aka gidajen yanar gizo da ฦ™a'idodi masu sauri. Kyakkyawan kayan aiki ne idan kuna neman fara sabon aikin gidan yanar gizo, saboda yana ba da ingantaccen dandamali don haษ“aka aiki, haษ“akawa, da tsaro. A cikin wannan cikakken jagorar, zamu tattauna yadda ake girka Gatsby CLI, kayan aiki mai mahimmanci a cikin yanayin Gatsby. Za mu samar da mafita ga wannan matsalar, mu bayyana aiwatar da ita mataki-mataki, da kuma nazarin wasu ษ—akunan karatu da ayyuka masu alaฦ™a.

Shigar da Gatsby CLI

Gatsby Command Line interface (CLI) yana ba ku damar ฦ™irฦ™irar sabbin ayyukan Gatsby da sauri da aiwatar da umarnin ci gaba a cikin ayyukan da ake da su. Anan ga yadda zaku iya samun Gatsby CLI akan tsarin ku:

  • Da farko, kuna buฦ™atar shigar da Node.js da npm akan tsarin ku. Ana buฦ™atar su don gudanar da gudanar da ayyukan Gatsby.
  • Da zarar an shigar da Node.js da npm, zaku iya shigar da Gatsby CLI a duniya ta amfani da npm:
npm install -g gatsby-cli

Wannan umarnin zai shigar da Gatsby CLI a duniya akan injin ku, wanda za ku iya shiga daga ko'ina a kan tsarin ku ta amfani da umarnin 'gatsby'.

ฦ˜irฦ™irar Sabon Aikin Gatsby

Bayan mun yi nasarar shigar da Gatsby CLI, bari mu fara ta hanyar ฦ™irฦ™irar sabon aiki. Wannan yana da sauฦ™i kamar gudanar da umarni mai zuwa a cikin tashar ku:

gatsby new my-first-gatsby-site

A cikin umarnin da ke sama, 'my-first-gatsby-site' shine sunan sabon gidan yanar gizon ku, zaku iya zaษ“ar kowane suna da kuke so.

Sabar Gatsby tana gudana

Yanzu, an shirya sabon aikin ku na Gatsby. Lokaci ya yi da za ku shiga cikin sabon kundin adireshin rukunin yanar gizon ku kuma fara shi. Tsarin ya ฦ™unshi:

  • Da farko, kewaya zuwa sabon kundin adireshi:
cd my-first-gatsby-site
  • Na gaba, fara uwar garken ci gaban Gatsby:
gatsby develop

Wannan umarnin yana fara uwar garken ci gaba. Daga nan za ku iya ganin sabon rukunin yanar gizonku yana aiki ta buษ—e mashigar bincike da kewaya zuwa http://localhost:8000.

Fahimtar Laburaren Gatsby da Ayyuka

Gatsby ya wuce kawai a tsaye janareta na site. Yana da ฦ™aฦ™ฦ™arfan dandali mai cike da ษ—akunan karatu da ayyuka da yawa waษ—anda ke haษ—e kuma ana amfani da su don ฦ™irฦ™irar ฦ™a'idodi na yau da kullun. Yana amfani da sabbin fasahohi masu shahara da suka haษ—a da React.js, GraphQL, da fakitin gidan yanar gizo suna sa ta bambanta da faษ—aษ—awa.

ฦ˜arfin Gatsby don jawo bayanai daga kowane tushe yana ษ—aya daga cikin ma'anar fasalinsa. Tare da taimakon GraphQL, zaku iya sarrafa kwararar bayanan ku da amfani da su daga tushe daban-daban, gami da MarkDown, Contentful, WordPress, da ฦ™ari.

Zurfafa fahimtar waษ—annan ษ—akunan karatu da ayyuka za su ฦ™arfafa ku don gina ฦ™arin ruษ—aษ—ษ—en shafuka masu ฦ™arfi tare da Gatsby.

ฦ˜arin Dokokin Gatsby CLI

Gatsby CLI yana ba da kewayon wasu umarni waษ—anda zasu iya zama da amfani sosai yayin aikin haษ“akawa. Wasu daga cikinsu sun haษ—a da 'gatsby build', wanda ke gina rukunin yanar gizon ku don samarwa, da kuma 'gatsby info', wanda ke ba da bayanai game da saitin tsarin ku da kuma umarnin Gatsby da ke akwai.

Daga shigarwa zuwa ฦ™irฦ™irar sababbin ayyuka, ikon Gatsby CLI yana da aikace-aikace masu yawa. ฦ˜irฦ™irar waษ—annan ra'ayoyin na iya ba da babban farawa don ingantaccen ci gaban yanar gizo.

Shafi posts:

Leave a Comment