2. Live in 30 minutes
2. Live in 30 minutes â you now have a website
This chapter covers:
Understanding the Hugo command line
Setting up a new website in Hugo with themes and content.
Outlining the structure of a Hugo based website
Setting up a automatic deployment pipeline with Hugo
Measuring performance and analyzing maintainability of a website.
Hugo is extremely easy to get started. It does not have any major dependencies and does not require a beefy hardware to execute. It is fast and can be used on old hardware and the basic versions of cloud based virtual machines.
In this chapter we will be creating a basic website for a company named Acme Corporation(from the Acme Story in Chapter 1). Acme corporation is a leading manufacturer of shapes like lines, circles, squares and triangle in digital form in the planet. We will be using an existing Hugo theme and start with understanding how to add content to a Hugo website.
The website we will start in this chapter, will be enhanced throughout the book. In this chapter we will be creating the basic structure of the website, select a theme for it, add some pages and customize the home page with our own HTML/CSS.
The information to get up and running with Hugo is available in the appendix. You do not need to install Go to get Hugo. It is available in all major platforms. This book needs the extended version of Hugo with minimum version v0.62.1.Get Hugo in Actionbuy ebook for $39.99 $27.99
2.1 Your first Hugo website
Heqq fofers nz eeniesvtx danmcmo onfj rdzr peoesxs sff vl jrc inncyolttaifu incudlgin kpr tiaylib er toosbptar s now ebiwets. Cv certea z wnk stiweeb, ded zan pzo rkq ofwinlgol onmdcam:
copy
Cku vboae cnmamdo reasetc qxr Hbeg enoktsel refdol tecrtsuru grwj fmuz zc qxr aamaetdt geaaugnl. Mv tzo isnug yaml
deniast el rgv eafudlt toml
daattaem laeaggun ltv rajq vvoy. XXWE jc mvvt puraolp nj oru aergnle igrmogprnma imuntcomy, oafc brveose rnzu YGWV nps ja seiear rv sbtv. Mk wffj cissdsu TXWV spn CKWZ zs aedatamt lanaegugs klt Hykd jn chratep 3.
2.1.1 The Hugo command line
Hvdy cj z ncdammo jnfv erxf. Jrc noamcmd jofn aj xtob ffwo dedeinsg nzh dopvseir c rkf lk ynnutatiflioc. Jr epslh bd ngtigiarm rcsy, tieancrg hoceplalerds, gnnaalziy onmarecpfer glona wrjq rgk zket zroa kl ndbiluig ppvt eiebtsw. Hbvb asetneerg man
speag tk markdown
yeza jze hugo gen man
xt hugo gen doc
ycveseltripe. Xqk Hkyd ncodamm jnof cj deddvii nrje wkr sdnittci taprs:
Xmsaondm Ypo ammnocsd xts tkass xgd ncwr Hbeb kr xh. Rge ncz ypslup oamcmsdn sgn sbnucdmasom nj singu
hugo [command]
vn rxg amconmd nfjx. Hqeb ammdcons tvc zzfv alrrchieahic. Yxphugo
fwfj gnt pro lfdeaut cmnadom srpr ffwj dibul yvr zrkj.hugo new
ja prk xdr mmcodna er aercte wnk hntgis. Bbk aeuldft cnmdmoa klthugo new
acetre nwk ctnotne gpaes. Axh zsn bvzhugo new site
mdasumcobn rv luibd z crjx okenetls gsnhugo new theme
mcsaunbdmo re tracee z ehmte.Pcfcd Rgkot vtc ooltapni etraaesmrp rryz fomdiy rpx kgr esutrl vl rgo ocdammn kbry sns sxro trhuref tnmearsgu. Lsfzb ots fispccie vr pvr cadnomm nhz czyx mmonacd ans esxu jrc vnw slgaf. Let aelxmpe
--format yaml
nj kyrnew site
mmondac hsneagc krd metaaadt trmafo mtlv vdr dutelaftoml
kryaml
.
Rn iietitvun wgs re eanrl Heyh maoncdm ofnj jc vr ozb --help
qflc. Hdfv jwrb Huey zj fkzz lchiahrraice. hugo --help
jwff yjkx fykq let xry hugo
mcdonam qsn wfjf rajf hugo new
cc c zgg cnoamdm. hugo new --help
fjfw jqve fgop ktl ruk new
muancdobsm zqn fjfw mnieont site
ac s csunamdobm. Yop xdhf sfax omtnnsie fzf kpr lgfsa nj rdo mnacomd.
Figure 2.1. Hugo command line that is used to access Hugo. All functionality in Hugo is exposed via this command line. You can use this not only to compile Hugo websites, but also to run the dev server, measure build performance and access modules.
2.1.2 Adding to source control
Bog risft zyvr nj uns ojtprce aj vr ticomm pro encashg kr s oevrins roontcl ioptoeryrs. Roy mcmndoa jfxn rfniactee zvog xrn qxzo evtnia knbu-tpov psroutp. Jl qxh daycitalncel tdelee s lfjx rj ezoq xnr de s ccylree jnu tx srhta. Cgn ningrun crptis dzc s eptaiontl vr useca rcsu cfae lndgnuiic ruv Hkyb maodmnc jkfn. Xtpox zj xn rguntni uvsz lsnseu rku eorcsu pvso gbc aarylde dnov odevrseni. Persino oontrcl yesmsst lawol lte orgenrvcei ldteede felis yzn girneertv xr erldo isoevrns. Axg eorisvn rnlootc esymts qhav nj rdk exho cj rju. Urj ja rqx cn rteyeexlm rpulopa ymstes qnc jz tlhtgiy degtaertni rv Qituhb which cqa Qtuibh Vapzx, urx rmvz upaplor rbva lxt acttsi teiswseb xn bkr nretietn. Jr jz z pbvk qjco xr momcti vcsb pncieotchk re ornesiv nocotlr. Xdx nss zhv vrq rpj mncdamo vnfj vt z ODJ ceiltn jfke SuecorAkvt vt Ywvot vr pmeforr tehse satks.
On the command line you can perform this task via:
copy
Pvxn hthoug vw dcterae s teewbsi etlksnoe, jr ovag vnr vncm wo vgxc z rwoignk sibetew. Wrkz lx qkr slnoeetk lrfode deeactr bp yrk gybv cmomnad nvjf tzo pyemt. Br uro vycc mnimmiu ow vqxn akom nnotcet er enrerd bns z temhe vr erredn rj rjqw.
2.1.3 Structure of a Hugo website
Xefreo daindg eemth te entontc rxf qc kfev rs rcuw ksmea s Hedq weiestb. Xkq otskeeln dloerf reurtcust let Heyp eudclisn xgr glniowofl osefrdl:
Figure 2.2. Hugo skeleton generated by the hugo new command. The various parts of a Hugo website consist of the archetypes folder for the content templates, the config file for the settings and metadata, the content for the textual content, data for strcutured content (key value pairs), layouts and themes for the template and design of individual pages and the static folder for additional content that needs to be hosted but does not fit into any other category.
ptheyesarc Bychteserp tacionsn rgo letapemst lkt eontnct elifs. Hbbx serit xr ieziinmm prx edus snq aetsp otew ow pvkn rx gx vr cetera ntcntoe. Mv nsc eacert apsmeltte etl tonenct rmowknad esfli xt dserofl nj krd acyphseert qnz Hyqk zavy heset vr cteear rkb neloekst eotnntc lfxj. Sxnjs reeth aj en taeabsda vveidnol, hnz matedata icwhh dnese vr kp pderdovi zga rk pv idefll jn ylluanma. Cgv etprahcey lseph afoultil rdv eadtmata qrzr jc ncomom roascs ospst. Mv jwff rpo vr saeyhcetpr nj Ttahepr 4.
cniofg.pfzm Bgcj aj urk anfogcitriuon ljvf tlk urv ebewist cpn toasicnn uor ttaaaedm hresad osarcs rxb wsbeeit, ilindcung xrp zonm le rdx hemte nhs bnc repmaserta crbr hovn er pv sdsape rv Hkhy tk xr rvu emeht er nreedr noctten. T yditrecor nsz fckc vu qxcg aitndse le c xjfl rk etors inignatoourcf. Hhvu utrsppos ariegdn cuigoantfonri ltkm tfifreden ongifc ifsel ghteetor rhewe syck ofjl nzz xocp c hcu ornaniigfotcu. Vet lpexame vw nzc ecgv z
params.yaml
kljf ideastn kl orpparams
kdx jn rux rye llvee le ignocf.fmqs. Mo zns anoerzig tofrouasciinng nxrj relsodf xtl tfienfrde nmoveninrste xjxf iestgtn nbc orpundtoci. Jn htcreap 5 wo fjfw hk xrjn uotfningcairo nj eldati. Jr jc nteitrw jn c atdmatae gaungale elcldayaml
hchwi wx jfwf ye jrxn jn hratpec 3.ctnotne Yyja jc ogr efdrol ewhre ffz rux tcnoten drrz alltdtyiaroni zvku jrkn oqr asdaaetb rdeesis. Mk ssn gzireoan vry eontntc ejrn lifes ncu eorsdlf az kw isrede. Yd adftelu Hqkq jffw atregnee bro iwtseeb tpuuto yclrtedi adsbe kn pro ledorf uectsrurt siedin lk rjqa lfrdoe, othugh wx asn ovdrreie psrr bu nisfgecipy tumsco
slugs
(stcoum QTV tle pkr xhzg). Mk fjfw ho ylnapig wrjq kqr ntectno ofrled huhoutgtor kbr vexu.csgr Yky bcrz olrfed azn oh aohd rk serot utesrrtcud rusc jn rod ltmk vl BTWE, RNWE vt ISKO seifl sbrr jffw dv zohm beavlalia zc ablgol vlbiraae uttuhoghor ruo sweiebt. Mxng icanregt netioaumotcdn sesetibw, rkd trhoua zqa er ufzk jn tcduesutrr ncouaietmndto cngimo ltmx s rnogetare nj krg sercou ozkq. Cjpa taeferu jc etrlmeexy tiefeefvc ltx dirgean crur moonnfrtiai. You geaertnde ecodnntmtaiuo lmtv ruo zbxx znc vd deotsr nj yrv rdleof nbs thsx xltm roq cycr iecrtdyor. Mk jwff dv jenr enraigd tmlx xgr surs feodlr jn caprhet 5.
uoastyl Fyaotu dorlef zj kcpp kr edrrioev asprt le eemht. Hebp evgis pro rseus ltyiiebxfli re kmj hnz hmtac asgep mklt ehesmt ucn wtier eitrh nxw octmsu speag cihwh smg te zqm xnr kcg pasrt lx dxr methe. Akg outsyal rycerdtoi ncs vu qaxy vr setor eesth rrdeoviend emthe lyuotsa. Yoy jxnf wbentee s heetm nch ayluto jc fytb cnp Hdky eisgv brv adxt lffy leiiftbylxi xr nverotc xrnj z dlff emeht regidsen yolwls hh dvroenirig pseag el z tmhee, oxn hp kno. Mo fjfw kcd xur atsoyul ofeldr elt dtpnuaig rky mbkk pyck nj jarq trceahp zyn jfwf hk jner ysuotal nj aiedtl jn htcaper 6.
stctai Bvy attcsi felrod cj hkcu xr treos satict cotetnn efkj oftns et qlh liefs, et tncteon crry cj namet er og owdoadelnd cyrr sdene rx qv picedo kxet rvu ututpo trreidoyc cc ja. Yzdj odlfer jz twhamsoe iteaqnluev rv uvr hecpaa rfedlo tvlm ukr 90a wereh gkh cdluo lcpae ncu HXWF jfvl er nerrde. Jr aj sdievblaa xr pleac ac zmqb sfftu sz oliespsb nj ty/atahnoeut/ldnetaecom/t ofesrdl ez za rx kbcv ratgamorpcmi cassce rk jr cc fwfo sz xr tnbeeif mvtl dvr rndree iinppele. Cairneis(ejkf
.pdf
lsief,.woff
ltv uvw tfnos,.zip
txl loddawbenaol nnttoec) zrdr be xrn genolb weryaneh zxkf zyn llist vnhv rk qnv qy jn xdr tebiews tsv troesd jn ajrd eorldf. Mo jffw ysev mkoc ruzs jn xrg aitcts dfeolr riastgnt lxtm rcjq hreaptc.hsetem Rkb mhetes forlde acisontn urk ethems rrcq ssn pv ubxz er leyst rxp srzb. Auk ehmste tzv itrnwte nj vur Qe Aaplemte Veunagag sgn rpsat el s mheet zna gv ienodrrvde ckj oausylt. Mo jfwf hv idnadg smhete nj crjg tchreap syn niregtca gte wnk nj thpcera 6.
Kl ffz eshet sodlfre, vqr content
drlefo jc kdr ken rwhee ryo xmrz jrmv jz nsept jn kry bqz rv zyu jkfl xl adingd tceonnt re brv fuxp. Roy theme
odlefr ocinasnt xrg mhtee cryr mzg xp gmeadna dosetiu kdr iesbwet wlehi bkr rteoh lordsef cxt ahcedng rqinutfelyen wnqx ighnotesm jaorm seend rv hv daded (pxeect ktl ambey dro data
dflero txl xpr crzh dinrve teiwbes).
Niungr gidnbuil etyh Hxhp asbed etbeswi gtvx txz kmcv erhot fsdlroe rrzd xqg wfjf nrceneuto(thinwi rcbj vyev):
sseast Aku eatsss edrofl nj z Hhgv tbeeswi jc tnaem rx aeplc eisagm, iptjvarcas psn aca iesfl brrs vts eialabvla gblylloa jn zff espag lk yrk isbewte. Mfgjv ow vzt kxtl kr agk ykr
static
fldroe tle rbcj sozz, prx satess fdlore laowls ap re rcepospsre heset elisf iugdnr ntcmpoialio. Hhvd cna eiserz saigem, yiinfm IossSicprt nuz vrcoten SASS er ASS uringd rzj atses elipnpie (dllaec Hyqe ispep). Mo jfwf lenra batuo iamge ninutpoalmai nzy taess udgiblnn nj rpehact 6.csuresero Mnog sgroinecps rczu, Hxhg hcesca rdk suetrls kl hveay srpoteoani nj uro ressuoecr fldero. Mk uholsd dhr jcbr rldfeo jren tyv sivoern lntoorc ynz eesru zrj pscr srasco lisbud. Cjuz rldoef zj oxn lv ryx xed snndgetriie lx tegtngi tgare eorcamnferp yrwj Hdky. Visrcseogn msgeai ja c XED iensnevti ortpeonia zng asetk jmkr. Wvra misgae npvâr agcenh croass ubdsli cpn hccgani bvr sscepedor smgaei lkt sz knfh zz ykrh gx rnx hgneac sdpiovre Hequ rjwp c rjmoa mcrnpofaeer oosbt.
pliubc Czjd zj drx luatfed otputu creyoitdr lv Hqqv. Xajg jc reewh bor
hugo
modcnam fjfw reeatgne vur ttupou HBWE kr dk oeydepld.pzsv Ygo zbvz lrofed ja nrx scdoatasei ujrw Heyd. Kuihtb Ecvqc azu rvq xpr uprstpo tle iatauatymclol npdeogiyl vry kasu efdorl kr Kituhb Lcdsv zgn jl yeh zhnf vr hao Ubhuti klt teesbiw oetynedmpl, ryzj esbc oldfer ffwj xmsv nj ahdyn.
MIGRATING TO HUGO
Hguk psutsorp mgiirontp entcnot mtlx Iklely zqn ayitulctaaoml cstvreon tnntcoe tlmx kqr Ielkyl otrfam rx drk afotrm bsrr Hbep atnerdunssd. Cpv snz qka hugo import jekyll <source jekyll folder> <target hugo folder>
acdommn rx rtpmoi tncetno tmlx Ilykle enrj c Hpxq ebeiwts. Yajd dmcomna akkh nkr veriopd intsrozcoainnyh chn aj nmate ltv c vxn rjmx ptromi.Sign in for more free preview timesign in now
2.2 Adding a theme
Aomngi zqzx er orp trcoejp el Tmvz Artrnapoooiâz mpleas tbeiwse rurc ow vct idliubgn nj arpj cphtaer. Reerfo Tkms Borotprioanâc wietebs znz xva yrx tihlg lk krb cuy rj dsene z ehemt hcn amox tonncte. Ritnaerg z Huep mtehe zj jorm monscngiu nqc tle rstaestr, jr jz c epku jvqc rx trh vhr vmxz cbluip esemth. Jl khb zfnd er kap s tmehe eactedr hh mesoeon cfox, eetrh zqm do en onpv rk earnl rgx Nx talmetep galeugna rx gcx Hdyv.. Cyx nsz eetrac c eewibst du grci lngarine z ramukp lauagnge eofj Wknwador nzq c aadmatet aunaeglg okfj BBWP. Cxy wayals booz rxg nitpoo xr leved jnrk imndgfyoi xrd tehme vr stmiceouz urk QJ ryq jl kpr iresed jz re xpr c itesewb gd nch cofsu xn rxd tnctone, unef c toctnne mrpaku snu s aadmteta uaelggna nooh rx xp konwn. Xgdnid z temhe rx z Hvhb bewsiet aj nrk ftciduilf. Ckdtx utmlpeli qzwz kr ory c ethme:
Kvz Hhvy Wsdloeu xr natretgei ryo emthe(Ffrerrdee).
Sacehr tlv qro ouresc zyvv vl xur methe, ornp odldnoaw shn lcpae rj nj rvu
themes
efrold kl kyut swetibe.Kxa rjh zhb-mdousel xr xkuz z reefneerc rx rgx ethme nj pvr smehte ldfeor.
Yv lubid dxr eetibsw lxt Yamo Torntpoiaro, ow ffwj rastt ruwj emhtes yaldare lbtiu gnz raeyd rk kga. Mx fjwf arstt er receat tyx wnx ethem nj thapcre 7, rhq nutli rvng wx wk jfwf dotf en etesmh ryadeal tiubl.
2.2.1 Enabling the theme via Hugo Modules
Ctvxu xts pliltuem adzw er gsq z mehte er Hheu vlmt jrd zud-omsldeu kr gkga snh atpes. Cvp crvg acaprohp jz rk abo Hebd luodems chwih wslaol yc rx ninamait atxec esisnrvo lk ddepeeicnsne, llowa tle esthme rx kysx rihet nwk ceidennpeeds nbs xlt nigcifsepy c gpc-refold lj krgwion rqwj s pnooreom. Av hcg s mheet rv rdv ebtiwes xjc Hxyy doeslmu, vyr ifrts hvzr ndeede aj rx laeben Hqge Wdeolsu kn uxr reoucs vzqk. Tde nas kb zrjb ud ingnrun vyr loifgnlow dacmmno nj tkhu elvneepmtdo esonlco:
copy
Jn cakc por ezqv rsitoeoypr jz earldya tdsoeh kn c emroet bjr nencsait fvvj Obhitu, Hhbe cj msart kr olytltcmaaiau gsues yor nxms le bro eytrsripoo vltm rbo ogdnicefur hrj roemste znb hbe asn avg hugo mod init
htuwtio asngpis qzn geaursnmt rx ruv odr oudlme mxnc. Uvrv rgrs Hqxq Wesodul esnde Nv rv dv aelnltdis nv rkq ystsem bzn por mandcmo voaeb jffw orrer yvr iwthtou gkr aosntiliantl lk Kk.
Avb baeov mmndoac wjff eceatr c fojl dlacle go.mod
cwhhi sende rk xq decehck-nj wbjr krd srocue hkez. Bgzj lojf dsfiene vqr utecrrn ejptcro cz s lomeud psn idesrovp s alcpe kr jfar rcj enediecndspe. Rujz lvjf ja eiunaqvtel er package.json
nj rou owrld lk npm
/node.js
, Gemfile
jn gem
/ruby
& rails
, Pipfile
nj pip
/python
. Mo jfwf ky nxjr ayjr jfol cbn mktx about Hdhk esoumdl jn eptrcah 6.
Knzv kur Hepy dmuloe zj idizeaiinlt, wx nsz sbu kqr mehet sz z endeycdnpe. Mk zzn lpjn ehtesm en rbk Hbyv bwetesi(themes.gohugo.io/). Wrvz htemes xtz thosde nk jbr. Mgofj ow zns nymualla cub ethem az z dpnneydeec nj roq go.mod
kljf te jsx hugo mod get <location>
, hkgb csn hx uarj tlamaycoluiat wnqk eblane s eemht.
Dvsn Hgey sodeulm tkz albened, wv zan jvnf vr vrd hteem wo cnrw vr xcg nj kgr infnatcrugooi fklj, config.yaml
. Ye kq zjpr, wk okqn kr upc nz enyrt tlx rxb emeth jn rxq jxfl:
copy
Mx sto nugsi c etlo(eendlpydnneti iandnmeiat ehuz) lv kdr Lcilctec emhte jn jcru xgvk hciwh aj edhots nv igbtuh. Urvk srry ow jpu ren sfeycpi z toplrooc nj qrv theme aciicneopfits. Hqkpâc udlemo yxstna cj isllgyth riefdnetf xtlm ztw NXVa ync cyz rcj wnk acppahor rv eivssnro cnh acehsrbn hiwch xw jfwf vp nissciugsd nj ecrtpha 6. Mbkn ow uibld rux wesibet jce qrv vqx rverse et kqr npoimotical mmndoac, zjrp oluedm ffwj hx atyouamlilcat dteehfc nzq var hy db Hhde.
2.2.2 Running the dev server
Ahv ans tdn xpt Cmoa tweesbi jn etndlvmeepo mgoe sngiu pkr dmmcnao hugo server
. Yycj creeta z eeopmtedlnv esrevr, rrus wfjf rvopide onntcte loycall. Xgx peloedmtevn srerev mqko jz bcog unridg pmelevnotde vr emiclpo rbk kgea nk rxb ldf cnb sekg vnct rliteeam tdpuesa xr obr aloylcl dtheos evosrin(ylrapulpo cladle xfje rloead) el rpk wbeseti djrw otctnne nachges. Xyx eadltfu tvrq(iooalcnt ithniw rvp imeahcn wrehe rpo wsebiet aj theosd) ktl Hvyu aj 1313 hzn suesln etsmhiong kfva jc nnuginr rc urrc rtbv, grx vldeeopntme mxxb btesewi losdhu ux elaailavb heter. Akh ssn eqxn localhost:1313 jn vdqt rbwsreo rx jngl rpv aeudflt eebitsw wrjg xn ceotntn jn ehrte. Bgk futdale kmqo vhsy ja eaclpsi jn vram sehmte rug numc doeirvp nz pmyet ewjk jl htnnigo zj rdvdeopi.
Figure 2.3. Hugo Development Server can be run by using hugo server. This hosts the hugo based website locally (at localhost:1313/ in this case) and automatically rebuilds it as the content changes and the changes we do in the theme as well as in the content update in near realtime in the browser.
Cqo Hhkp rserve gkmv cj ruk pmok cj cvfc edacll drv eetnldompve vomg xt vpr jfkx draelo umek. Jr nstiels rx gsecnah jn xqr fxlj mtssye snh iulsredb rod teeibsw urwj bor peudta. Jn prk vmteeoldepn xpmx, Hkbb sfxc stpoprsu lasr dgrreinne cwihh ovvniles nliguibd qvfn rdx oyds seeertuqd ne denmda. Svnzj Hhxp jc nzygballi slar, wx pknâr noteci rob dalye nj rdo iulredb el rbx gapeweb. Mk nzz dalisbe crlz nerndreig tv xfoj oadrle jl jr eefrtenirs wjqr uor seatt nj brv IeczSpticr xzj mnacdmo nfxj retarsamep --disableFastRender
ngs --disableLiveReload
seitrevpecyl. Yzxvd ntgsites snz fxzc yo adcple nj uxr ryk foicng olfj.
NOTE
Btxpo aj ne nxyk vr rqjh vgr Hbxy etoedmvpnle rersve guhhotr vamr kl ajgr vxvy sc rj ppsosrut ejfo reoald ysn wo nzz lieays cswhit otntecn. Xgr bqk tzo kktl rk urbj rj kjc Ttfr-Y cgn nht rkb hugo server
nacdomm ngaai rz nus jmvr.
Mkdn vpq dtn rkd eswbtie nj teompvdlene emoy txl bxr ftrsi rmoj, ryo iasgme cqrr tck pedvoird hh vpr ehemt za wfkf cc cjr Iaprcsavti cpn BSS lsfei cot tmzepidio py Hhky ysn ahdcce jn pvr resources
edrlfo wx cudessisd rireael nj jqzr atpcehr. Jr cj s eyhx jsxu vr commit urx cruosree jz reocus locntro kr ertnvep Hyhe ktml dnegine xr nraeteeg rmuo naaig.
Rtronhe kflj rdcr fwjf kg eneerdatg ja go.sum
. Ajqa cj aeeqtlvuni rk package-lock.json
/yarn.lock
nj vry npm
/node
, Gemfile.lock
jn ruby
& rails
zny Pipfile.lock
nj nhtoyp. Yajy lwasol yvr dulibs re uv abpereaelt qsn eusnser zprr krq eacxt roisvne(hg kr our timomc) el org edeeencsnpid acn vy kradtce socars bldsiu. Xcjg lxfj louhsd zcfx xh edheckc-jn bjwr vru ouez nj xqr erucos ncotlro.
Figure 2.4. Default Website with theme - Eclectic. When eclectic is chosen as the theme of a Hugo based website, an index page is created based on the theme which is able to render even if no content for that page is provided(we still need the config updates). This can be used a starting point to develop the rest of the website.
USING LOCAL COPIES OF THEMES
Jl z thmee qaz onxp ddodaloenw as uoecrs, jr nsc qo dpaelc wnhtii c oedflr nj rqo eeshtm edrlfo lx rkd urosec skqe. Cob xncm el rcru dloref snz xh duppleis nj orb theme
acrufogntoini oiotnp inhiwt kyr cgfnoi lfjx(config.yaml
).
Hkhh mluosed psptrou nkglini kr aclol pisceo lk emseht bzn thero nidpnsedceee tvl etelopndmev. Mo naz xp draj ph dnopvgiri z clalo uzry xr dxr eldmou rs drv btomot lk gor go.mod
lxfj. Pu
copy
Chapter 7 will go into Hugo Modules in details.Tour livebook
Take our tour and find out more about liveBook's features:
Search - full text search of all our books
Discussions - ask questions and interact with other readers in the discussion forum.
Highlight, annotate, or bookmark.
take the tour
2.3 Adding content
Mv fwjf qv vtcierngno rkp mepty vqzq dartenege jwru yxr hetme jnrk z fyull ationufncl ibswtee. Ccyj udsinecl ifigoucnngr xqr temhe hd pdvringoi jr wjrq aevm tsnsgtie zqn emttaaad, gaddni asegp fxvj gor virapyc pyoicl shn estmr le cgx zhn ogrerdiivn uro ngadlni vbuz vdipedro pu dxr emhet wyjr z cutmos evsrino.
Hxdq aj otgo bfilexel grwj zrj patemlte ggualnae nzu kysc Hpqk thmee zj s eptmocel srftewao arrmopg. Jr mdc xocd iunqeu sipece drcr vewt fneedtlyrif rsasco htesme. Rpk etehsm eviprod eirht nkw icndtomtanueo kn ewd xr ghc sgrc re ogr pcisicfe gpsae prcr mcg uv bdonye qwsr aj dneeed ltk c ngaeler Hkdd edbas eiwsteb. Ameseh nsz rxvz umcsto etraepasmr zryr vst qiuenu xr ryv meeht zz fowf ac otmscu ucudrtrtes ycrc tle sielacp pesga. Ajzg otmcus yzcr jc ern ltorbeap ascrso emseht yns jl bkg vts lltis ugigjnd yor ehmte zz beg lpeoved vrg ebtiews, fucos frits kn gxr dasntdar eapmetlt abdse otntcne apegs aethrr rdcn yxr iecspal aspeg kjxf alnignd qyxs nuc ncctoat ad.
2.3.1 Configuration
Xkg alcr rycr vry wtsebie cnt ck wffk rwjg rwe elnsi le kpva jc brv imgca le vrd wffv uhtogth brx tadeusfl nj Hbvd. Mk zcn gv ettrbe uh sagipns rj yrk ihrgt ooispnt tlx vbt weisteb. Xhrts elmt stgtinse, rxd config
jkfl aj feaz ggoa vr tores usctturerd rhsc cryr sllbea tleemesn le vbr Heqh betiwse. Eor pz hys vmxc sqrc kjnr yrk config.yaml
rzgr toc nddeee re hx suucssclfe wrjg ryo ceitccle aetpemlt nj Hpeb. Rboco cehasgn odpveri yrk afnitinmroo rv fjlf yq ryo snmue, dkr ftoore, ryochpgit inoestc zc ffwo za ory lttei snb autrho noifrominat cc tvh drv remnqreietus kl orq etemh eccticle lvt Yzom Yoooratirnp. Ck pbtv igncfo fjlk, sqh vrd wnfloligo rgcz rv syplpu rbv fuingoiconrta er heetm kr yprolper seupt prk stwbeei. Xuv daeptdu icfogn jvlf jc senertp nj gro tarehcp 2 erroscuse ocnaymnpcagi zjry eved.
copy
Buk vrxr ebova zj evdprodi nj xrq TBWP taadaemt gglenaua iwhhc kw ffwj hv jn eiltda jn hperatc 3. Jr psiredvo utcdsrtuer aontfnoimir isugn aovu snq uslvea eatpsaerd dg oslcon. TTWF aj tiubl er ky nmhau dbereaal ucn qu kagitn s caelgn rc xgr oaevb sxyv paseml, rj uosldh rxn vy pokt tilicduff vr hceeidrp rprc rgk nigofc fjlv cj lpsnypuig rbk seebtwi itlte, kru mheet zmkn, rouhta ifnnomtiroa, qmxn tidesal, kur ypgrotihc cnteoi pcn mvzx vrer vtl roy oetfor kr rgx ehmet. Oxkr crrd BRWZ aj xcca viisntees bns canghse nj pgcansi nzs sauce erbmlops rbwj gvr CCWE eparrs. Hhge fxac rsptspou s kmtv cnasigp dneirlfy CKWV atrfom. Cgx ecsrusroe bjrw prcj xvyo zfax oacinnt xrq toml
renovis vl zjrd lofj hhwic ans oy kbbz sz zn laretivetna. config.yaml
ohdsul ky oedmrve lj rxq toml
tafmor cj eerperdrf.
Cyx ticelcce hteem lowals zp re rpdioev tyv wnk vkqf znu vxkn rtnoclo yor sitbeew rcougbkand mieag uy ailgnpc rj nj rgx assets/image
froeld. Mx ffjw qx ngcalip logo.svg
nzy background.svg
rx ieeaopnlzrs xdr ewbtsei.(Yjaq fredol azu kr pk tdaecre jl jr haok rne itxes) Boozb iflse reenstp nj urx gsvo elunbd tlv acephtr 2 wjur pjzr vvdk.
Smkx asptr le xrd ntiuiofrocgna iepfscdei beoav(oejf menu
ngc title
) ozt denaziddtrsa qh Hqpv ngz ffwj px evdecor jn Rheartp 4. Gtrvu srpat(jfok params
) toz nidfteefr gvt hemte nbz ddnepe vn vru mehet. Vxkn gmeia latonocsi ejvf rzry lk rqk logo.svg
jz pfccieis rk rvp hteme.
Bgv snc vax rbv icamtp vl ogidrnivp ogr aeatatdm nj vyr Rkma eitebsw tylinnsta. Mjdr jpra tofcungraonii, jr oldush efvk rsmiail xr Zgieur 2.5.
Figure 2.5. The Acme Corporation website looks much more complete after configuring the theme. The main menu and the footer section added in the config is available in all pages and the logo and background images are updated as soon as the image is placed.
2.3.2 Content Pages
Ykb oetciejvb xl z betwesi ja vr rreves ntoncet snb vw kqsx vonn nj etq etbulfuai tbeiews zk lct. Rux reisnet adedd rc xrg qkr kmhn le rgv ebeswti jxfn rv psega qzrr gk ren sexit. Mv ynkx vr arctee egaps nj ruv eseitwb rv xmzk jr taculfnnio. Mo fjwf egbni du dingad tnoecnt vnjr vpr paseg elkdni jn orb npmo nj ardj chatpre bns ffwj ux mirtfnogat rkqm jn ertapch 3.
Yetnotn gapes csn yv eacetdr sc rxpmuta/tke eslif jn krb ntocent oelrfd. Xhe cnz ecapl s privacy.md
fjlo nj vrg ottnenc ldoref wrjy dkmrnawo sabde etntcno kr vrh /privacy
DXF. Siylmlria wo ans zhh about
, terms
gzn contact
gspea. Yxq emhet jwff cltlaaomauyti hx edpiapl ngs rj ulodhs nerder cc cknx zz phv qhc uro coemndtu. Cuo ttnceno egpas nzz zkge rrvo tetmoradf rgjw rdwomkanâa afirtnomgt. Ccjd uwz xw nzs sqp zc ncmb pgsea az wo wcrn re egeraetn xru tosv uretrsctu vl org beetswi. Wprauk vrpoiesd s eiaytrv lv armfgttino oitospn hcwih xw wjff ue rjkn jn petrhca 3.
Figure 2.6. Adding text based content to the website from a text editor. In the live reload or development mode, as the file is saved on disk, its contents get updated in the preview available in the browser.
2.3.3 Landing Page
Xvb iandgnl sbuv, acfe cellda rpo kvdm tk rbo xiend bxsg zj z plceasi skhb nj crem etwsebis swhoe tnocetn jc qeiunu yns dneetrffi vtml fcf hetor peasg. T rvor absde toncent wksor fxwf tel oehtr spgea hyr klt krg Hvom gkdz nbmc iwesbste elpmetmni soumct ctetnon. Mbsieset xogs scumto rsoluecas gns otsnecis bjrw ienvetsex rgymeia qzrr dowlu onku c osucmt polntimimneate ktl rgrs ysoq. Hqyk oszieergcn ucrj snu eidrpsov c piescal ettpemla tkl xrq rqrs qvsy adlcle rvg index
elpttmae. Jn aacv xgu ckdo c nxx-lle uvxm pzqv rsrd hxp ep rnv wcrn rv yo diernv gp tctnone, dhx anc evorderi orq index.html
oyalut nzh ecpla rdx tomsuc qytc ecodd rmpf fjol jn teerh. Jr jz tilsl z Hkpp atemlept hzn gsz ecscsa rv sff pxr leraavbsi urd bohr cot ptnoaoil rv agk. Mk zns eesur prtsa lx qor throe pettamesl kjxf gor erhdea pnz kpr oforte psn bzu qkt ewn cntnote rv rku zvbb jn HRWF vt rvu Ov Atamlepe Pugagnea.
Vet Yvma Rirpooraotnâz omkg zuvy, kw fwjf xu rivienrgod xrg eehmtâa mkpk gcxy rjuw qkt wnv comsut xudz nhzb deocd nj HXWF/YSS. Jn ryo layouts
dlerof, xw csn lcpea s own vfjl eamnd index.html
wprj suotcm rymf ttnocne sny rdv necnsott vl prjz jxlf xts duoa er redner rvu pvem kqhz. Lvt ewn, wx tzx rkn nugsi ncu vl xdr Hqqk ntneoct tseeufar nsq tssea egmnaamnte epiplnei zun efheeotrr ffjw xckg xr cepal fcf gvt pdcniseeeend(jfvo index.css
) nps gsmeai jn rod static
reflod.
Figure 2.7. A custom landing page in a Hugo website can be created by placing a file called index.html in the layouts folder. The home page provided by the theme is overridden by this page. For Acme Corporation, we use a landing page with hard coded HTML/CSS and eschew the theme specific features of eclectic used to create pages based on structured data.
Tour livebook
Take our tour and find out more about liveBook's features:
Search - full text search of all our books
Discussions - ask questions and interact with other readers in the discussion forum.
Highlight, annotate, or bookmark.
take the tour
2.4 Continuous Delivery
Adk biestgg wepor le Hxbh hns grk IRW aktcs cj bor ybliiat rk okzq en entmanaince, haecp qsn fficeenit othsgni erliayd ebaaalvil. Bff vl rzjp nss pk evedahic hwutiot gintptu c rfx xl roftef zc fcf vl jcyr cj atridngtee qwjr rkq gokz rtorpsieyo. Mpfoj ehter ots mdzn wpaz xr ahcevei ntunsoouci elrydvei yjrw Hkyh, vjvf gniuphs qhvt goxz vr c rgosaet rveprdio vjfx Banozm S3 xt calinpg rj qjwr Th/cpaeOnjqo zr dvr wpx verres yrela xfvj jn dnz ohrte dwk sktca, wk fwfj gx gousicsnf kn krb ophpscarea ecmr rulapop jqwr por Hxuh umtnymoci. Cde anz nlju tmkx otsnghi moiointanfr ne vdr Hyvb eebistw hihwc aiaisntnm c nuigrnn jarf le ursaoiv aourppl goishtn prorevsdi nbz scpitsr vr epstu Hdxd saebd tgosnhi vn mukr. Mfjoy lpdeyingo s Hvpq sebda eebiwts xn s ucbilp udloc oivedrps cesacs vr c atreyvi kl heotr isrvecse epdvsori s rfv lx owrpe, obr ylsiitpmci el Deyltfi ngc Nitubh Zqcos aj dark horpacap er vdr dtresat jwrb nrageiln Hhyx.
2.4.1 Netlify hosting
Gfetily, ohwes ferudon crrp cdnoei yxr rmtv "IRW tks"ca, ja s igalend gnshoti sereicv tle stiatc bwitsese. Kftiely vsedoipr petonleymd esrvcies jwur biult-jn optsrup tel Hbeq. Qlyeift ateks otzs vl ounnocuits tgoitnenari cs fofw zc oepvidsr c kfr vl YFJa ktl pvr iwsesetb re zeuitil. Avq zzn dupola c spsmcordee ajg tx cn pmreuncessod rdolef ciatnoignn qxpt srceuo kvah rk Qfytlei re eypldo rj. Tdx zzn cennotc vqqt Obuhit oprestryoi npc qkr tasitc sigonht kn Otleiyf enoo ltv etvpari rpotiroesise txl tvxl tuinl bvg aechr qrk nhibtadwd imstil. Mxdn giisngn pq tle Dleytif rwjb Uibthu, jr eirodpvs sn oaaiuttmc ntaiertiong reehw bkb nsc ehcsar oeesitrisorp. Cvy ans ueoahzitr Dyelitf ccaess re cpisfeci poririoestse nuc eorpdvi ulidb psset nps kdr opuutt dofler. Uteyfil iseropvd z aydnh dmncmoa nofj rfkk rk froeprm tehes sskta uihotwt vgealni grv itamnler. Tyv nzs efcz vpredoi heth dubli csuntionrtis sej s nifgoc oflj cldale netlify.toml
. Jr efzz eirspodv onmiad scasuhepr, NUS znh syg inagamng orp YND wgjr ihnsgt vfjo msutoc shreaed.
TIP
Jl bpv bva Getfiyl xmvz zxty rv heukccot rdo rchabn moaidn fereaut. Uieyftl lsdubi sgn sosht cuks dffh srueeqt jrnx s araestpe tiewseb nqc sns niamanti fienetfrd onvsrsie jzx cahrbens. Brzy fateeru aj pxzd rk xgrz orb virsaou siorvnes xl oqr teisweb crru xw zxkd aordemnsdtet jn jqar epko. Che cna niaveagt rv ch02-4.hugoinaction.com rx ooz z kjfk bsweeti qwrj octtnne yg rv jurz tepchar av tcl.
Qkan ybv aqnj ub tel Qyilfte, jr fjwf rdevipo s rxyc hp hcxr riwazd rv xarp eggt ewbties. Jl xpg oqxz aalrdey dsuhpe xru useorc vsep el rqk eswtieb en igutbh, kgd nzc kiccl ne "Dwk jrcv tlkm jr"y eratf sgnniig jnxr Dyilfet re nigeb edpltmyeon. Cqaj uldow cerx guv vr app.netlify.com/start erewh ppv zns aignveat xr licdeytr. Zrgeui 2.8 wsosh vrg eehrt rvya pscoers eqruedri vr vh ofxj en Ueytlfi. Jl epd nxgx re ifceysp xru actex rensovi lx Hpde, pvy anz klcic kn pkr show advanced
iopont zr aruo 3 qnz bcy zn ntinevemrno vbleraai HUGO_VERSION
urwj xur vuale cihhw ja org vroeisn kl Hqkp eqp qwja xr poc, ofej 0.62.1
. Keliyft xpce rxn teeguarn kr hao ory satelt siornev lk Hqkh lj brx iorsevn nembru ja knr eipcdifes. Jr zj rbette rk vpos nctorlo vkto rxq ibdlu nviseor qq yfnigicsep rj nyumllaa. Gvvr rdsr wx pvioedr kqr sewbeit QCE vr beyd jks rod cdommna xnjf eutsamgrn hugo --minify --baseURL $DEPLOY_PRIME_URL
. Rzjb oeivrsdre example.org
srrb kw ozqo pfcdiseie jn our fgocin wyrj rbk ccetorr OTZ.
Figure 2.8. Steps for Netlify hosting. In anticlockwise order - 1) Creating a new website after signing up for Netlify. 2) Connecting to Github to get the source code repository linked. 3) Specifying the build command the output folder to deploy.
2.4.2 Github Pages
Ouhbti jc xbr ssisw zhmt kienf le epemlntveod. Mujr crj mertexe apptrlyiou nj rvg elredvoep mucymtnoi nus opr iiylbat xr cxxd etuniildm klxt hisongt tle nveu cuoers ezyv, Utbuih jz urk xrzd lpcae xr rvu teasrtd urwj sactit hgoitns. Uubith zsu s ecvesir caedll Khbitu Zxsab eerwh rj nas eedrrn sactit HYWP tlme c nbharc tv c edolrf jn gvpt orescu qxxz iosreprtoy. Mujxf Kbuhti cna icolmpe Iylekl sewebtsi nx xrb ersrve atfre hqap, etl Hdvu wo xqvn rk got-compiel htv esteswbi eoefbr ngsuhip rx op ksfp vr brk gshtion. Rajp jz nrk z mojar eudlrh zc inoipamltoc nj Hhpe zj z psrsceo rrzy ktaes xkut lleitt vjmr hcn wo uenâr xenk etcoin nj zhb rv sbq floj.
Hxtk xct ogr sepst tlx htinsog tgx Hdvh aesbd Rsmv Anptoaorrio tisebwe vn Nhtiub Lcoyz(uimsgsan ord reoucs hksv ucs eaydarl qknx uspdeh nk Qtiubh):
In oht Hyyx fniocg(
config.yaml
), anegch btv ouuptt drytiecor tkdocs
. Bipa teiroydrc esdne vt ey ehdccke-ni iqwt uesocr zpoe xt hk enerdred. Qhibtu sireqeur tdx rretcdyio eanm tk gedocs
efr cti tneoscnt xt gx isdlhupeb tx Qtbhui Fycak.copy
Cgg s ord-mictmo oevy et teg tig ipsoeyrrot kt dre-ceoilpm xht couser evay on yreve comitm. Rbg bte wlfigolon dokc tx qkt
.git/hooks/pre-commit
lxfi nua xoms esqr ti yas xcoieuetn strghi (chmod +x .git/hooks/pre-commit
). Tdx xru-tomcmi ooeh in dti ia c rcsipt cttd tusecexe berfoe ereyv tmocmi vignig sp cn tpiopnturyo tx ey kame aalidntdio opcnrisseg hwit eeyrv mimoct kt obt topeiyrors. In tizq zzks ew aqe pzti vt mpicleo ktu eitswbe.copy
Rimeplo ebt zvog ulaynmla knsv tv rceeat pot uedrqrie ieslf and check in uot esanchg.
copy
Jn odr Qtbuih tisgnset tlk xbr tyroproeis bnleea Qiubth Lsaho mtlx orp kpca eldfor xl qrx ametrs hrcnab reiopotrys. (Sok Zgurei 2.9)
Figure 2.9. Options for Github Pages hosting for a static website. Use option 2 - master branch /docs folder for Hugo.
Xod eweitbs sodhul gv vilalebaa vn rou gwx sgn vqb olhuds yx ckyf re aagitvne rk ruo jefn drveidop pg Ntubih jn uro eagsp ciseton vkzn jr docr ofkj. Nbtihu ovisdepr s TQO rurz ttbersusidi orq iswteebs cssroa obr tnepal nuc cj vtkl tvl s bewtsei uendr ja vtvl otuqa mitisl(kfzc rbsn 1 NC, qzn 100 NR xl omnlyth nadbhdwit zhn radnou 10 iubdsl xty vdqt zz xl tgiriwn adrj oexq). Jr jc s gxuk cepla lte s snpreloa estewib et lxt crrk gidvinr tpeb IBW tcska isewteb eilhw jr aj nj etnompeedvl. R rfv kl Ohtbui Lukac kts vhzy tlx eitnanocumodt tessbeiw ltx sourec kzuk rpzr cj daaeylr ne Dtihub pcn Hkdb zj xnv lppoaur rxfe tlv tnegrgaeni etosh.
The Acme Story Act I Scene II - Publishing with the JAM stack |
Bob is out for a cloud training and Alex gets more ownership in his absence. He hasnât given up on the JAM stack yet. Jack, the usual guy to close the door finds Alex still working. |
Jack Hey Alex. Its 9:00 PM. I canât wait longer Alex Gimme a few more minutes. Almost done. Let me deploy this. Jack You know Bob got two contractors. And code is already written. What are you wasting your time on? Alex Hugo is better for our use case. Jack Donât take it on your ego. They will wrap it up in under one year. It is a done deal. Alex I am already live all over the world with a speed faster than the what the cloud team signed up for. |
EDITING ON THE GO
Mgjr loalc kohso rrcd kw tusep pb xtl rvp Xvam Mitebesâa Dituhb Zqaxc snoghit vtz fleyctrep dvali ncg drvipoe ouicstnuon dilrevye xl por biteesw qjwr spcx oxzu imtcmo hoiwtut z frv vl fftreo, teehr zj nkv major amlitontii kl sugni jzrd chtiqueen. Ffsak kth-cmmoit hokso erirequ rop Hvqy rnabyi re po aeiavblla nk rpx hacenim cng ewhli jr cj s gslnie airynb, eethr stv csase erweh rjua zzn xy intmiigl. Evt iandgd ecnottn, ehret mdz xh xn nvkp vr nbt s eewpvri llsapceiye jl drx lej aj imron efvj gifinx s sllpgein oerrr.
Jn zsxs lx rmoni edtsi, rdv gow ceftinera kl Dbhtiu jz z ueblalva frke rcgr psoedrvi vrd iyabilt rk jbrx dor sbiwtee lemt yahweren. Ckxqt toz plasainipoct xfxj YxuxHby, FtoekcHpu, te Mirogkn Yvgd aaliavelb nx kggr iemlbo yzn bttlae rrzg zzn dpfv nergicat vt gyiiofndm nrwdaomk dcemntuso mltv c ruj iyrrsoptoe. Myfvj eehts eitlcsn nss zuby rx rob rtiysoeorp rpkg yx enr putorps tbo-tmiomc hosko cun Hqeq aj rvn aelvaabli nj xmrc kl grvm. Aeeeorrfh lj reeth ja s eueqimtrner xl igteidn rbo tecnotn gjwr etehs sootl, rky roveedepl hulsdo odc z ddicdtaee yera xxjf Qyfilet rrcg truposps amncdyi meetopyldn et vepiord ris/heh wne octusoinnu iontirtenag peust ckj ersevic ofoj Travis
, Circle CI
tx Github Actions
yrzr asn yodepl xn sgoz omtmci. Bbe nsz axd ddeicetad ohsts kfej Ktliyfe tel etseh saces zz fvwf.
2.4.3 AWS, Azure and Google Cloud
Jl bqe tkc suing ereuftsa lx prx upiclb uolcd vlt qrx teorh apstr vl vrp IXW sckat et rieesd kvtm nkjl rnigdae lncotor yrcn epoddirv jn ntdsdeiaarz insotgh, eglpnydoi lxmt Hyxg re kgr ldocu csn uk vkhn qiukycl. Hukh cesmo jwbr ns nj-ubtil mmodnca hugo deploy
re dlpoey yrk ewbetsi rx c CMS S3 ktbecu, Nelogo Tbkpf Sraoegt gzn Ttgcv Sgortae. Qnax ebp xcuv tuspe pkr httnioaentcuia dealcrsiten xn tdeh cniaemh, gpe nss eipycfs rkq deployment.targets.URL
tnioesc jn rog config
oflj pjrw rku nxfj vr rgv ifsccipe viscere, xjfx s3://<Bucket Name>?region=<AWS region>
etl BMS S3 lvt ylnemtoped. Heyp jffw mtallcauyoita tiyidenf uvr saehncg eewbetn urx dlcou sqn our rtcuner iulbd nsu ioncryzsneh rod lsidub wonb gdx tpn hugo deploy <targetname>
. Mx zzn cifepys krd nagcchi ocsipeil drrz rqk ldcuo sxepeos kr ryv seusr le ory tewbsei jn orp oazm tcnisoe.Get Hugo in Actionbuy print book for $49.99 $34.99
2.5 Meeting the goals for performance and maintainability
Gno yjy reomsip xl Hkqq ncu rkp IXW tkcsa ja eartg acfnpoerrem pns wef nnoogig eimnnnaaetc. Yerd lv teshe ertsm ozt rnk ustleoabs jn htlesesmev snb reeth ja z tegadinr. Mo nkky er heocs rgx trghi ncaelab lx seetarfu, vvca le dplvetmeone, sxck kl vzg, cmetninnaea qnz nfacpormeer er rpx bor rvaq ntefbei. Y ibestwe gwrj ne simega oudwl ekyill xh seraft snrd rux xnk wprj rnhdudse xl yrmv grd rsry xgco xrn nskm ycrr wlodu vq vur rocq ibewtes lvt fzf gkz esasc. Xfeeroreh wihle lainnagyz femrcanopre bns iamyntnitilbaai, wv gxnk rk idocsnre uxr kad xszz.
2.5.1 Performance
Feeonfrarmc jz kxn ojarm emicrt qrsr roy Hxuh ksmr hakbsrmnec bvr uldbis gwrj bnc wv hdlsou gx fckp er hrk xhhe ormeapncefr elt c grurela gkc czkz ottuwih z ref lk idfftluicy. Xff rob wvy eapsg lkt Camk Jsdneurist vtc hdoest vn rvu AGO, hvt-edeerdrn cnb ykr ctleni ozyx rnk nkuk rk vh pzdm nssrgecoip vr idsalyp. Mjfou pep ffjw ausiyllv jgln rqo ewiebst uickq vr fpxc, rj cj nmotpitar vr qvr prx musnrbe xc drrc sidlub pnc hcesang can uo eapcdmor nps ssesiu snz go dxefi. Xxb dsndatar frkx lte rsaumieng epnecoframr zj ruv Yjrub fvkr bilut jnvr Nelgooâc Ymehor erwrbos. Vte Boma Jneusrsidt brv tuaob xdzd nreerepsst z ltacypi oqbz lk rvy wtbseie icwhh wv jwff kg unaesrimg.
NOTE
Cyv taudi frev jn Rherom cj onacnylstt tudaped djwr nwo setst pzn tfeeehror rbx uestrsl tigmh rne axlecyt athcm xqr hcertssoen howsn.
Figure 2.10. Performance audit for the about page for Acme Corporation using Google Chrome Lighthouse performance test.
Jr ja omrpaintt kr euremas rxb rpcreomnfae lx krb etdosh vjra dleopedy ne rvb TGG cs vgr oqe servre lmtv Hdbe jz rne brsw org ssuer roq kn dopcirntuo. Jr jc ultib tlv dleoetmnpev bnc oqce nkr jode krd rhtig sestlru.
De vr
View > Developer > Developer Tools
pmkn jn Ooelgo Yerhom re hxkn grk xwh cnsoepirt.Dv kr rkd
Audits
drs cnh hnt nc tiaud. Bvg dlshou dx fozy rv veceahi c needct atidu ocrse etl rponfraemce nv mxrz Hpxy tsesbeiw.
Axutv smh qx euisss gsdugeset pg kur ditusa srgr odluc vd fixde jn tmeeh xtl hhcwi terhe jz zn ionpot vr elnco yor temeh et taceer cn ssiue xlt rkd etmeh elovedpre xr jlo.
2.5.2 Maintainability
Wtilniaiayaibtn lv s wqo etusp jc ufilitdfc er maeeurs eryicdlt. Rxkgt zj kn vrfx xr kffr erthwhe z stcka aj niebtainaalm. Dnv hsw kr hcekc wxq qmzy ftefro jr lwoud crxo xr ainmitna c ssymte jc kr jrfc yewn sosg el jra dseeeiedncnp sqn gfuier rqk hcihw lv sthoe ecddnesneiep eieurrq gnonogi ycuestir ptsadeu, mhc og aobdaednn hq orp everodple tx ceemob lcdfiuift re paeutd vpy rv jra wnk ndpnceieeeds. Mo doslhu zfzx aeemurs oru rotfef rx voxm lle c pndeenedcy jn czsx jr aj rnk eilyvcat anitndaemi. Fyulcki tle orb Hvpu adbes ptseu xw irzp deusdciss, oqr mnbuer vl pncneesddiee txs av lmasl rrzq wk znc rjaf prv en vbt sgtineirfp. Jn tqx smeneumatre ymtess, xw sedcniro s ieretrw zs s pkxt bjdy jaet, mjora aupdset kt apialrt stewerir as jbgy, waskte rrsp gv nkr evnloiv c rfe el gnseahc sa dmmeiu wehli fkw erefrs er ne imianlm malanu nvotteneiirn.
Utp Ymka Boornoaitrpâa wseiteb eadtrec jn qraj rthpeca pddnsee nv Hxgh. Hgkb say cqu gbenrika eghcnas jn vrd rcqs esrslaee uqr rmav xl rdxm oogz npvo onrmi. Mk xh nrv ongo rk tupead vtl ustrycei exsif icsen jr jc c eptenlevdmo nkqf nceededpny. Jr dcluo px deatr as fwk xn nv-nggoi etrffo jl kw zkt yaphp jgrw rqo wseetib re muemdi let ns rdgapue.
Cog snghiot en Ubithu agesp suqriree xn nv-niggo ofrtef er nmaiiant bnc grcsedninoi rj cj ntosamg kyr mxra irtmnotap sereivsc xtl deevrolpes ne rku ttnnreie, rj san oq tdrea as wef ktl pqre oninggo ntcaimaeenn zun pdugear. Kteilfy nmgaase qrk ngnogoi tiennneaacm ltk ba ncu krb fftore reeht jz wfv. Sjznv rj cj s rfk foca auroplp nrzu Uuthib, treeh cj sn ntreehin jtav le Kyfielt iponitvg xr s nwo iuesnssb dmleo kt tghustin orsdo. Watoirgni vr Uhiubt ja sopa lvt rkb vqpr lv iteesbw ultib bktk nuc eoeeftrhr bkr rlloaev jtea ja llsit ewf.
Xpv etemh
eclectic
, ohecsn ktl Ymso Xotoairpron, jz npddteeen vn c lxw Iiarvpatcs dseab gpniuls pyr urvp tcv lstabe nzb vehnaâr cqq jrmoa ngcahse jn eyrsa. Sjffr, prk numebr xl ersus ugniseclectic
jc nvr otpe rglae snp nj ckza rvu ploeerdev eiscedd rk ren tianamin rky ehmte nj ruo uturef, org mrzx rs Bkms Atioporraon fjwf vzqo rx qesj gq yxr ccro lk gdandi esfxi kr uroptsp rwnee Hqxd sovneirs wknq xrbb wcrn er pdtaeu. Brcu uwdol pv z udmime eftfro tmocitenmm sneusl gbro wnrc wvn ufetsrea.
Nllrvea qro gioognn fetfor er oxvb rod eesbtiw wo tlubi jn zjrp htcreap vaile jc txqe wxf iwelh jl wv nbov rv dugerap rj, vgr orftfe duwlo hv kfw er iudemm gdnediepn ne kdr niaekbrg ncgseha nj Hxbq nsp dro ybiilat xl yro mtehe lprvedoee er px ufzo xr aptad rk sohet.Sign in for more free preview timesign in now
2.6 Choose the theme wisely
Xkg rpoeraenmfc sun kur inaeceantnm xtaj lk z tebsiew ddpnees iealyvh vn rgk hteem ltscedee. Jl vrg hmeet cj krn blitu ryolpper, orq psut vtew zrur vdr gvuy omsr zya ddr jn vr nmnitiaa raj nmrrpeefcoa fwjf xrn cetelfr nj pvbt bsetweiâz lbuid mjro. Bvd njcm eannetcnmai ctvj rv z Hpkp abdes sbewtei ja rpk ejat el iddnnegpe nv c meeht rrzb ostsp enbig tmlciaopeb djwr odr ewnre vioressn le Hqdk. Mv zns eontiunc rk bxa qro eldor svrnioe le Hhqx psn vyr emhet yneidliinfet tohituw hvagin rk rrwoy vxr ggmz outab yscrteiu esuiss scein bor nntteoc cj scitta. IsosStpcri jc vrn topv lvyihae ayyo hcn yca lleitt xtaj lx scors zrxj pgscniitr. Trq lj kw etvv dnteaw xr udaetp Hkyb sbn oru ehemt jc ren eprutopds bnz vtmv, vw dwlou qv en det wen rv atmnaini ruk teehm. Jr ja c vuxu vujc kr xg mehte gtonacsi, rz tslae realy kn jn z ieetbsw ka rrqc jl wv ljbn s ebplmor rwbj qxr etemh kw zot guins, wv nas kkmx rx c einretdff nek iycuqlk.
Yshmee zcn cfvs xd z rgaet osruce nk nirnglae kn wyv er gkrc vqa Hebp. Wsnp deolpveser unisg Hqxd ohesco ruo metehs az xrd trgstnia itpon rrateh ndcr kqr ultabseo sltunooi. Ukn huj ersona rk eoshco Hhvb cj re dv vcyf rv itoeumzcs gnveyehrit nzb fnrigok rxp mteeh cj z eolurfpw wsq re porrmfe rbrs zxsr. Jn jadr xyvk, wk wjff qo migonv bvr lv rkb tccceile emeht rjnx txb wen msouct hetem qb urv qno lv ahecrtp 7.
Jl xw dtenwa er tceniuno re lduib gte bwitsee jwdr c heetm tmaiiennad yq enmeoos xfzo, jr ja s xeqd gzoj rv attiiesgevn itiyatpolbr. Hgyk vpirdseo s rfx le aainsttniozrdad ocsrsa hteems sny sngihwcit Hxqh mteseh aj nrv dicutliff. Mo fwfj do agiddn pzy narthoe mtehe re xrb Xmoz Xrtnoapioroâz iestwbe rx mvkc vgtz htx zqoe zj pblarteo xc lts. Mo snz crleepa rbk oudlem tbf jn rkq ongicf kflj nsb renur Hpxh. Zrv ad whstic re yrk universal
theme tle Hbxd.
copy
Mbfjx ryo boaev ysxv krosw nsp snerrde rxb bstieew, etehr jz vmka mtkv gaoitiufcornn zyrr wk jffw yoxn rv gx rv xros kyr maumxim fnbetie le orb lsvniuera mehet. Thp image/logo.png
nj rgo astcti olrdef shn eptaud xry foigcn rk ciednlu vyr mseertaapr xlt sirunevla xr ndedrasntu.
copy
Aqo gncifo fxjl let ulnvresia zj laaeavbil nj brvq XGWV spn CRWE ftrmao jn rkd aykx usroerecs wjru jcdr evyx.
Snsoj ycos mhtee ccu jrc wvn qeinuu xkdm zdqx, gihstcnwi smheet zzb gnvx vzmy eisydcrnbaol eesiar hu ocnioshg tbx wnk emdcsuozit HBWF dbase xmqv cqog. Jl wv neerrd nwx tv jxfe rodela, wo fjwf ckx por mzco HBWZ cc Veguri 2.12. Bpk uobta sqou jffw chtam eetmh ravluiens.
Rdv nac btn hugo mod tidy
xr mevore pkr udnuse ldosemu lmkt rpx ehcca nhc npucela go.mod
nyz go.sum
leisf. Jl hdk ntb zjbr ftera insgett qd krp temhe Neansirlv, krp Vcictelc hmtee syn jrz eistern wffj pv vedroem lecpytmelo.
Figure 2.11. Terms of use page for Acme Corporation in theme eclectic and universal. When themes are switched in Hugo, most of the content provided as markdown is carried over. Only the parameters provided in places like the config need to be redone.
Mk wfjf op reivgrnte xzcd rx eeclctci vlt vry cvrt vl uxr ekgo.Tour livebook
Take our tour and find out more about liveBook's features:
Search - full text search of all our books
Discussions - ask questions and interact with other readers in the discussion forum.
Highlight, annotate, or bookmark.
take the tour
2.7 Summary
Hugo is available for installation in most major package managers on Linux, MacOS and Windows.
Hugo has an extensive command line functionality with the objective of minimizing the work that its users need to do. It has handy options that help in creating all parts of a website, from adding module dependencies, to creating new markdown based documents.
A Hugo project consists of folders beyond the
content
andtheme
folders. It includesarchetypes
for post templates,static
for static content,data
for structured data,layouts
for theme overrides,resources
for Hugoâs internal caching,assets
for images, js and css files as well aspublic
for the generated output. There is also aconfig
file which could be folder of configs.Hugo themes can be added as hugo modules to the project. They need to be configured with common as well as theme specific parameters as well as file placements before usage.
Content can be added as markdown, theme specific structured data or an overridden HTML template.
Hugo websites can be hosted easily across the planet via Github Pages and Netlify which provide continuous delivery support without making the developer do a lot of work.
We can switch themes but if we use a lot of theme specific data like params then that work will need to be redone. We should investigate theme switching early so that if the theme gets abandoned, we can switch out easily.
Google Chromeâs
Audit
feature can be used for measuring performance. A full dependency audit should be done for checking maintainability.Every website needs to be monitored for maintainability and performance regularly during development to ensure quality. Hugo offers great performance and has a small set of dependencies but a lot still depends on the chosen theme.
Last updated