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.