mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-11 14:11:15 +08:00
添加 hugo website
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
|||||||
[submodule "leetcode-cookbook"]
|
|
||||||
path = leetcode-cookbook
|
|
||||||
url = /Users/yudezhi/MyGitHub/LeetCode-Go/leetcode-cookbook
|
|
6
website/archetypes/default.md
Normal file
6
website/archetypes/default.md
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
title: "{{ replace .Name "-" " " | title }}"
|
||||||
|
date: {{ .Date }}
|
||||||
|
draft: true
|
||||||
|
---
|
||||||
|
|
3
website/config.toml
Normal file
3
website/config.toml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
baseURL = "http://example.org/"
|
||||||
|
languageCode = "en-us"
|
||||||
|
title = "My New Hugo Site"
|
41
website/content/_index.md
Normal file
41
website/content/_index.md
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: Introduction
|
||||||
|
type: docs
|
||||||
|
---
|
||||||
|
|
||||||
|
# Acerbo datus maxime
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Astris ipse furtiva
|
||||||
|
|
||||||
|
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
|
||||||
|
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
|
||||||
|
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Suis quot vota
|
||||||
|
|
||||||
|
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
|
||||||
|
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
|
||||||
|
nunc! Fragosis suae dextra geruntur functus vulgata.
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
|
||||||
|
## Tempora nisi nunc
|
||||||
|
|
||||||
|
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
|
||||||
|
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
|
||||||
|
sequens!
|
||||||
|
|
||||||
|
var panel = ram_design;
|
||||||
|
if (backup + system) {
|
||||||
|
file.readPoint = network_native;
|
||||||
|
sidebar_engine_device(cell_tftp_raster,
|
||||||
|
dual_login_paper.adf_vci.application_reader_design(
|
||||||
|
graphicsNvramCdma, lpi_footer_snmp, integer_model));
|
||||||
|
}
|
||||||
|
|
||||||
|
## Locis suis novi cum suoque decidit eadem
|
||||||
|
|
||||||
|
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab?
|
71
website/content/docs/example/_index.md
Normal file
71
website/content/docs/example/_index.md
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
weight: 1
|
||||||
|
bookFlatSection: true
|
||||||
|
title: "Example Site"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
## Ferre hinnitibus erat accipitrem dixi Troiae tollens
|
||||||
|
|
||||||
|
Lorem markdownum, a quoque nutu est *quodcumque mandasset* veluti. Passim
|
||||||
|
inportuna totidemque nympha fert; repetens pendent, poenarum guttura sed vacet
|
||||||
|
non, mortali undas. Omnis pharetramque gramen portentificisque membris servatum
|
||||||
|
novabis fallit de nubibus atque silvas mihi. **Dixit repetitaque Quid**; verrit
|
||||||
|
longa; sententia [mandat](http://pastor-ad.io/questussilvas) quascumque nescio
|
||||||
|
solebat [litore](http://lacrimas-ab.net/); noctes. *Hostem haerentem* circuit
|
||||||
|
[plenaque tamen](http://www.sine.io/in).
|
||||||
|
|
||||||
|
- Pedum ne indigenae finire invergens carpebat
|
||||||
|
- Velit posses summoque
|
||||||
|
- De fumos illa foret
|
||||||
|
|
||||||
|
## Est simul fameque tauri qua ad
|
||||||
|
|
||||||
|
Locum nullus nisi vomentes. Ab Persea sermone vela, miratur aratro; eandem
|
||||||
|
Argolicas gener.
|
||||||
|
|
||||||
|
## Me sol
|
||||||
|
|
||||||
|
Nec dis certa fuit socer, Nonacria **dies** manet tacitaque sibi? Sucis est
|
||||||
|
iactata Castrumque iudex, et iactato quoque terraeque es tandem et maternos
|
||||||
|
vittis. Lumina litus bene poenamque animos callem ne tuas in leones illam dea
|
||||||
|
cadunt genus, et pleno nunc in quod. Anumque crescentesque sanguinis
|
||||||
|
[progenies](http://www.late.net/alimentavirides) nuribus rustica tinguet. Pater
|
||||||
|
omnes liquido creditis noctem.
|
||||||
|
|
||||||
|
if (mirrored(icmp_dvd_pim, 3, smbMirroredHard) != lion(clickImportQueue,
|
||||||
|
viralItunesBalancing, bankruptcy_file_pptp)) {
|
||||||
|
file += ip_cybercrime_suffix;
|
||||||
|
}
|
||||||
|
if (runtimeSmartRom == netMarketingWord) {
|
||||||
|
virusBalancingWin *= scriptPromptBespoke + raster(post_drive,
|
||||||
|
windowsSli);
|
||||||
|
cd = address_hertz_trojan;
|
||||||
|
soap_ccd.pcbServerGigahertz(asp_hardware_isa, offlinePeopleware, nui);
|
||||||
|
} else {
|
||||||
|
megabyte.api = modem_flowchart - web + syntaxHalftoneAddress;
|
||||||
|
}
|
||||||
|
if (3 < mebibyteNetworkAnimated) {
|
||||||
|
pharming_regular_error *= jsp_ribbon + algorithm * recycleMediaKindle(
|
||||||
|
dvrSyntax, cdma);
|
||||||
|
adf_sla *= hoverCropDrive;
|
||||||
|
templateNtfs = -1 - vertical;
|
||||||
|
} else {
|
||||||
|
expressionCompressionVariable.bootMulti = white_eup_javascript(
|
||||||
|
table_suffix);
|
||||||
|
guidPpiPram.tracerouteLinux += rtfTerabyteQuicktime(1,
|
||||||
|
managementRosetta(webcamActivex), 740874);
|
||||||
|
}
|
||||||
|
var virusTweetSsl = nullGigo;
|
||||||
|
|
||||||
|
## Trepident sitimque
|
||||||
|
|
||||||
|
Sentiet et ferali errorem fessam, coercet superbus, Ascaniumque in pennis
|
||||||
|
mediis; dolor? Vidit imi **Aeacon** perfida propositos adde, tua Somni Fluctibus
|
||||||
|
errante lustrat non.
|
||||||
|
|
||||||
|
Tamen inde, vos videt e flammis Scythica parantem rupisque pectora umbras. Haec
|
||||||
|
ficta canistris repercusso simul ego aris Dixit! Esse Fama trepidare hunc
|
||||||
|
crescendo vigor ululasse vertice *exspatiantur* celer tepidique petita aversata
|
||||||
|
oculis iussa est me ferro.
|
@ -0,0 +1,12 @@
|
|||||||
|
# 4th Level of Menu
|
||||||
|
|
||||||
|
## Caesorum illa tu sentit micat vestes papyriferi
|
||||||
|
|
||||||
|
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||||
|
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||||
|
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||||
|
|
||||||
|
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||||
|
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||||
|
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||||
|
iusto! Sedes ante dum superest **extrema**.
|
26
website/content/docs/example/collapsed/3rd-level/_index.md
Normal file
26
website/content/docs/example/collapsed/3rd-level/_index.md
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# 3rd Level of Menu
|
||||||
|
|
||||||
|
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||||
|
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||||
|
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||||
|
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||||
|
|
||||||
|
iscsi_virus = pitch(json_in_on(eupViral),
|
||||||
|
northbridge_services_troubleshooting, personal(
|
||||||
|
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||||
|
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||||
|
mips_whitelist_duplex, cpa)));
|
||||||
|
if (5) {
|
||||||
|
managementNetwork += dma - boolean;
|
||||||
|
kilohertz_token = 2;
|
||||||
|
honeypot_affiliate_ergonomics = fiber;
|
||||||
|
}
|
||||||
|
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||||
|
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||||
|
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||||
|
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||||
|
ripcordingMashup)));
|
||||||
|
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||||
|
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||||
|
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||||
|
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
23
website/content/docs/example/collapsed/_index.md
Normal file
23
website/content/docs/example/collapsed/_index.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
bookCollapseSection: true
|
||||||
|
weight: 20
|
||||||
|
---
|
||||||
|
|
||||||
|
# Collapsed Level of Menu
|
||||||
|
|
||||||
|
## Cognita laeva illo fracta
|
||||||
|
|
||||||
|
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
|
||||||
|
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
|
||||||
|
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
|
||||||
|
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
|
||||||
|
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
|
||||||
|
frondes *gelidos* gravidae circumtulit [inpulit armenta
|
||||||
|
nativum](http://incurvasustulit.io/illi-virtute.html).
|
||||||
|
|
||||||
|
1. Te at cruciabere vides rubentis manebo
|
||||||
|
2. Maturuit in praetemptat ruborem ignara postquam habitasse
|
||||||
|
3. Subitarum supplevit quoque fontesque venabula spretis modo
|
||||||
|
4. Montis tot est mali quasque gravis
|
||||||
|
5. Quinquennem domus arsit ipse
|
||||||
|
6. Pellem turis pugnabant locavit
|
52
website/content/docs/example/hidden.md
Normal file
52
website/content/docs/example/hidden.md
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
bookHidden: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# This page is hidden in menu
|
||||||
|
|
||||||
|
# Quondam non pater est dignior ille Eurotas
|
||||||
|
|
||||||
|
## Latent te facies
|
||||||
|
|
||||||
|
Lorem markdownum arma ignoscas vocavit quoque ille texit mandata mentis ultimus,
|
||||||
|
frementes, qui in vel. Hippotades Peleus [pennas
|
||||||
|
conscia](http://gratia.net/tot-qua.php) cuiquam Caeneus quas.
|
||||||
|
|
||||||
|
- Pater demittere evincitque reddunt
|
||||||
|
- Maxime adhuc pressit huc Danaas quid freta
|
||||||
|
- Soror ego
|
||||||
|
- Luctus linguam saxa ultroque prior Tatiumque inquit
|
||||||
|
- Saepe liquitur subita superata dederat Anius sudor
|
||||||
|
|
||||||
|
## Cum honorum Latona
|
||||||
|
|
||||||
|
O fallor [in sustinui
|
||||||
|
iussorum](http://www.spectataharundine.org/aquas-relinquit.html) equidem.
|
||||||
|
Nymphae operi oris alii fronde parens dumque, in auro ait mox ingenti proxima
|
||||||
|
iamdudum maius?
|
||||||
|
|
||||||
|
reality(burnDocking(apache_nanometer),
|
||||||
|
pad.property_data_programming.sectorBrowserPpga(dataMask, 37,
|
||||||
|
recycleRup));
|
||||||
|
intellectualVaporwareUser += -5 * 4;
|
||||||
|
traceroute_key_upnp /= lag_optical(android.smb(thyristorTftp));
|
||||||
|
surge_host_golden = mca_compact_device(dual_dpi_opengl, 33,
|
||||||
|
commerce_add_ppc);
|
||||||
|
if (lun_ipv) {
|
||||||
|
verticalExtranet(1, thumbnail_ttl, 3);
|
||||||
|
bar_graphics_jpeg(chipset - sector_xmp_beta);
|
||||||
|
}
|
||||||
|
|
||||||
|
## Fronde cetera dextrae sequens pennis voce muneris
|
||||||
|
|
||||||
|
Acta cretus diem restet utque; move integer, oscula non inspirat, noctisque
|
||||||
|
scelus! Nantemque in suas vobis quamvis, et labori!
|
||||||
|
|
||||||
|
var runtimeDiskCompiler = home - array_ad_software;
|
||||||
|
if (internic > disk) {
|
||||||
|
emoticonLockCron += 37 + bps - 4;
|
||||||
|
wan_ansi_honeypot.cardGigaflops = artificialStorageCgi;
|
||||||
|
simplex -= downloadAccess;
|
||||||
|
}
|
||||||
|
var volumeHardeningAndroid = pixel + tftp + onProcessorUnmount;
|
||||||
|
sector(memory(firewire + interlaced, wired));
|
85
website/content/docs/example/table-of-contents/_index.md
Normal file
85
website/content/docs/example/table-of-contents/_index.md
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
---
|
||||||
|
weight: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
# Ubi loqui
|
||||||
|
|
||||||
|
## Mentem genus facietque salire tempus bracchia
|
||||||
|
|
||||||
|
Lorem markdownum partu paterno Achillem. Habent amne generosi aderant ad pellem
|
||||||
|
nec erat sustinet merces columque haec et, dixit minus nutrit accipiam subibis
|
||||||
|
subdidit. Temeraria servatum agros qui sed fulva facta. Primum ultima, dedit,
|
||||||
|
suo quisque linguae medentes fixo: tum petis.
|
||||||
|
|
||||||
|
## Rapit vocant si hunc siste adspice
|
||||||
|
|
||||||
|
Ora precari Patraeque Neptunia, dixit Danae [Cithaeron
|
||||||
|
armaque](http://mersis-an.org/litoristum) maxima in **nati Coniugis** templis
|
||||||
|
fluidove. Effugit usus nec ingreditur agmen *ac manus* conlato. Nullis vagis
|
||||||
|
nequiquam vultibus aliquos altera *suum venis* teneas fretum. Armos [remotis
|
||||||
|
hoc](http://tutum.io/me) sine ferrea iuncta quam!
|
||||||
|
|
||||||
|
## Locus fuit caecis
|
||||||
|
|
||||||
|
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||||
|
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||||
|
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||||
|
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||||
|
|
||||||
|
iscsi_virus = pitch(json_in_on(eupViral),
|
||||||
|
northbridge_services_troubleshooting, personal(
|
||||||
|
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||||
|
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||||
|
mips_whitelist_duplex, cpa)));
|
||||||
|
if (5) {
|
||||||
|
managementNetwork += dma - boolean;
|
||||||
|
kilohertz_token = 2;
|
||||||
|
honeypot_affiliate_ergonomics = fiber;
|
||||||
|
}
|
||||||
|
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||||
|
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||||
|
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||||
|
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||||
|
ripcordingMashup)));
|
||||||
|
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||||
|
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||||
|
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||||
|
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
||||||
|
|
||||||
|
## Placabilis coactis nega ingemuit ignoscat nimia non
|
||||||
|
|
||||||
|
Frontis turba. Oculi gravis est Delphice; *inque praedaque* sanguine manu non.
|
||||||
|
|
||||||
|
if (ad_api) {
|
||||||
|
zif += usb.tiffAvatarRate(subnet, digital_rt) + exploitDrive;
|
||||||
|
gigaflops(2 - bluetooth, edi_asp_memory.gopher(queryCursor, laptop),
|
||||||
|
panel_point_firmware);
|
||||||
|
spyware_bash.statePopApplet = express_netbios_digital(
|
||||||
|
insertion_troubleshooting.brouter(recordFolderUs), 65);
|
||||||
|
}
|
||||||
|
recursionCoreRay = -5;
|
||||||
|
if (hub == non) {
|
||||||
|
portBoxVirus = soundWeb(recursive_card(rwTechnologyLeopard),
|
||||||
|
font_radcab, guidCmsScalable + reciprocalMatrixPim);
|
||||||
|
left.bug = screenshot;
|
||||||
|
} else {
|
||||||
|
tooltipOpacity = raw_process_permalink(webcamFontUser, -1);
|
||||||
|
executable_router += tape;
|
||||||
|
}
|
||||||
|
if (tft) {
|
||||||
|
bandwidthWeb *= social_page;
|
||||||
|
} else {
|
||||||
|
regular += 611883;
|
||||||
|
thumbnail /= system_lag_keyboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Caesorum illa tu sentit micat vestes papyriferi
|
||||||
|
|
||||||
|
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||||
|
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||||
|
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||||
|
|
||||||
|
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||||
|
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||||
|
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||||
|
iusto! Sedes ante dum superest **extrema**.
|
64
website/content/docs/example/table-of-contents/with-toc.md
Normal file
64
website/content/docs/example/table-of-contents/with-toc.md
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
title: With ToC
|
||||||
|
weight: 1
|
||||||
|
---
|
||||||
|
# Caput vino delphine in tamen vias
|
||||||
|
|
||||||
|
## Cognita laeva illo fracta
|
||||||
|
|
||||||
|
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
|
||||||
|
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
|
||||||
|
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
|
||||||
|
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
|
||||||
|
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
|
||||||
|
frondes *gelidos* gravidae circumtulit [inpulit armenta
|
||||||
|
nativum](http://incurvasustulit.io/illi-virtute.html).
|
||||||
|
|
||||||
|
1. Te at cruciabere vides rubentis manebo
|
||||||
|
2. Maturuit in praetemptat ruborem ignara postquam habitasse
|
||||||
|
3. Subitarum supplevit quoque fontesque venabula spretis modo
|
||||||
|
4. Montis tot est mali quasque gravis
|
||||||
|
5. Quinquennem domus arsit ipse
|
||||||
|
6. Pellem turis pugnabant locavit
|
||||||
|
|
||||||
|
## Natus quaerere
|
||||||
|
|
||||||
|
Pectora et sine mulcere, coniuge dum tincta incurvae. Quis iam; est dextra
|
||||||
|
Peneosque, metuis a verba, primo. Illa sed colloque suis: magno: gramen, aera
|
||||||
|
excutiunt concipit.
|
||||||
|
|
||||||
|
> Phrygiae petendo suisque extimuit, super, pars quod audet! Turba negarem.
|
||||||
|
> Fuerat attonitus; et dextra retinet sidera ulnas undas instimulat vacuae
|
||||||
|
> generis? *Agnus* dabat et ignotis dextera, sic tibi pacis **feriente at mora**
|
||||||
|
> euhoeque *comites hostem* vestras Phineus. Vultuque sanguine dominoque [metuit
|
||||||
|
> risi](http://iuvat.org/eundem.php) fama vergit summaque meus clarissimus
|
||||||
|
> artesque tinguebat successor nominis cervice caelicolae.
|
||||||
|
|
||||||
|
## Limitibus misere sit
|
||||||
|
|
||||||
|
Aurea non fata repertis praerupit feruntur simul, meae hosti lentaque *citius
|
||||||
|
levibus*, cum sede dixit, Phaethon texta. *Albentibus summos* multifidasque
|
||||||
|
iungitur loquendi an pectore, mihi ursaque omnia adfata, aeno parvumque in animi
|
||||||
|
perlucentes. Epytus agis ait vixque clamat ornum adversam spondet, quid sceptra
|
||||||
|
ipsum **est**. Reseret nec; saeva suo passu debentia linguam terga et aures et
|
||||||
|
cervix [de](http://www.amnem.io/pervenit.aspx) ubera. Coercet gelidumque manus,
|
||||||
|
doluit volvitur induta?
|
||||||
|
|
||||||
|
## Enim sua
|
||||||
|
|
||||||
|
Iuvenilior filia inlustre templa quidem herbis permittat trahens huic. In
|
||||||
|
cruribus proceres sole crescitque *fata*, quos quos; merui maris se non tamen
|
||||||
|
in, mea.
|
||||||
|
|
||||||
|
## Germana aves pignus tecta
|
||||||
|
|
||||||
|
Mortalia rudibusque caelum cognosceret tantum aquis redito felicior texit, nec,
|
||||||
|
aris parvo acre. Me parum contulerant multi tenentem, gratissime suis; vultum tu
|
||||||
|
occupat deficeret corpora, sonum. E Actaea inplevit Phinea concepit nomenque
|
||||||
|
potest sanguine captam nulla et, in duxisses campis non; mercede. Dicere cur
|
||||||
|
Leucothoen obitum?
|
||||||
|
|
||||||
|
Postibus mittam est *nubibus principium pluma*, exsecratur facta et. Iunge
|
||||||
|
Mnemonidas pallamque pars; vere restitit alis flumina quae **quoque**, est
|
||||||
|
ignara infestus Pyrrha. Di ducis terris maculatum At sede praemia manes
|
||||||
|
nullaque!
|
@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
title: Without ToC
|
||||||
|
weight: 2
|
||||||
|
bookToc: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# At me ipso nepotibus nunc celebratior genus
|
||||||
|
|
||||||
|
## Tanto oblite
|
||||||
|
|
||||||
|
Lorem markdownum pectora novis patenti igne sua opus aurae feras materiaque
|
||||||
|
illic demersit imago et aristas questaque posset. Vomit quoque suo inhaesuro
|
||||||
|
clara. Esse cumque, per referri triste. Ut exponit solisque communis in tendens
|
||||||
|
vincetis agisque iamque huic bene ante vetat omina Thebae rates. Aeacus servat
|
||||||
|
admonitu concidit, ad resimas vultus et rugas vultu **dignamque** Siphnon.
|
||||||
|
|
||||||
|
Quam iugulum regia simulacra, plus meruit humo pecorumque haesit, ab discedunt
|
||||||
|
dixit: ritu pharetramque. Exul Laurenti orantem modo, per densum missisque labor
|
||||||
|
manibus non colla unum, obiectat. Tu pervia collo, fessus quae Cretenque Myconon
|
||||||
|
crate! Tegumenque quae invisi sudore per vocari quaque plus ventis fluidos. Nodo
|
||||||
|
perque, fugisse pectora sorores.
|
||||||
|
|
||||||
|
## Summe promissa supple vadit lenius
|
||||||
|
|
||||||
|
Quibus largis latebris aethera versato est, ait sentiat faciemque. Aequata alis
|
||||||
|
nec Caeneus exululat inclite corpus est, ire **tibi** ostendens et tibi. Rigent
|
||||||
|
et vires dique possent lumina; **eadem** dixit poma funeribus paret et felix
|
||||||
|
reddebant ventis utile lignum.
|
||||||
|
|
||||||
|
1. Remansit notam Stygia feroxque
|
||||||
|
2. Et dabit materna
|
||||||
|
3. Vipereas Phrygiaeque umbram sollicito cruore conlucere suus
|
||||||
|
4. Quarum Elis corniger
|
||||||
|
5. Nec ieiunia dixit
|
||||||
|
|
||||||
|
Vertitur mos ortu ramosam contudit dumque; placabat ac lumen. Coniunx Amoris
|
||||||
|
spatium poenamque cavernis Thebae Pleiadasque ponunt, rapiare cum quae parum
|
||||||
|
nimium rima.
|
||||||
|
|
||||||
|
## Quidem resupinus inducto solebat una facinus quae
|
||||||
|
|
||||||
|
Credulitas iniqua praepetibus paruit prospexit, voce poena, sub rupit sinuatur,
|
||||||
|
quin suum ventorumque arcadiae priori. Soporiferam erat formamque, fecit,
|
||||||
|
invergens, nymphae mutat fessas ait finge.
|
||||||
|
|
||||||
|
1. Baculum mandataque ne addere capiti violentior
|
||||||
|
2. Altera duas quam hoc ille tenues inquit
|
||||||
|
3. Sicula sidereus latrantis domoque ratae polluit comites
|
||||||
|
4. Possit oro clausura namque se nunc iuvenisque
|
||||||
|
5. Faciem posuit
|
||||||
|
6. Quodque cum ponunt novercae nata vestrae aratra
|
||||||
|
|
||||||
|
Ite extrema Phrygiis, patre dentibus, tonso perculit, enim blanda, manibus fide
|
||||||
|
quos caput armis, posse! Nocendo fas Alcyonae lacertis structa ferarum manus
|
||||||
|
fulmen dubius, saxa caelum effuge extremis fixum tumor adfecit **bella**,
|
||||||
|
potentes? Dum nec insidiosa tempora tegit
|
||||||
|
[spirarunt](http://mihiferre.net/iuvenes-peto.html). Per lupi pars foliis,
|
||||||
|
porreximus humum negant sunt subposuere Sidone steterant auro. Memoraverit sine:
|
||||||
|
ferrum idem Orion caelum heres gerebat fixis?
|
3
website/content/docs/shortcodes/_index.md
Normal file
3
website/content/docs/shortcodes/_index.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
bookFlatSection: true
|
||||||
|
---
|
13
website/content/docs/shortcodes/buttons.md
Normal file
13
website/content/docs/shortcodes/buttons.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Buttons
|
||||||
|
|
||||||
|
Buttons are styled links that can lead to local page or external link.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* button relref="/" [class="..."] */>}}Get Home{{</* /button */>}}
|
||||||
|
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Contribute{{</* /button */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< button relref="/" >}}Get Home{{< /button >}}
|
||||||
|
{{< button href="https://github.com/alex-shpak/hugo-book" >}}Contribute{{< /button >}}
|
45
website/content/docs/shortcodes/columns.md
Normal file
45
website/content/docs/shortcodes/columns.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Columns
|
||||||
|
|
||||||
|
Columns help organize shorter pieces of content horizontally for readability.
|
||||||
|
|
||||||
|
|
||||||
|
```html
|
||||||
|
{{</* columns */>}} <!-- begin columns block -->
|
||||||
|
# Left Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
|
||||||
|
<---> <!-- magic sparator, between columns -->
|
||||||
|
|
||||||
|
# Mid Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
|
||||||
|
<---> <!-- magic sparator, between columns -->
|
||||||
|
|
||||||
|
# Right Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /columns */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Left Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Mid Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter!
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Right Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /columns >}}
|
22
website/content/docs/shortcodes/details.md
Normal file
22
website/content/docs/shortcodes/details.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# Details
|
||||||
|
|
||||||
|
Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```tpl
|
||||||
|
{{</* details "Title" [open] */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /details */>}}
|
||||||
|
```
|
||||||
|
```tpl
|
||||||
|
{{</* details title="Title" open=true */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /details */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< details "Title" open >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{< /details >}}
|
35
website/content/docs/shortcodes/expand.md
Normal file
35
website/content/docs/shortcodes/expand.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Expand
|
||||||
|
|
||||||
|
Expand shortcode can help to decrease clutter on screen by hiding part of text. Expand content by clicking on it.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
### Default
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* expand */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /expand */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< expand >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{< /expand >}}
|
||||||
|
|
||||||
|
### With Custom Label
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* expand "Custom Label" "..." */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /expand */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< expand "Custom Label" "..." >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /expand >}}
|
32
website/content/docs/shortcodes/hints.md
Normal file
32
website/content/docs/shortcodes/hints.md
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# Hints
|
||||||
|
|
||||||
|
Hint shortcode can be used as hint/alerts/notification block.
|
||||||
|
There are 3 colors to choose: `info`, `warning` and `danger`.
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* hint [info|warning|danger] */>}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{</* /hint */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< hint info >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
|
{{< hint warning >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
|
{{< hint danger >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
28
website/content/docs/shortcodes/katex.md
Normal file
28
website/content/docs/shortcodes/katex.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# KaTeX
|
||||||
|
|
||||||
|
KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/)
|
||||||
|
|
||||||
|
## Example
|
||||||
|
{{< columns >}}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{</* katex [display] [class="text-center"] */>}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{</* /katex */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
{{< katex display >}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{< /katex >}}
|
||||||
|
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
## Display Mode Example
|
||||||
|
|
||||||
|
Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block`
|
||||||
|
{{< katex display >}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{< /katex >}}
|
||||||
|
Text continues here.
|
38
website/content/docs/shortcodes/mermaid.md
Normal file
38
website/content/docs/shortcodes/mermaid.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Mermaid Chart
|
||||||
|
|
||||||
|
[Mermaid](https://mermaidjs.github.io/) is library for generating svg charts and diagrams from text.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
```tpl
|
||||||
|
{{</* mermaid [class="text-center"]*/>}}
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>Bob: Hello Bob, how are you?
|
||||||
|
alt is sick
|
||||||
|
Bob->>Alice: Not so good :(
|
||||||
|
else is well
|
||||||
|
Bob->>Alice: Feeling fresh like a daisy
|
||||||
|
end
|
||||||
|
opt Extra response
|
||||||
|
Bob->>Alice: Thanks for asking
|
||||||
|
end
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>Bob: Hello Bob, how are you?
|
||||||
|
alt is sick
|
||||||
|
Bob->>Alice: Not so good :(
|
||||||
|
else is well
|
||||||
|
Bob->>Alice: Feeling fresh like a daisy
|
||||||
|
end
|
||||||
|
opt Extra response
|
||||||
|
Bob->>Alice: Thanks for asking
|
||||||
|
end
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
{{< /columns >}}
|
15
website/content/docs/shortcodes/section/_index.md
Normal file
15
website/content/docs/shortcodes/section/_index.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
bookCollapseSection: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Section
|
||||||
|
|
||||||
|
Section renders pages in section as definition list, using title and description.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* section */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{<section>}}
|
1
website/content/docs/shortcodes/section/page1.md
Normal file
1
website/content/docs/shortcodes/section/page1.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Page 1
|
1
website/content/docs/shortcodes/section/page2.md
Normal file
1
website/content/docs/shortcodes/section/page2.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Page 2
|
50
website/content/docs/shortcodes/tabs.md
Normal file
50
website/content/docs/shortcodes/tabs.md
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Tabs
|
||||||
|
|
||||||
|
Tabs let you organize content by context, for example installation instructions for each supported platform.
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* tabs "uniqueid" */>}}
|
||||||
|
{{</* tab "MacOS" */>}} # MacOS Content {{</* /tab */>}}
|
||||||
|
{{</* tab "Linux" */>}} # Linux Content {{</* /tab */>}}
|
||||||
|
{{</* tab "Windows" */>}} # Windows Content {{</* /tab */>}}
|
||||||
|
{{</* /tabs */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< tabs "uniqueid" >}}
|
||||||
|
{{< tab "MacOS" >}}
|
||||||
|
# MacOS
|
||||||
|
|
||||||
|
This is tab **MacOS** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
|
||||||
|
{{< tab "Linux" >}}
|
||||||
|
|
||||||
|
# Linux
|
||||||
|
|
||||||
|
This is tab **Linux** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
|
||||||
|
{{< tab "Windows" >}}
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
|
||||||
|
This is tab **Windows** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
{{< /tabs >}}
|
22
website/content/menu/index.md
Normal file
22
website/content/menu/index.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
headless: true
|
||||||
|
---
|
||||||
|
|
||||||
|
- [**Example Site**]({{< relref "/docs/example" >}})
|
||||||
|
- [Table of Contents]({{< relref "/docs/example/table-of-contents" >}})
|
||||||
|
- [With ToC]({{< relref "/docs/example/table-of-contents/with-toc" >}})
|
||||||
|
- [Without ToC]({{< relref "/docs/example/table-of-contents/without-toc" >}})
|
||||||
|
- [Collapsed]({{< relref "/docs/example/collapsed" >}})
|
||||||
|
- [3rd]({{< relref "/docs/example/collapsed/3rd-level" >}})
|
||||||
|
- [4th]({{< relref "/docs/example/collapsed/3rd-level/4th-level" >}})
|
||||||
|
<br />
|
||||||
|
|
||||||
|
- **Shortcodes**
|
||||||
|
- [Buttons]({{< relref "/docs/shortcodes/buttons" >}})
|
||||||
|
- [Columns]({{< relref "/docs/shortcodes/columns" >}})
|
||||||
|
- [Expand]({{< relref "/docs/shortcodes/expand" >}})
|
||||||
|
- [Hints]({{< relref "/docs/shortcodes/hints" >}})
|
||||||
|
- [Katex]({{< relref "/docs/shortcodes/katex" >}})
|
||||||
|
- [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}})
|
||||||
|
- [Tabs]({{< relref "/docs/shortcodes/tabs" >}})
|
||||||
|
<br />
|
7
website/content/posts/_index.md
Normal file
7
website/content/posts/_index.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
menu:
|
||||||
|
after:
|
||||||
|
name: blog
|
||||||
|
weight: 5
|
||||||
|
title: Blog
|
||||||
|
---
|
1150
website/content/posts/creating-a-new-theme.md
Normal file
1150
website/content/posts/creating-a-new-theme.md
Normal file
File diff suppressed because it is too large
Load Diff
344
website/content/posts/goisforlovers.md
Normal file
344
website/content/posts/goisforlovers.md
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
+++
|
||||||
|
title = "(Hu)go Template Primer"
|
||||||
|
description = ""
|
||||||
|
tags = [
|
||||||
|
"go",
|
||||||
|
"golang",
|
||||||
|
"templates",
|
||||||
|
"themes",
|
||||||
|
"development",
|
||||||
|
]
|
||||||
|
date = "2014-04-02"
|
||||||
|
categories = [
|
||||||
|
"Development",
|
||||||
|
"golang",
|
||||||
|
]
|
||||||
|
menu = "main"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
|
||||||
|
its template engine. It is an extremely lightweight engine that provides a very
|
||||||
|
small amount of logic. In our experience that it is just the right amount of
|
||||||
|
logic to be able to create a good static website. If you have used other
|
||||||
|
template systems from different languages or frameworks you will find a lot of
|
||||||
|
similarities in Go templates.
|
||||||
|
|
||||||
|
This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate]
|
||||||
|
provide more details.
|
||||||
|
|
||||||
|
## Introduction to Go Templates
|
||||||
|
|
||||||
|
Go templates provide an extremely simple template language. It adheres to the
|
||||||
|
belief that only the most basic of logic belongs in the template or view layer.
|
||||||
|
One consequence of this simplicity is that Go templates parse very quickly.
|
||||||
|
|
||||||
|
A unique characteristic of Go templates is they are content aware. Variables and
|
||||||
|
content will be sanitized depending on the context of where they are used. More
|
||||||
|
details can be found in the [Go docs][gohtmltemplate].
|
||||||
|
|
||||||
|
## Basic Syntax
|
||||||
|
|
||||||
|
Golang templates are HTML files with the addition of variables and
|
||||||
|
functions.
|
||||||
|
|
||||||
|
**Go variables and functions are accessible within {{ }}**
|
||||||
|
|
||||||
|
Accessing a predefined variable "foo":
|
||||||
|
|
||||||
|
{{ foo }}
|
||||||
|
|
||||||
|
**Parameters are separated using spaces**
|
||||||
|
|
||||||
|
Calling the add function with input of 1, 2:
|
||||||
|
|
||||||
|
{{ add 1 2 }}
|
||||||
|
|
||||||
|
**Methods and fields are accessed via dot notation**
|
||||||
|
|
||||||
|
Accessing the Page Parameter "bar"
|
||||||
|
|
||||||
|
{{ .Params.bar }}
|
||||||
|
|
||||||
|
**Parentheses can be used to group items together**
|
||||||
|
|
||||||
|
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
Each Go template has a struct (object) made available to it. In hugo each
|
||||||
|
template is passed either a page or a node struct depending on which type of
|
||||||
|
page you are rendering. More details are available on the
|
||||||
|
[variables](/layout/variables) page.
|
||||||
|
|
||||||
|
A variable is accessed by referencing the variable name.
|
||||||
|
|
||||||
|
<title>{{ .Title }}</title>
|
||||||
|
|
||||||
|
Variables can also be defined and referenced.
|
||||||
|
|
||||||
|
{{ $address := "123 Main St."}}
|
||||||
|
{{ $address }}
|
||||||
|
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
Go template ship with a few functions which provide basic functionality. The Go
|
||||||
|
template system also provides a mechanism for applications to extend the
|
||||||
|
available functions with their own. [Hugo template
|
||||||
|
functions](/layout/functions) provide some additional functionality we believe
|
||||||
|
are useful for building websites. Functions are called by using their name
|
||||||
|
followed by the required parameters separated by spaces. Template
|
||||||
|
functions cannot be added without recompiling hugo.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ add 1 2 }}
|
||||||
|
|
||||||
|
## Includes
|
||||||
|
|
||||||
|
When including another template you will pass to it the data it will be
|
||||||
|
able to access. To pass along the current context please remember to
|
||||||
|
include a trailing dot. The templates location will always be starting at
|
||||||
|
the /layout/ directory within Hugo.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ template "chrome/header.html" . }}
|
||||||
|
|
||||||
|
|
||||||
|
## Logic
|
||||||
|
|
||||||
|
Go templates provide the most basic iteration and conditional logic.
|
||||||
|
|
||||||
|
### Iteration
|
||||||
|
|
||||||
|
Just like in Go, the Go templates make heavy use of range to iterate over
|
||||||
|
a map, array or slice. The following are different examples of how to use
|
||||||
|
range.
|
||||||
|
|
||||||
|
**Example 1: Using Context**
|
||||||
|
|
||||||
|
{{ range array }}
|
||||||
|
{{ . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 2: Declaring value variable name**
|
||||||
|
|
||||||
|
{{range $element := array}}
|
||||||
|
{{ $element }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 2: Declaring key and value variable name**
|
||||||
|
|
||||||
|
{{range $index, $element := array}}
|
||||||
|
{{ $index }}
|
||||||
|
{{ $element }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
### Conditionals
|
||||||
|
|
||||||
|
If, else, with, or, & and provide the framework for handling conditional
|
||||||
|
logic in Go Templates. Like range, each statement is closed with `end`.
|
||||||
|
|
||||||
|
|
||||||
|
Go Templates treat the following values as false:
|
||||||
|
|
||||||
|
* false
|
||||||
|
* 0
|
||||||
|
* any array, slice, map, or string of length zero
|
||||||
|
|
||||||
|
**Example 1: If**
|
||||||
|
|
||||||
|
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
|
||||||
|
|
||||||
|
**Example 2: If -> Else**
|
||||||
|
|
||||||
|
{{ if isset .Params "alt" }}
|
||||||
|
{{ index .Params "alt" }}
|
||||||
|
{{else}}
|
||||||
|
{{ index .Params "caption" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 3: And & Or**
|
||||||
|
|
||||||
|
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
||||||
|
|
||||||
|
**Example 4: With**
|
||||||
|
|
||||||
|
An alternative way of writing "if" and then referencing the same value
|
||||||
|
is to use "with" instead. With rebinds the context `.` within its scope,
|
||||||
|
and skips the block if the variable is absent.
|
||||||
|
|
||||||
|
The first example above could be simplified as:
|
||||||
|
|
||||||
|
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
|
||||||
|
|
||||||
|
**Example 5: If -> Else If**
|
||||||
|
|
||||||
|
{{ if isset .Params "alt" }}
|
||||||
|
{{ index .Params "alt" }}
|
||||||
|
{{ else if isset .Params "caption" }}
|
||||||
|
{{ index .Params "caption" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
## Pipes
|
||||||
|
|
||||||
|
One of the most powerful components of Go templates is the ability to
|
||||||
|
stack actions one after another. This is done by using pipes. Borrowed
|
||||||
|
from unix pipes, the concept is simple, each pipeline's output becomes the
|
||||||
|
input of the following pipe.
|
||||||
|
|
||||||
|
Because of the very simple syntax of Go templates, the pipe is essential
|
||||||
|
to being able to chain together function calls. One limitation of the
|
||||||
|
pipes is that they only can work with a single value and that value
|
||||||
|
becomes the last parameter of the next pipeline.
|
||||||
|
|
||||||
|
A few simple examples should help convey how to use the pipe.
|
||||||
|
|
||||||
|
**Example 1 :**
|
||||||
|
|
||||||
|
{{ if eq 1 1 }} Same {{ end }}
|
||||||
|
|
||||||
|
is the same as
|
||||||
|
|
||||||
|
{{ eq 1 1 | if }} Same {{ end }}
|
||||||
|
|
||||||
|
It does look odd to place the if at the end, but it does provide a good
|
||||||
|
illustration of how to use the pipes.
|
||||||
|
|
||||||
|
**Example 2 :**
|
||||||
|
|
||||||
|
{{ index .Params "disqus_url" | html }}
|
||||||
|
|
||||||
|
Access the page parameter called "disqus_url" and escape the HTML.
|
||||||
|
|
||||||
|
**Example 3 :**
|
||||||
|
|
||||||
|
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
||||||
|
Stuff Here
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
Could be rewritten as
|
||||||
|
|
||||||
|
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
|
||||||
|
Stuff Here
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
## Context (aka. the dot)
|
||||||
|
|
||||||
|
The most easily overlooked concept to understand about Go templates is that {{ . }}
|
||||||
|
always refers to the current context. In the top level of your template this
|
||||||
|
will be the data set made available to it. Inside of a iteration it will have
|
||||||
|
the value of the current item. When inside of a loop the context has changed. .
|
||||||
|
will no longer refer to the data available to the entire page. If you need to
|
||||||
|
access this from within the loop you will likely want to set it to a variable
|
||||||
|
instead of depending on the context.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ $title := .Site.Title }}
|
||||||
|
{{ range .Params.tags }}
|
||||||
|
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
Notice how once we have entered the loop the value of {{ . }} has changed. We
|
||||||
|
have defined a variable outside of the loop so we have access to it from within
|
||||||
|
the loop.
|
||||||
|
|
||||||
|
# Hugo Parameters
|
||||||
|
|
||||||
|
Hugo provides the option of passing values to the template language
|
||||||
|
through the site configuration (for sitewide values), or through the meta
|
||||||
|
data of each specific piece of content. You can define any values of any
|
||||||
|
type (supported by your front matter/config format) and use them however
|
||||||
|
you want to inside of your templates.
|
||||||
|
|
||||||
|
|
||||||
|
## Using Content (page) Parameters
|
||||||
|
|
||||||
|
In each piece of content you can provide variables to be used by the
|
||||||
|
templates. This happens in the [front matter](/content/front-matter).
|
||||||
|
|
||||||
|
An example of this is used in this documentation site. Most of the pages
|
||||||
|
benefit from having the table of contents provided. Sometimes the TOC just
|
||||||
|
doesn't make a lot of sense. We've defined a variable in our front matter
|
||||||
|
of some pages to turn off the TOC from being displayed.
|
||||||
|
|
||||||
|
Here is the example front matter:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
title: "Permalinks"
|
||||||
|
date: "2013-11-18"
|
||||||
|
aliases:
|
||||||
|
- "/doc/permalinks/"
|
||||||
|
groups: ["extras"]
|
||||||
|
groups_weight: 30
|
||||||
|
notoc: true
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is the corresponding code inside of the template:
|
||||||
|
|
||||||
|
{{ if not .Params.notoc }}
|
||||||
|
<div id="toc" class="well col-md-4 col-sm-6">
|
||||||
|
{{ .TableOfContents }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Using Site (config) Parameters
|
||||||
|
In your top-level configuration file (eg, `config.yaml`) you can define site
|
||||||
|
parameters, which are values which will be available to you in chrome.
|
||||||
|
|
||||||
|
For instance, you might declare:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
params:
|
||||||
|
CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved."
|
||||||
|
TwitterUser: "spf13"
|
||||||
|
SidebarRecentLimit: 5
|
||||||
|
```
|
||||||
|
|
||||||
|
Within a footer layout, you might then declare a `<footer>` which is only
|
||||||
|
provided if the `CopyrightHTML` parameter is provided, and if it is given,
|
||||||
|
you would declare it to be HTML-safe, so that the HTML entity is not escaped
|
||||||
|
again. This would let you easily update just your top-level config file each
|
||||||
|
January 1st, instead of hunting through your templates.
|
||||||
|
|
||||||
|
```
|
||||||
|
{{if .Site.Params.CopyrightHTML}}<footer>
|
||||||
|
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
|
||||||
|
</footer>{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
An alternative way of writing the "if" and then referencing the same value
|
||||||
|
is to use "with" instead. With rebinds the context `.` within its scope,
|
||||||
|
and skips the block if the variable is absent:
|
||||||
|
|
||||||
|
```
|
||||||
|
{{with .Site.Params.TwitterUser}}<span class="twitter">
|
||||||
|
<a href="https://twitter.com/{{.}}" rel="author">
|
||||||
|
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
|
||||||
|
alt="Twitter"></a>
|
||||||
|
</span>{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, if you want to pull "magic constants" out of your layouts, you can do
|
||||||
|
so, such as in this example:
|
||||||
|
|
||||||
|
```
|
||||||
|
<nav class="recent">
|
||||||
|
<h1>Recent Posts</h1>
|
||||||
|
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
|
||||||
|
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
|
||||||
|
{{end}}</ul>
|
||||||
|
</nav>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
[go]: https://golang.org/
|
||||||
|
[gohtmltemplate]: https://golang.org/pkg/html/template/
|
89
website/content/posts/hugoisforlovers.md
Normal file
89
website/content/posts/hugoisforlovers.md
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
+++
|
||||||
|
title = "Getting Started with Hugo"
|
||||||
|
description = ""
|
||||||
|
tags = [
|
||||||
|
"go",
|
||||||
|
"golang",
|
||||||
|
"hugo",
|
||||||
|
"development",
|
||||||
|
]
|
||||||
|
date = "2014-04-02"
|
||||||
|
categories = [
|
||||||
|
"Development",
|
||||||
|
"golang",
|
||||||
|
]
|
||||||
|
menu = "main"
|
||||||
|
+++
|
||||||
|
|
||||||
|
## Step 1. Install Hugo
|
||||||
|
|
||||||
|
Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the
|
||||||
|
appropriate version for your OS and architecture.
|
||||||
|
|
||||||
|
Save it somewhere specific as we will be using it in the next step.
|
||||||
|
|
||||||
|
More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/)
|
||||||
|
|
||||||
|
## Step 2. Build the Docs
|
||||||
|
|
||||||
|
Hugo has its own example site which happens to also be the documentation site
|
||||||
|
you are reading right now.
|
||||||
|
|
||||||
|
Follow the following steps:
|
||||||
|
|
||||||
|
1. Clone the [Hugo repository](http://github.com/spf13/hugo)
|
||||||
|
2. Go into the repo
|
||||||
|
3. Run hugo in server mode and build the docs
|
||||||
|
4. Open your browser to http://localhost:1313
|
||||||
|
|
||||||
|
Corresponding pseudo commands:
|
||||||
|
|
||||||
|
git clone https://github.com/spf13/hugo
|
||||||
|
cd hugo
|
||||||
|
/path/to/where/you/installed/hugo server --source=./docs
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 27 ms
|
||||||
|
> Web Server is available at http://localhost:1313
|
||||||
|
> Press ctrl+c to stop
|
||||||
|
|
||||||
|
Once you've gotten here, follow along the rest of this page on your local build.
|
||||||
|
|
||||||
|
## Step 3. Change the docs site
|
||||||
|
|
||||||
|
Stop the Hugo process by hitting Ctrl+C.
|
||||||
|
|
||||||
|
Now we are going to run hugo again, but this time with hugo in watch mode.
|
||||||
|
|
||||||
|
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 27 ms
|
||||||
|
> Web Server is available at http://localhost:1313
|
||||||
|
> Watching for changes in /Users/spf13/Code/hugo/docs/content
|
||||||
|
> Press ctrl+c to stop
|
||||||
|
|
||||||
|
|
||||||
|
Open your [favorite editor](http://vim.spf13.com) and change one of the source
|
||||||
|
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
|
||||||
|
|
||||||
|
Content files are found in `docs/content/`. Unless otherwise specified, files
|
||||||
|
are located at the same relative location as the url, in our case
|
||||||
|
`docs/content/overview/quickstart.md`.
|
||||||
|
|
||||||
|
Change and save this file.. Notice what happened in your terminal.
|
||||||
|
|
||||||
|
> Change detected, rebuilding site
|
||||||
|
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 26 ms
|
||||||
|
|
||||||
|
Refresh the browser and observe that the typo is now fixed.
|
||||||
|
|
||||||
|
Notice how quick that was. Try to refresh the site before it's finished building. I double dare you.
|
||||||
|
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
|
||||||
|
|
||||||
|
## Step 4. Have fun
|
||||||
|
|
||||||
|
The best way to learn something is to play with it.
|
156
website/content/posts/migrate-from-jekyll.md
Normal file
156
website/content/posts/migrate-from-jekyll.md
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
---
|
||||||
|
date: 2014-03-10
|
||||||
|
linktitle: Migrating from Jekyll
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
parent: tutorials
|
||||||
|
prev: /tutorials/mathjax
|
||||||
|
title: Migrate to Hugo from Jekyll
|
||||||
|
weight: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
## Move static content to `static`
|
||||||
|
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
|
||||||
|
With Jekyll, something that looked like
|
||||||
|
|
||||||
|
▾ <root>/
|
||||||
|
▾ images/
|
||||||
|
logo.png
|
||||||
|
|
||||||
|
should become
|
||||||
|
|
||||||
|
▾ <root>/
|
||||||
|
▾ static/
|
||||||
|
▾ images/
|
||||||
|
logo.png
|
||||||
|
|
||||||
|
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
|
||||||
|
|
||||||
|
## Create your Hugo configuration file
|
||||||
|
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
|
||||||
|
|
||||||
|
## Set your configuration publish folder to `_site`
|
||||||
|
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
|
||||||
|
|
||||||
|
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
|
||||||
|
|
||||||
|
git submodule deinit _site
|
||||||
|
git rm _site
|
||||||
|
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
|
||||||
|
|
||||||
|
2. Or, change the Hugo configuration to use `_site` instead of `public`.
|
||||||
|
|
||||||
|
{
|
||||||
|
..
|
||||||
|
"publishdir": "_site",
|
||||||
|
..
|
||||||
|
}
|
||||||
|
|
||||||
|
## Convert Jekyll templates to Hugo templates
|
||||||
|
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
|
||||||
|
|
||||||
|
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
|
||||||
|
|
||||||
|
## Convert Jekyll plugins to Hugo shortcodes
|
||||||
|
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
|
||||||
|
|
||||||
|
### Implementation
|
||||||
|
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
|
||||||
|
|
||||||
|
Jekyll's plugin:
|
||||||
|
|
||||||
|
module Jekyll
|
||||||
|
class ImageTag < Liquid::Tag
|
||||||
|
@url = nil
|
||||||
|
@caption = nil
|
||||||
|
@class = nil
|
||||||
|
@link = nil
|
||||||
|
// Patterns
|
||||||
|
IMAGE_URL_WITH_CLASS_AND_CAPTION =
|
||||||
|
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
|
||||||
|
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
|
||||||
|
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
|
||||||
|
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
|
||||||
|
def initialize(tag_name, markup, tokens)
|
||||||
|
super
|
||||||
|
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
@caption = $7
|
||||||
|
@link = $9
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
@caption = $7
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CAPTION
|
||||||
|
@url = $1
|
||||||
|
@caption = $5
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CLASS
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
elsif markup =~ IMAGE_URL
|
||||||
|
@url = $1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def render(context)
|
||||||
|
if @class
|
||||||
|
source = "<figure class='#{@class}'>"
|
||||||
|
else
|
||||||
|
source = "<figure>"
|
||||||
|
end
|
||||||
|
if @link
|
||||||
|
source += "<a href=\"#{@link}\">"
|
||||||
|
end
|
||||||
|
source += "<img src=\"#{@url}\">"
|
||||||
|
if @link
|
||||||
|
source += "</a>"
|
||||||
|
end
|
||||||
|
source += "<figcaption>#{@caption}</figcaption>" if @caption
|
||||||
|
source += "</figure>"
|
||||||
|
source
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Liquid::Template.register_tag('image', Jekyll::ImageTag)
|
||||||
|
|
||||||
|
is written as this Hugo shortcode:
|
||||||
|
|
||||||
|
<!-- image -->
|
||||||
|
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
|
||||||
|
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
||||||
|
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
|
||||||
|
{{ if .Get "link"}}</a>{{ end }}
|
||||||
|
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||||
|
<figcaption>{{ if isset .Params "title" }}
|
||||||
|
{{ .Get "title" }}{{ end }}
|
||||||
|
{{ if or (.Get "caption") (.Get "attr")}}<p>
|
||||||
|
{{ .Get "caption" }}
|
||||||
|
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
|
||||||
|
{{ .Get "attr" }}
|
||||||
|
{{ if .Get "attrlink"}}</a> {{ end }}
|
||||||
|
</p> {{ end }}
|
||||||
|
</figcaption>
|
||||||
|
{{ end }}
|
||||||
|
</figure>
|
||||||
|
<!-- image -->
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
I simply changed:
|
||||||
|
|
||||||
|
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
|
||||||
|
|
||||||
|
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
|
||||||
|
|
||||||
|
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
|
||||||
|
|
||||||
|
As a bonus, the shortcode named parameters are, arguably, more readable.
|
||||||
|
|
||||||
|
## Finishing touches
|
||||||
|
### Fix content
|
||||||
|
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
|
||||||
|
|
||||||
|
### Clean up
|
||||||
|
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
|
||||||
|
|
||||||
|
## A practical example in a diff
|
||||||
|
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
{"Target":"book.min.6cd8553a6854f4812343f0f0c8baca31271e686434f381fbe3c7226f66639176.css","MediaType":"text/css","Data":{"Integrity":"sha256-bNhVOmhU9IEjQ/DwyLrKMSceaGQ084H748cib2ZjkXY="}}
|
33
website/themes/book/.github/workflows/main.yml
vendored
Normal file
33
website/themes/book/.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
name: Build with Hugo
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
hugo-latest:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Install Hugo
|
||||||
|
run: |
|
||||||
|
LATEST_VERSION=`curl --silent "https://api.github.com/repos/gohugoio/hugo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'`
|
||||||
|
VERSION_NO_PREFIX=`echo $LATEST_VERSION | cut -c 2-`
|
||||||
|
wget "https://github.com/gohugoio/hugo/releases/download/$LATEST_VERSION/hugo_extended_${VERSION_NO_PREFIX}_Linux-64bit.deb" -O /tmp/hugo.deb
|
||||||
|
sudo dpkg -i /tmp/hugo.deb
|
||||||
|
|
||||||
|
- name: Run Hugo
|
||||||
|
working-directory: exampleSite
|
||||||
|
run: hugo --themesDir ../..
|
||||||
|
hugo-minimum:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Install Hugo
|
||||||
|
run: |
|
||||||
|
wget "https://github.com/gohugoio/hugo/releases/download/v0.68.0/hugo_extended_0.68.0_Linux-64bit.deb" -O /tmp/hugo.deb
|
||||||
|
sudo dpkg -i /tmp/hugo.deb
|
||||||
|
|
||||||
|
- name: Run Hugo
|
||||||
|
working-directory: exampleSite
|
||||||
|
run: hugo --themesDir ../..
|
3
website/themes/book/.gitignore
vendored
Normal file
3
website/themes/book/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public/
|
||||||
|
exampleSite/public/
|
||||||
|
.DS_Store
|
20
website/themes/book/LICENSE
Normal file
20
website/themes/book/LICENSE
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2018 Alex Shpak
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
304
website/themes/book/README.md
Normal file
304
website/themes/book/README.md
Normal file
@ -0,0 +1,304 @@
|
|||||||
|
# Hugo Book Theme
|
||||||
|
|
||||||
|
[](https://gohugo.io)
|
||||||
|
[](LICENSE)
|
||||||
|

|
||||||
|
|
||||||
|
### [Hugo](https://gohugo.io) documentation theme as simple as plain book
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- [Features](#features)
|
||||||
|
- [Requirements](#requirements)
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Menu](#menu)
|
||||||
|
- [Blog](#blog)
|
||||||
|
- [Configuration](#configuration)
|
||||||
|
- [Shortcodes](#shortcodes)
|
||||||
|
- [Versioning](#versioning)
|
||||||
|
- [Contributing](#contributing)
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Clean simple design
|
||||||
|
- Light and Mobile-Friendly
|
||||||
|
- Multi-language support
|
||||||
|
- Customisable
|
||||||
|
- Zero initial configuration
|
||||||
|
- Handy shortcodes
|
||||||
|
- Comments support
|
||||||
|
- Simple blog and taxonomy
|
||||||
|
- Primary features work without JavaScript
|
||||||
|
- Dark Mode
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- Hugo 0.68 or higher
|
||||||
|
- Hugo extended version, read more [here](https://gohugo.io/news/0.48-relnotes/)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Navigate to your hugo project root and run:
|
||||||
|
|
||||||
|
```
|
||||||
|
git submodule add https://github.com/alex-shpak/hugo-book themes/book
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run hugo (or set `theme = "book"`/`theme: book` in configuration file)
|
||||||
|
|
||||||
|
```
|
||||||
|
hugo server --minify --theme book
|
||||||
|
```
|
||||||
|
|
||||||
|
### Creating site from scratch
|
||||||
|
|
||||||
|
Below is an example on how to create a new site from scratch:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
hugo new site mydocs; cd mydocs
|
||||||
|
git init
|
||||||
|
git submodule add https://github.com/alex-shpak/hugo-book themes/book
|
||||||
|
cp -R themes/book/exampleSite/content .
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
hugo server --minify --theme book
|
||||||
|
```
|
||||||
|
|
||||||
|
## Menu
|
||||||
|
|
||||||
|
### File tree menu (default)
|
||||||
|
|
||||||
|
By default, the theme will render pages from the `content/docs` section as a menu in a tree structure.
|
||||||
|
You can set `title` and `weight` in the front matter of pages to adjust the order and titles in the menu.
|
||||||
|
|
||||||
|
### Leaf bundle menu
|
||||||
|
|
||||||
|
You can also use leaf bundle and the content of its `index.md` file as menu.
|
||||||
|
Given you have the following file structure:
|
||||||
|
|
||||||
|
```
|
||||||
|
├── content
|
||||||
|
│ ├── docs
|
||||||
|
│ │ ├── page-one.md
|
||||||
|
│ │ └── page-two.md
|
||||||
|
│ └── posts
|
||||||
|
│ ├── post-one.md
|
||||||
|
│ └── post-two.md
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a file `content/menu/index.md` with the content:
|
||||||
|
|
||||||
|
```md
|
||||||
|
+++
|
||||||
|
headless = true
|
||||||
|
+++
|
||||||
|
|
||||||
|
- [Book Example]({{< relref "/docs/" >}})
|
||||||
|
- [Page One]({{< relref "/docs/page-one" >}})
|
||||||
|
- [Page Two]({{< relref "/docs/page-two" >}})
|
||||||
|
- [Blog]({{< relref "/posts" >}})
|
||||||
|
```
|
||||||
|
|
||||||
|
And Enable it by setting `BookMenuBundle: /menu` in Site configuration.
|
||||||
|
|
||||||
|
- [Example menu](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/content/menu/index.md)
|
||||||
|
- [Example config file](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml)
|
||||||
|
- [Leaf bundles](https://gohugo.io/content-management/page-bundles/)
|
||||||
|
|
||||||
|
## Blog
|
||||||
|
|
||||||
|
A simple blog is supported in the section `posts`.
|
||||||
|
A blog is not the primary usecase of this theme, so it has only minimal features.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
### Site Configuration
|
||||||
|
|
||||||
|
There are a few configuration options that you can add to your `config.toml` file.
|
||||||
|
You can also see the `yaml` example [here](https://github.com/alex-shpak/hugo-book/blob/master/exampleSite/config.yaml).
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# (Optional) Set Google Analytics if you use it to track your website.
|
||||||
|
# Always put it on the top of the configuration file, otherwise it won't work
|
||||||
|
googleAnalytics = "UA-XXXXXXXXX-X"
|
||||||
|
|
||||||
|
# (Optional) If you provide a Disqus shortname, comments will be enabled on
|
||||||
|
# all pages.
|
||||||
|
disqusShortname = "my-site"
|
||||||
|
|
||||||
|
# (Optional) Set this to true if you use capital letters in file names
|
||||||
|
disablePathToLower = true
|
||||||
|
|
||||||
|
# (Optional) Set this to true to enable 'Last Modified by' date and git author
|
||||||
|
# information on 'doc' type pages.
|
||||||
|
enableGitInfo = true
|
||||||
|
|
||||||
|
# (Optional) Theme is intended for documentation use, therefore it doesn't render taxonomy.
|
||||||
|
# You can remove related files with config below
|
||||||
|
disableKinds = ['taxonomy', 'taxonomyTerm']
|
||||||
|
|
||||||
|
[params]
|
||||||
|
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||||
|
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||||
|
# You can also specify this parameter per page in front matter.
|
||||||
|
BookToC = true
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be 'logo.png'
|
||||||
|
BookLogo = 'logo.png'
|
||||||
|
|
||||||
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
|
# When not specified file structure and weights will be used
|
||||||
|
BookMenuBundle = '/menu'
|
||||||
|
|
||||||
|
# (Optional, default docs) Specify section of content to render as menu
|
||||||
|
# You can also set value to "*" to render all sections to menu
|
||||||
|
BookSection = 'docs'
|
||||||
|
|
||||||
|
# Set source repository location.
|
||||||
|
# Used for 'Last Modified' and 'Edit this page' links.
|
||||||
|
BookRepo = 'https://github.com/alex-shpak/hugo-book'
|
||||||
|
|
||||||
|
# Enable 'Edit this page' links for 'doc' page type.
|
||||||
|
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
|
||||||
|
# Path must point to the site directory.
|
||||||
|
BookEditPath = 'edit/master/exampleSite'
|
||||||
|
|
||||||
|
# (Optional, default January 2, 2006) Configure the date format used on the pages
|
||||||
|
# - In git information
|
||||||
|
# - In blog posts
|
||||||
|
BookDateFormat = 'Jan 2, 2006'
|
||||||
|
|
||||||
|
# (Optional, default true) Enables search function with flexsearch,
|
||||||
|
# Index is built on fly, therefore it might slowdown your website.
|
||||||
|
# Configuration for indexing can be adjusted in i18n folder per language.
|
||||||
|
BookSearch = true
|
||||||
|
|
||||||
|
# (Optional, default true) Enables comments template on pages
|
||||||
|
# By default partials/docs/comments.html includes Disqus template
|
||||||
|
# See https://gohugo.io/content-management/comments/#configure-disqus
|
||||||
|
# Can be overwritten by same param in page frontmatter
|
||||||
|
BookComments = true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
|
||||||
|
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
|
||||||
|
# Theme will print warning if page referenced in markdown does not exists.
|
||||||
|
BookPortableLinks = true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
|
||||||
|
BookServiceWorker = true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Multi-Language Support
|
||||||
|
|
||||||
|
Theme supports Hugo's [multilingual mode](https://gohugo.io/content-management/multilingual/), just follow configuration guide there. You can also tweak search indexing configuration per language in `i18n` folder.
|
||||||
|
|
||||||
|
### Page Configuration
|
||||||
|
|
||||||
|
You can specify additional params in the front matter of individual pages:
|
||||||
|
|
||||||
|
```toml
|
||||||
|
# Set type to 'docs' if you want to render page outside of configured section or if you render section other than 'docs'
|
||||||
|
type = 'docs'
|
||||||
|
|
||||||
|
# Set page weight to re-arrange items in file-tree menu (if BookMenuBundle not set)
|
||||||
|
weight = 10
|
||||||
|
|
||||||
|
# (Optional) Set to mark page as flat section in file-tree menu (if BookMenuBundle not set)
|
||||||
|
bookFlatSection = true
|
||||||
|
|
||||||
|
# (Optional, Experimental) Set to hide nested sections or pages at that level. Works only with file-tree menu mode
|
||||||
|
bookCollapseSection = true
|
||||||
|
|
||||||
|
# (Optional) Set true to hide page or section from side menu (if BookMenuBundle not set)
|
||||||
|
bookHidden = true
|
||||||
|
|
||||||
|
# (Optional) Set 'false' to hide ToC from page
|
||||||
|
bookToC = true
|
||||||
|
|
||||||
|
# (Optional) If you have enabled BookComments for the site, you can disable it for specific pages.
|
||||||
|
bookComments = true
|
||||||
|
```
|
||||||
|
|
||||||
|
### Partials
|
||||||
|
|
||||||
|
There are few empty partials you can override in `layouts/partials/`
|
||||||
|
|
||||||
|
| Partial | Placement |
|
||||||
|
| -------------------------------------------------- | -------------------------------------- |
|
||||||
|
| `layouts/partials/docs/inject/head.html` | Before closing `<head>` tag |
|
||||||
|
| `layouts/partials/docs/inject/body.html` | Before closing `<body>` tag |
|
||||||
|
| `layouts/partials/docs/inject/footer.html` | After page footer content |
|
||||||
|
| `layouts/partials/docs/inject/menu-before.html` | At the beginning of `<nav>` menu block |
|
||||||
|
| `layouts/partials/docs/inject/menu-after.html` | At the end of `<nav>` menu block |
|
||||||
|
| `layouts/partials/docs/inject/content-before.html` | Before page content |
|
||||||
|
| `layouts/partials/docs/inject/content-after.html` | After page content |
|
||||||
|
|
||||||
|
### Extra Customisation
|
||||||
|
|
||||||
|
| File | Description |
|
||||||
|
| ------------------------ | ------------------------------------------------------------------------------------- |
|
||||||
|
| `static/favicon.png` | Override default favicon |
|
||||||
|
| `assets/_custom.scss` | Customise or override scss styles |
|
||||||
|
| `assets/_variables.scss` | Override default SCSS variables |
|
||||||
|
| `assets/_fonts.scss` | Replace default font with custom fonts (e.g. local files or remote like google fonts) |
|
||||||
|
|
||||||
|
### Plugins
|
||||||
|
|
||||||
|
There are a few features implemented as plugable `scss` styles. Usually these are features that don't make it to the core but can still be useful.
|
||||||
|
|
||||||
|
| Plugin | Description |
|
||||||
|
| --------------------------------- | ----------------------------------------------------------- |
|
||||||
|
| `assets/plugins/_dark.scss` | Switches site to dark mode |
|
||||||
|
| `assets/plugins/_numbered.scss` | Makes headings in markdown numbered, e.g. `1.1`, `1.2` |
|
||||||
|
| `assets/plugins/_scrollbars.scss` | Overrides scrollbar styles to look similar across platforms |
|
||||||
|
|
||||||
|
To enable plugins, add `@import "plugins/{name}";` to `assets/_custom.scss` in your website root. One exception is `_dark.scss` which contains variables only and should be added to `assets/_variables.scss`.
|
||||||
|
|
||||||
|
### Hugo Internal Templates
|
||||||
|
|
||||||
|
There are a few hugo templates inserted in `<head>`
|
||||||
|
|
||||||
|
- [Google Analytics](https://gohugo.io/templates/internal/#google-analytics)
|
||||||
|
- [Open Graph](https://gohugo.io/templates/internal/#open-graph)
|
||||||
|
|
||||||
|
## Shortcodes
|
||||||
|
|
||||||
|
- [Buttons](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/buttons/)
|
||||||
|
- [Columns](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/columns/)
|
||||||
|
- [Expand](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/expand/)
|
||||||
|
- [Hints](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/hints/)
|
||||||
|
- [KaTeX](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/katex/)
|
||||||
|
- [Mermaid](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/mermaid/)
|
||||||
|
- [Tabs](https://themes.gohugo.io/theme/hugo-book/docs/shortcodes/tabs/)
|
||||||
|
|
||||||
|
By default, Goldmark trims unsafe outputs which might prevent some shortcodes from rendering. It is recommended to set `markup.goldmark.renderer.unsafe=true` if you encounter problems.
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[markup.goldmark.renderer]
|
||||||
|
unsafe = true
|
||||||
|
```
|
||||||
|
If you are using ```config.yaml``` or ```config.json```, consult the [configuration markup](https://gohugo.io/getting-started/configuration-markup/)
|
||||||
|
|
||||||
|
## Versioning
|
||||||
|
|
||||||
|
This theme follows a simple incremental versioning. e.g. `v1`, `v2` and so on. There might be breaking changes between versions.
|
||||||
|
|
||||||
|
If you want lower maintenance, use one of the released versions. If you want to live on the bleeding edge of changes, you can use the `master` branch and update your website when needed.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
### [Extra credits to contributors](https://github.com/alex-shpak/hugo-book/graphs/contributors)
|
||||||
|
|
||||||
|
Contributions are welcome and I will review and consider pull requests.
|
||||||
|
Primary goals are:
|
||||||
|
|
||||||
|
- Keep it simple.
|
||||||
|
- Keep minimal (or zero) default configuration.
|
||||||
|
- Avoid interference with user-defined layouts.
|
||||||
|
- Avoid using JS if it can be solved by CSS.
|
||||||
|
|
||||||
|
Feel free to open issues if you find missing configuration or customisation options.
|
9
website/themes/book/archetypes/docs.md
Normal file
9
website/themes/book/archetypes/docs.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
title: "{{ .Name | humanize | title }}"
|
||||||
|
weight: 1
|
||||||
|
# bookFlatSection: false
|
||||||
|
# bookToc: true
|
||||||
|
# bookHidden: false
|
||||||
|
# bookCollapseSection: false
|
||||||
|
# bookComments: true
|
||||||
|
---
|
4
website/themes/book/archetypes/posts.md
Normal file
4
website/themes/book/archetypes/posts.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: "{{ replace .Name "-" " " | title }}"
|
||||||
|
date: {{ .Date }}
|
||||||
|
---
|
3
website/themes/book/assets/_custom.scss
Normal file
3
website/themes/book/assets/_custom.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* You can add custom styles here. */
|
||||||
|
|
||||||
|
// @import "plugins/numbered";
|
50
website/themes/book/assets/_defaults.scss
Normal file
50
website/themes/book/assets/_defaults.scss
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Used in layout
|
||||||
|
$padding-1: 1px !default;
|
||||||
|
$padding-4: 0.25rem !default;
|
||||||
|
$padding-8: 0.5rem !default;
|
||||||
|
$padding-16: 1rem !default;
|
||||||
|
|
||||||
|
$font-size-base: 16px !default;
|
||||||
|
$font-size-12: 0.75rem !default;
|
||||||
|
$font-size-14: 0.875rem !default;
|
||||||
|
$font-size-16: 1rem !default;
|
||||||
|
|
||||||
|
$border-radius: $padding-4 !default;
|
||||||
|
|
||||||
|
// Grayscale
|
||||||
|
$white: #ffffff !default;
|
||||||
|
$gray-100: #f8f9fa !default;
|
||||||
|
$gray-200: #e9ecef !default;
|
||||||
|
$gray-300: #dee2e6 !default;
|
||||||
|
$gray-400: #ced4da !default;
|
||||||
|
$gray-500: #adb5bd !default;
|
||||||
|
$gray-600: #868e96 !default;
|
||||||
|
$gray-700: #495057 !default;
|
||||||
|
$gray-800: #343a40 !default;
|
||||||
|
$gray-900: #212529 !default;
|
||||||
|
$black: #000 !default;
|
||||||
|
|
||||||
|
$color-link: #05b !default;
|
||||||
|
$color-visited-link: #8440f1 !default;
|
||||||
|
|
||||||
|
$body-background: white !default;
|
||||||
|
$body-font-color: $black !default;
|
||||||
|
$body-font-weight: normal !default;
|
||||||
|
|
||||||
|
$body-min-width: 20rem !default;
|
||||||
|
$container-max-width: 80rem !default;
|
||||||
|
|
||||||
|
$header-height: 3.5rem !default;
|
||||||
|
$menu-width: 16rem !default;
|
||||||
|
$toc-width: 16rem !default;
|
||||||
|
|
||||||
|
$mobile-breakpoint: $menu-width + $body-min-width * 1.2 + $toc-width !default;
|
||||||
|
|
||||||
|
// Hint colors
|
||||||
|
$hint-colors: (
|
||||||
|
info: #6bf,
|
||||||
|
warning: #fd6,
|
||||||
|
danger: #f66
|
||||||
|
) !default;
|
||||||
|
|
||||||
|
$icon-filter: none !default;
|
49
website/themes/book/assets/_fonts.scss
Normal file
49
website/themes/book/assets/_fonts.scss
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/* roboto-300italic - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto';
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 300;
|
||||||
|
font-display: swap;
|
||||||
|
src: local('Roboto Light Italic'), local('Roboto-LightItalic'),
|
||||||
|
url('fonts/roboto-v19-latin-300italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('fonts/roboto-v19-latin-300italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
/* roboto-regular - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: local('Roboto'), local('Roboto-Regular'),
|
||||||
|
url('fonts/roboto-v19-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('fonts/roboto-v19-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
/* roboto-700 - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: local('Roboto Bold'), local('Roboto-Bold'),
|
||||||
|
url('fonts/roboto-v19-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('fonts/roboto-v19-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* roboto-mono-regular - latin */
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Roboto Mono';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: local('Roboto Mono'), local('RobotoMono-Regular'),
|
||||||
|
url('fonts/roboto-mono-v6-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
|
||||||
|
url('fonts/roboto-mono-v6-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
font-family: 'Roboto', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
font-family: 'Roboto Mono', monospace;
|
||||||
|
}
|
381
website/themes/book/assets/_main.scss
Normal file
381
website/themes/book/assets/_main.scss
Normal file
@ -0,0 +1,381 @@
|
|||||||
|
html {
|
||||||
|
font-size: $font-size-base;
|
||||||
|
scroll-behavior: smooth;
|
||||||
|
touch-action: manipulation;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
min-width: $body-min-width;
|
||||||
|
color: $body-font-color;
|
||||||
|
background: $body-background;
|
||||||
|
|
||||||
|
letter-spacing: 0.33px;
|
||||||
|
font-weight: $body-font-weight;
|
||||||
|
text-rendering: optimizeLegibility;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
|
box-sizing: border-box;
|
||||||
|
* {
|
||||||
|
box-sizing: inherit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5 {
|
||||||
|
font-weight: $body-font-weight;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
color: $color-link;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
:focus {
|
||||||
|
@include outline;
|
||||||
|
}
|
||||||
|
|
||||||
|
aside nav ul {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
li {
|
||||||
|
margin: 1em 0;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul {
|
||||||
|
padding-inline-start: $padding-16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.pagination {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
list-style-type: none;
|
||||||
|
|
||||||
|
.page-item a {
|
||||||
|
padding: $padding-16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: $container-max-width;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-icon {
|
||||||
|
filter: $icon-filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-brand {
|
||||||
|
margin-top: 0;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 1.5em;
|
||||||
|
width: auto;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-inline-end: $padding-8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-menu {
|
||||||
|
flex: 0 0 $menu-width;
|
||||||
|
font-size: $font-size-14;
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: $menu-width;
|
||||||
|
padding: $padding-16;
|
||||||
|
background: $body-background;
|
||||||
|
|
||||||
|
@include fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.active {
|
||||||
|
color: $color-link;
|
||||||
|
}
|
||||||
|
|
||||||
|
a.collapsed {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "▸";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-section-flat {
|
||||||
|
margin-bottom: $padding-16 * 2;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
margin-top: $padding-16 * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
> a,
|
||||||
|
> span {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
> ul {
|
||||||
|
padding-inline-start: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-page {
|
||||||
|
min-width: $body-min-width;
|
||||||
|
flex-grow: 1;
|
||||||
|
padding: $padding-16;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-post {
|
||||||
|
margin-bottom: $padding-16 * 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-header {
|
||||||
|
display: none;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
|
||||||
|
label {
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-search {
|
||||||
|
position: relative;
|
||||||
|
margin: $padding-16 0;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
padding: $padding-8;
|
||||||
|
|
||||||
|
border: 0;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
background: $gray-100;
|
||||||
|
color: $body-font-color;
|
||||||
|
|
||||||
|
&:required + .book-search-spinner {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-search-spinner {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
margin: $padding-8;
|
||||||
|
margin-inline-start: calc(100% - #{$padding-16 + $padding-8});
|
||||||
|
|
||||||
|
width: $padding-16;
|
||||||
|
height: $padding-16;
|
||||||
|
|
||||||
|
border: $padding-1 solid transparent;
|
||||||
|
border-top-color: $body-font-color;
|
||||||
|
border-radius: 50%;
|
||||||
|
|
||||||
|
@include spin(1s);
|
||||||
|
}
|
||||||
|
|
||||||
|
small {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-toc {
|
||||||
|
flex: 0 0 $toc-width;
|
||||||
|
font-size: $font-size-12;
|
||||||
|
|
||||||
|
nav {
|
||||||
|
width: $toc-width;
|
||||||
|
padding: $padding-16;
|
||||||
|
|
||||||
|
@include fixed;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul > li:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-footer {
|
||||||
|
padding-top: $padding-16;
|
||||||
|
font-size: $font-size-14;
|
||||||
|
|
||||||
|
img {
|
||||||
|
height: 1em;
|
||||||
|
margin-inline-end: $padding-8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-comments {
|
||||||
|
margin-top: $padding-16;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-languages {
|
||||||
|
position: relative;
|
||||||
|
overflow: visible;
|
||||||
|
|
||||||
|
padding: $padding-16;
|
||||||
|
margin: -$padding-16;
|
||||||
|
|
||||||
|
ul {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
|
li {
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus,
|
||||||
|
&:focus-within {
|
||||||
|
.book-languages-list {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-languages-list {
|
||||||
|
display: none;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
bottom: 100%;
|
||||||
|
left: 0;
|
||||||
|
padding: $padding-8 0;
|
||||||
|
|
||||||
|
background: $body-background;
|
||||||
|
box-shadow: 0 0 $padding-4 rgba(0, 0, 0, 0.1);
|
||||||
|
|
||||||
|
li img {
|
||||||
|
opacity: 0.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.active img,
|
||||||
|
li:hover img {
|
||||||
|
opacity: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: inherit;
|
||||||
|
padding: $padding-8 $padding-16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-home {
|
||||||
|
padding: $padding-16;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Responsive styles
|
||||||
|
aside nav,
|
||||||
|
.book-page,
|
||||||
|
.book-header aside,
|
||||||
|
.markdown {
|
||||||
|
transition: 0.2s ease-in-out;
|
||||||
|
transition-property: transform, margin, opacity, visibility;
|
||||||
|
will-change: transform, margin, opacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: $mobile-breakpoint) {
|
||||||
|
#menu-control,
|
||||||
|
#toc-control {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-menu {
|
||||||
|
visibility: hidden;
|
||||||
|
margin-inline-start: -$menu-width;
|
||||||
|
font-size: $font-size-base;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-toc {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-header {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-control:focus ~ main label[for="menu-control"] {
|
||||||
|
@include outline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu-control:checked ~ main {
|
||||||
|
.book-menu {
|
||||||
|
visibility: initial;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-menu nav {
|
||||||
|
transform: translateX($menu-width);
|
||||||
|
box-shadow: 0 0 $padding-8 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-page {
|
||||||
|
opacity: 0.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-menu-overlay {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#toc-control:focus ~ main label[for="toc-control"] {
|
||||||
|
@include outline;
|
||||||
|
}
|
||||||
|
|
||||||
|
#toc-control:checked ~ main {
|
||||||
|
.book-header aside {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//for RTL support
|
||||||
|
body[dir="rtl"] #menu-control:checked + main {
|
||||||
|
.book-menu nav {
|
||||||
|
transform: translateX(-$menu-width);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Extra space for big screens
|
||||||
|
@media screen and (min-width: $container-max-width) {
|
||||||
|
.book-page,
|
||||||
|
.book-menu nav,
|
||||||
|
.book-toc nav {
|
||||||
|
padding: $padding-16 * 2 $padding-16;
|
||||||
|
}
|
||||||
|
}
|
190
website/themes/book/assets/_markdown.scss
Normal file
190
website/themes/book/assets/_markdown.scss
Normal file
@ -0,0 +1,190 @@
|
|||||||
|
@import "variables";
|
||||||
|
|
||||||
|
.markdown {
|
||||||
|
line-height: 1.6;
|
||||||
|
|
||||||
|
// remove padding at the beginning of page
|
||||||
|
> :first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1,
|
||||||
|
h2,
|
||||||
|
h3,
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
font-weight: normal;
|
||||||
|
line-height: 1;
|
||||||
|
margin-top: 1.5em;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
|
||||||
|
a.anchor {
|
||||||
|
opacity: 0;
|
||||||
|
font-size: .75em;
|
||||||
|
vertical-align: middle;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover a.anchor, a.anchor:focus {
|
||||||
|
opacity: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h4,
|
||||||
|
h5,
|
||||||
|
h6 {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
h5 {
|
||||||
|
font-size: 0.875em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h6 {
|
||||||
|
font-size: 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
b,
|
||||||
|
optgroup,
|
||||||
|
strong {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
&:visited {
|
||||||
|
color: $color-visited-link;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
padding: 0 $padding-4;
|
||||||
|
background: $gray-200;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
font-size: 0.875em;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
padding: $padding-16;
|
||||||
|
background: $gray-100;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
overflow-x: auto;
|
||||||
|
|
||||||
|
code {
|
||||||
|
padding: 0;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
blockquote {
|
||||||
|
margin: $padding-16 0;
|
||||||
|
padding: $padding-8 $padding-16 $padding-8 ($padding-16 - $padding-4); //to keep total left space 16dp
|
||||||
|
|
||||||
|
border-inline-start: $padding-4 solid $gray-200;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
:first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
table {
|
||||||
|
overflow: auto;
|
||||||
|
display: block;
|
||||||
|
border-spacing: 0;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-top: $padding-16;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
|
||||||
|
tr th,
|
||||||
|
tr td {
|
||||||
|
padding: $padding-8 $padding-16;
|
||||||
|
border: $padding-1 solid $gray-200;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr:nth-child(2n) {
|
||||||
|
background: $gray-100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hr {
|
||||||
|
height: $padding-1;
|
||||||
|
border: none;
|
||||||
|
background: $gray-200;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul,
|
||||||
|
ol {
|
||||||
|
padding-inline-start: $padding-16 * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
dl {
|
||||||
|
dt {
|
||||||
|
font-weight: bolder;
|
||||||
|
margin-top: $padding-16;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
margin-inline-start: $padding-16;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special case for highlighted code with line numbers
|
||||||
|
.highlight table tr {
|
||||||
|
td:nth-child(1) pre {
|
||||||
|
margin: 0;
|
||||||
|
padding-inline-end: 0;
|
||||||
|
}
|
||||||
|
td:nth-child(2) pre {
|
||||||
|
margin: 0;
|
||||||
|
padding-inline-start: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
details {
|
||||||
|
padding: $padding-16;
|
||||||
|
border: $padding-1 solid $gray-200;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
summary {
|
||||||
|
line-height: 1;
|
||||||
|
padding: $padding-16;
|
||||||
|
margin: -$padding-16;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&[open] summary {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: $padding-16 0;
|
||||||
|
figcaption p {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.markdown-inner {
|
||||||
|
// Util class to remove extra margin in nested markdown content
|
||||||
|
> :first-child {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
> :last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
17
website/themes/book/assets/_print.scss
Normal file
17
website/themes/book/assets/_print.scss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
@media print {
|
||||||
|
.book-menu,
|
||||||
|
.book-footer,
|
||||||
|
.book-toc {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-header,
|
||||||
|
.book-header aside {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
// Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=939897
|
||||||
|
display: block !important;
|
||||||
|
}
|
||||||
|
}
|
104
website/themes/book/assets/_shortcodes.scss
Normal file
104
website/themes/book/assets/_shortcodes.scss
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
.markdown {
|
||||||
|
// {{< expand "Label" "icon" >}}
|
||||||
|
.book-expand {
|
||||||
|
margin-top: $padding-16;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
|
||||||
|
border: $padding-1 solid $gray-200;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.book-expand-head {
|
||||||
|
background: $gray-100;
|
||||||
|
padding: $padding-8 $padding-16;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-expand-content {
|
||||||
|
display: none;
|
||||||
|
padding: $padding-16;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="checkbox"]:checked + .book-expand-content {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// {{< tabs >}}
|
||||||
|
.book-tabs {
|
||||||
|
margin-top: $padding-16;
|
||||||
|
margin-bottom: $padding-16;
|
||||||
|
|
||||||
|
border: $padding-1 solid $gray-200;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: inline-block;
|
||||||
|
padding: $padding-8 $padding-16;
|
||||||
|
border-bottom: $padding-1 transparent;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-tabs-content {
|
||||||
|
order: 999; //Move content blocks to the end
|
||||||
|
width: 100%;
|
||||||
|
border-top: $padding-1 solid $gray-100;
|
||||||
|
padding: $padding-16;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input[type="radio"]:checked + label {
|
||||||
|
border-bottom: $padding-1 solid $color-link;
|
||||||
|
}
|
||||||
|
input[type="radio"]:checked + label + .book-tabs-content {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
input[type="radio"]:focus + label {
|
||||||
|
@include outline
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// {{< columns >}}
|
||||||
|
.book-columns {
|
||||||
|
margin-left: -$padding-16;
|
||||||
|
margin-right: -$padding-16;
|
||||||
|
|
||||||
|
> div {
|
||||||
|
margin: $padding-16 0;
|
||||||
|
min-width: $body-min-width / 2;
|
||||||
|
padding: 0 $padding-16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// {{< button >}}
|
||||||
|
a.book-btn {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: $font-size-14;
|
||||||
|
color: $color-link;
|
||||||
|
line-height: $padding-16 * 2;
|
||||||
|
padding: 0 $padding-16;
|
||||||
|
border: $padding-1 solid $color-link;
|
||||||
|
border-radius: $border-radius;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// {{< hint >}}
|
||||||
|
.book-hint {
|
||||||
|
@each $name, $color in $hint-colors {
|
||||||
|
&.#{$name} {
|
||||||
|
border-color: $color;
|
||||||
|
background-color: rgba($color, 0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
92
website/themes/book/assets/_utils.scss
Normal file
92
website/themes/book/assets/_utils.scss
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-auto {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-even {
|
||||||
|
flex: 1 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex-wrap {
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-start {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-end {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-center {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.justify-between {
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-center {
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mx-auto {
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-center {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-left {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-right {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.toggle {
|
||||||
|
height: 0;
|
||||||
|
width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
opacity: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.clearfix::after {
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin spin($duration) {
|
||||||
|
animation: spin $duration ease infinite;
|
||||||
|
@keyframes spin {
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin fixed {
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
@mixin outline {
|
||||||
|
outline-style: auto;
|
||||||
|
outline-color: currentColor;
|
||||||
|
outline-color: -webkit-focus-ring-color;
|
||||||
|
}
|
3
website/themes/book/assets/_variables.scss
Normal file
3
website/themes/book/assets/_variables.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* You can override SASS variables here. */
|
||||||
|
|
||||||
|
// @import "plugins/dark";
|
14
website/themes/book/assets/book.scss
Normal file
14
website/themes/book/assets/book.scss
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
@import "defaults";
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
@import "normalize";
|
||||||
|
@import "utils";
|
||||||
|
@import "main";
|
||||||
|
@import "fonts";
|
||||||
|
@import "print";
|
||||||
|
|
||||||
|
@import "markdown";
|
||||||
|
@import "shortcodes";
|
||||||
|
|
||||||
|
// Custom defined styles
|
||||||
|
@import "custom";
|
15
website/themes/book/assets/manifest.json
Normal file
15
website/themes/book/assets/manifest.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "{{ .Site.Title }}",
|
||||||
|
"short_name": "{{ .Site.Title }}",
|
||||||
|
"start_url": "{{ "/" | relURL }}",
|
||||||
|
"scope": "{{ "/" | relURL }}",
|
||||||
|
"display": "standalone",
|
||||||
|
"background_color": "#000000",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "{{ "/favicon.svg" | relURL }}",
|
||||||
|
"sizes": "512x512"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
7
website/themes/book/assets/menu-reset.js
Normal file
7
website/themes/book/assets/menu-reset.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
(function() {
|
||||||
|
var menu = document.querySelector("aside.book-menu nav");
|
||||||
|
addEventListener("beforeunload", function(event) {
|
||||||
|
localStorage.setItem("menu.scrollTop", menu.scrollTop);
|
||||||
|
});
|
||||||
|
menu.scrollTop = localStorage.getItem("menu.scrollTop");
|
||||||
|
})();
|
349
website/themes/book/assets/normalize.css
vendored
Normal file
349
website/themes/book/assets/normalize.css
vendored
Normal file
@ -0,0 +1,349 @@
|
|||||||
|
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||||
|
|
||||||
|
/* Document
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the line height in all browsers.
|
||||||
|
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
line-height: 1.15; /* 1 */
|
||||||
|
-webkit-text-size-adjust: 100%; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Sections
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the margin in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render the `main` element consistently in IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
main {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the font size and margin on `h1` elements within `section` and
|
||||||
|
* `article` contexts in Chrome, Firefox, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Grouping content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Add the correct box sizing in Firefox.
|
||||||
|
* 2. Show the overflow in Edge and IE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
hr {
|
||||||
|
box-sizing: content-box; /* 1 */
|
||||||
|
height: 0; /* 1 */
|
||||||
|
overflow: visible; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||||
|
* 2. Correct the odd `em` font sizing in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-family: monospace, monospace; /* 1 */
|
||||||
|
font-size: 1em; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text-level semantics
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the gray background on active links in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Remove the bottom border in Chrome 57-
|
||||||
|
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: none; /* 1 */
|
||||||
|
text-decoration: underline; /* 2 */
|
||||||
|
text-decoration: underline dotted; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||||
|
* 2. Correct the odd `em` font sizing in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, monospace; /* 1 */
|
||||||
|
font-size: 1em; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct font size in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||||
|
* all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Embedded content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the border on images inside links in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-style: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Forms
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Change the font styles in all browsers.
|
||||||
|
* 2. Remove the margin in Firefox and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
optgroup,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
font-family: inherit; /* 1 */
|
||||||
|
font-size: 100%; /* 1 */
|
||||||
|
line-height: 1.15; /* 1 */
|
||||||
|
margin: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the overflow in IE.
|
||||||
|
* 1. Show the overflow in Edge.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input { /* 1 */
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||||
|
* 1. Remove the inheritance of text transform in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
select { /* 1 */
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the inability to style clickable types in iOS and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
[type="button"],
|
||||||
|
[type="reset"],
|
||||||
|
[type="submit"] {
|
||||||
|
-webkit-appearance: button;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inner border and padding in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
[type="button"]::-moz-focus-inner,
|
||||||
|
[type="reset"]::-moz-focus-inner,
|
||||||
|
[type="submit"]::-moz-focus-inner {
|
||||||
|
border-style: none;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore the focus styles unset by the previous rule.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button:-moz-focusring,
|
||||||
|
[type="button"]:-moz-focusring,
|
||||||
|
[type="reset"]:-moz-focusring,
|
||||||
|
[type="submit"]:-moz-focusring {
|
||||||
|
outline: 1px dotted ButtonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the padding in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
padding: 0.35em 0.75em 0.625em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the text wrapping in Edge and IE.
|
||||||
|
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||||
|
* 3. Remove the padding so developers are not caught out when they zero out
|
||||||
|
* `fieldset` elements in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
legend {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
color: inherit; /* 2 */
|
||||||
|
display: table; /* 1 */
|
||||||
|
max-width: 100%; /* 1 */
|
||||||
|
padding: 0; /* 3 */
|
||||||
|
white-space: normal; /* 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||||
|
*/
|
||||||
|
|
||||||
|
progress {
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the default vertical scrollbar in IE 10+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Add the correct box sizing in IE 10.
|
||||||
|
* 2. Remove the padding in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="checkbox"],
|
||||||
|
[type="radio"] {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="number"]::-webkit-inner-spin-button,
|
||||||
|
[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the odd appearance in Chrome and Safari.
|
||||||
|
* 2. Correct the outline style in Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* 1 */
|
||||||
|
outline-offset: -2px; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the inner padding in Chrome and Safari on macOS.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||||
|
* 2. Change font properties to `inherit` in Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
::-webkit-file-upload-button {
|
||||||
|
-webkit-appearance: button; /* 1 */
|
||||||
|
font: inherit; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Interactive
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
details {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add the correct display in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Misc
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 10+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the correct display in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[hidden] {
|
||||||
|
display: none;
|
||||||
|
}
|
10
website/themes/book/assets/plugins/_dark.scss
Normal file
10
website/themes/book/assets/plugins/_dark.scss
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
$gray-100: rgba(255, 255, 255, 0.1);
|
||||||
|
$gray-200: rgba(255, 255, 255, 0.2);
|
||||||
|
|
||||||
|
$body-background: #343a40;
|
||||||
|
$body-font-color: #e9ecef;
|
||||||
|
|
||||||
|
$color-link: #84b2ff;
|
||||||
|
$color-visited-link: #b88dff;
|
||||||
|
|
||||||
|
$icon-filter: brightness(0) invert(1);
|
36
website/themes/book/assets/plugins/_numbered.scss
Normal file
36
website/themes/book/assets/plugins/_numbered.scss
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
$startLevel: 1;
|
||||||
|
$endLevel: 6;
|
||||||
|
|
||||||
|
.book-page .markdown {
|
||||||
|
@for $currentLevel from $startLevel through $endLevel {
|
||||||
|
> h#{$currentLevel} {
|
||||||
|
counter-increment: h#{$currentLevel};
|
||||||
|
counter-reset: h#{$currentLevel + 1};
|
||||||
|
|
||||||
|
$content: "";
|
||||||
|
@for $n from $startLevel through $currentLevel {
|
||||||
|
$content: $content + 'counter(h#{$n})"."';
|
||||||
|
}
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: unquote($content) " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.book-toc nav ul {
|
||||||
|
li {
|
||||||
|
counter-increment: item;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
counter-reset: item;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
content: counters(item, ".") ". ";
|
||||||
|
float: left;
|
||||||
|
margin-inline-end: $padding-4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
website/themes/book/assets/plugins/_scrollbars.scss
Normal file
26
website/themes/book/assets/plugins/_scrollbars.scss
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
@import "defaults";
|
||||||
|
@import "variables";
|
||||||
|
|
||||||
|
// Webkit
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: $padding-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background: transparent;
|
||||||
|
border-radius: $padding-8;
|
||||||
|
}
|
||||||
|
|
||||||
|
:hover::-webkit-scrollbar-thumb {
|
||||||
|
background: $gray-500;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MS
|
||||||
|
body {
|
||||||
|
-ms-overflow-style: -ms-autohiding-scrollbar
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future
|
||||||
|
.book-menu nav {
|
||||||
|
scrollbar-color: transparent $gray-500;
|
||||||
|
}
|
30
website/themes/book/assets/search-data.js
Normal file
30
website/themes/book/assets/search-data.js
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
const indexCfg = {{ with i18n "bookSearchConfig" }}
|
||||||
|
{{ . }};
|
||||||
|
{{ else }}
|
||||||
|
{};
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
indexCfg.doc = {
|
||||||
|
id: 'id',
|
||||||
|
field: ['title', 'content'],
|
||||||
|
store: ['title', 'href', 'section'],
|
||||||
|
};
|
||||||
|
|
||||||
|
const index = FlexSearch.create('balance', indexCfg);
|
||||||
|
window.bookSearchIndex = index;
|
||||||
|
|
||||||
|
{{ range $index, $page := where .Site.Pages "Kind" "in" (slice "page" "section") }}
|
||||||
|
{{ if $page.Content }}
|
||||||
|
index.add({
|
||||||
|
'id': {{ $index }},
|
||||||
|
'href': '{{ $page.RelPermalink }}',
|
||||||
|
'title': {{ (partial "docs/title" $page) | jsonify }},
|
||||||
|
'section': {{ (partial "docs/title" $page.Parent) | jsonify }},
|
||||||
|
'content': {{ $page.Plain | jsonify }}
|
||||||
|
});
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
})();
|
101
website/themes/book/assets/search.js
Normal file
101
website/themes/book/assets/search.js
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
{{ $searchDataFile := printf "%s.search-data.js" .Language.Lang }}
|
||||||
|
{{ $searchData := resources.Get "search-data.js" | resources.ExecuteAsTemplate $searchDataFile . | resources.Minify | resources.Fingerprint }}
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
const input = document.querySelector('#book-search-input');
|
||||||
|
const results = document.querySelector('#book-search-results');
|
||||||
|
|
||||||
|
if (!input) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
input.addEventListener('focus', init);
|
||||||
|
input.addEventListener('keyup', search);
|
||||||
|
|
||||||
|
document.addEventListener('keypress', focusSearchFieldOnKeyPress);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Event} event
|
||||||
|
*/
|
||||||
|
function focusSearchFieldOnKeyPress(event) {
|
||||||
|
if (input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const characterPressed = String.fromCharCode(event.charCode);
|
||||||
|
if (!isHotkey(characterPressed)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
input.focus();
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} character
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
function isHotkey(character) {
|
||||||
|
const dataHotkeys = input.getAttribute('data-hotkeys') || '';
|
||||||
|
return dataHotkeys.indexOf(character) >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
input.removeEventListener('focus', init); // init once
|
||||||
|
input.required = true;
|
||||||
|
|
||||||
|
loadScript('{{ "flexsearch.min.js" | relURL }}');
|
||||||
|
loadScript('{{ $searchData.RelPermalink }}', function () {
|
||||||
|
input.required = false;
|
||||||
|
search();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function search() {
|
||||||
|
while (results.firstChild) {
|
||||||
|
results.removeChild(results.firstChild);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!input.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const searchHits = window.bookSearchIndex.search(input.value, 10);
|
||||||
|
searchHits.forEach(function (page) {
|
||||||
|
const li = element('<li><a href></a><small></small></li>');
|
||||||
|
const a = li.querySelector('a'), small = li.querySelector('small');
|
||||||
|
|
||||||
|
a.href = page.href;
|
||||||
|
a.textContent = page.title;
|
||||||
|
small.textContent = page.section;
|
||||||
|
|
||||||
|
results.appendChild(li);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} src
|
||||||
|
* @param {Function} callback
|
||||||
|
*/
|
||||||
|
function loadScript(src, callback) {
|
||||||
|
const script = document.createElement('script');
|
||||||
|
script.defer = true;
|
||||||
|
script.async = false;
|
||||||
|
script.src = src;
|
||||||
|
script.onload = callback;
|
||||||
|
|
||||||
|
document.head.appendChild(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} content
|
||||||
|
* @returns {Node}
|
||||||
|
*/
|
||||||
|
function element(content) {
|
||||||
|
const div = document.createElement('div');
|
||||||
|
div.innerHTML = content;
|
||||||
|
return div.firstChild;
|
||||||
|
}
|
||||||
|
})();
|
7
website/themes/book/assets/sw-register.js
Normal file
7
website/themes/book/assets/sw-register.js
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{{- $swJS := resources.Get "sw.js" | resources.ExecuteAsTemplate "sw.js" . -}}
|
||||||
|
if (navigator.serviceWorker) {
|
||||||
|
navigator.serviceWorker.register(
|
||||||
|
"{{ $swJS.RelPermalink }}",
|
||||||
|
{ scope: "{{ "/" | relURL }}" }
|
||||||
|
);
|
||||||
|
}
|
55
website/themes/book/assets/sw.js
Normal file
55
website/themes/book/assets/sw.js
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
const cacheName = self.location.pathname
|
||||||
|
const pages = [
|
||||||
|
{{ if eq .Site.Params.BookServiceWorker "precache" }}
|
||||||
|
{{ range .Site.AllPages -}}
|
||||||
|
"{{ .RelPermalink }}",
|
||||||
|
{{ end -}}
|
||||||
|
{{ end }}
|
||||||
|
];
|
||||||
|
|
||||||
|
self.addEventListener("install", function (event) {
|
||||||
|
self.skipWaiting();
|
||||||
|
|
||||||
|
caches.open(cacheName).then((cache) => {
|
||||||
|
return cache.addAll(pages);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
self.addEventListener("fetch", (event) => {
|
||||||
|
const request = event.request;
|
||||||
|
if (request.method !== "GET") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Response} response
|
||||||
|
* @returns {Promise<Response>}
|
||||||
|
*/
|
||||||
|
function saveToCache(response) {
|
||||||
|
if (cacheable(response)) {
|
||||||
|
return caches
|
||||||
|
.open(cacheName)
|
||||||
|
.then((cache) => cache.put(request, response.clone()))
|
||||||
|
.then(() => response);
|
||||||
|
} else {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Error} error
|
||||||
|
*/
|
||||||
|
function serveFromCache(error) {
|
||||||
|
return caches.open(cacheName).then((cache) => cache.match(request.url));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Response} response
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
function cacheable(response) {
|
||||||
|
return response.type === "basic" && response.ok && !response.headers.has("Content-Disposition")
|
||||||
|
}
|
||||||
|
|
||||||
|
event.respondWith(fetch(request).then(saveToCache).catch(serveFromCache));
|
||||||
|
});
|
4
website/themes/book/exampleSite/assets/_custom.scss
Normal file
4
website/themes/book/exampleSite/assets/_custom.scss
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/* You can add custom styles here. */
|
||||||
|
|
||||||
|
// @import "plugins/numbered";
|
||||||
|
// @import "plugins/scrollbars";
|
3
website/themes/book/exampleSite/assets/_variables.scss
Normal file
3
website/themes/book/exampleSite/assets/_variables.scss
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
/* You can override SASS variables here. */
|
||||||
|
|
||||||
|
// @import "plugins/dark";
|
103
website/themes/book/exampleSite/config.toml
Normal file
103
website/themes/book/exampleSite/config.toml
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
# hugo server --minify --themesDir ... --baseURL=http://0.0.0.0:1313/theme/hugo-book/
|
||||||
|
|
||||||
|
baseURL = 'https://example.com/'
|
||||||
|
title = 'Hugo Book'
|
||||||
|
theme = 'hugo-book'
|
||||||
|
|
||||||
|
# Book configuration
|
||||||
|
disablePathToLower = true
|
||||||
|
enableGitInfo = true
|
||||||
|
|
||||||
|
# Needed for mermaid/katex shortcodes
|
||||||
|
[markup]
|
||||||
|
[markup.goldmark.renderer]
|
||||||
|
unsafe = true
|
||||||
|
|
||||||
|
[markup.tableOfContents]
|
||||||
|
startLevel = 1
|
||||||
|
|
||||||
|
# Multi-lingual mode config
|
||||||
|
# There are different options to translate files
|
||||||
|
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
|
||||||
|
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||||
|
[languages]
|
||||||
|
[languages.en]
|
||||||
|
languageName = 'English'
|
||||||
|
contentDir = 'content'
|
||||||
|
weight = 1
|
||||||
|
|
||||||
|
[languages.ru]
|
||||||
|
languageName = 'Russian'
|
||||||
|
contentDir = 'content.ru'
|
||||||
|
weight = 2
|
||||||
|
|
||||||
|
[languages.zh]
|
||||||
|
languageName = 'Chinese'
|
||||||
|
contentDir = 'content.zh'
|
||||||
|
weight = 3
|
||||||
|
|
||||||
|
[menu]
|
||||||
|
# [[menu.before]]
|
||||||
|
[[menu.after]]
|
||||||
|
name = "Github"
|
||||||
|
url = "https://github.com/alex-shpak/hugo-book"
|
||||||
|
weight = 10
|
||||||
|
|
||||||
|
[[menu.after]]
|
||||||
|
name = "Hugo Themes"
|
||||||
|
url = "https://themes.gohugo.io/hugo-book/"
|
||||||
|
weight = 20
|
||||||
|
|
||||||
|
[params]
|
||||||
|
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||||
|
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||||
|
# You can also specify this parameter per page in front matter.
|
||||||
|
BookToC = true
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be logo.png
|
||||||
|
# BookLogo = 'logo.png'
|
||||||
|
|
||||||
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
|
# When not specified file structure and weights will be used
|
||||||
|
# BookMenuBundle = '/menu'
|
||||||
|
|
||||||
|
# (Optional, default docs) Specify root page to render child pages as menu.
|
||||||
|
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
|
||||||
|
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
|
||||||
|
BookSection = 'docs'
|
||||||
|
|
||||||
|
# Set source repository location.
|
||||||
|
# Used for 'Last Modified' and 'Edit this page' links.
|
||||||
|
BookRepo = 'https://github.com/alex-shpak/hugo-book'
|
||||||
|
|
||||||
|
# Enable "Edit this page" links for 'doc' page type.
|
||||||
|
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
|
||||||
|
# Edit path must point to root directory of repo.
|
||||||
|
BookEditPath = 'edit/master/exampleSite'
|
||||||
|
|
||||||
|
# Configure the date format used on the pages
|
||||||
|
# - In git information
|
||||||
|
# - In blog posts
|
||||||
|
BookDateFormat = 'January 2, 2006'
|
||||||
|
|
||||||
|
# (Optional, default true) Enables search function with flexsearch,
|
||||||
|
# Index is built on fly, therefore it might slowdown your website.
|
||||||
|
# Configuration for indexing can be adjusted in i18n folder per language.
|
||||||
|
BookSearch = true
|
||||||
|
|
||||||
|
# (Optional, default true) Enables comments template on pages
|
||||||
|
# By default partals/docs/comments.html includes Disqus template
|
||||||
|
# See https://gohugo.io/content-management/comments/#configure-disqus
|
||||||
|
# Can be overwritten by same param in page frontmatter
|
||||||
|
BookComments = true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
|
||||||
|
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
|
||||||
|
# Theme will print warning if page referenced in markdown does not exists.
|
||||||
|
BookPortableLinks = true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
|
||||||
|
BookServiceWorker = true
|
99
website/themes/book/exampleSite/config.yaml
Normal file
99
website/themes/book/exampleSite/config.yaml
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
# hugo server --minify --themesDir ... --baseURL=http://0.0.0.0:1313/theme/hugo-book/
|
||||||
|
|
||||||
|
baseURL: https://example.com/
|
||||||
|
title: Hugo Book
|
||||||
|
theme: hugo-book
|
||||||
|
|
||||||
|
# Book configuration
|
||||||
|
disablePathToLower: true
|
||||||
|
enableGitInfo: true
|
||||||
|
|
||||||
|
# Needed for mermaid/katex shortcodes
|
||||||
|
markup:
|
||||||
|
goldmark:
|
||||||
|
renderer:
|
||||||
|
unsafe: true
|
||||||
|
tableOfContents:
|
||||||
|
startLevel: 1
|
||||||
|
|
||||||
|
# Multi-lingual mode config
|
||||||
|
# There are different options to translate files
|
||||||
|
# See https://gohugo.io/content-management/multilingual/#translation-by-filename
|
||||||
|
# And https://gohugo.io/content-management/multilingual/#translation-by-content-directory
|
||||||
|
languages:
|
||||||
|
en:
|
||||||
|
languageName: English
|
||||||
|
contentDir: content
|
||||||
|
weight: 1
|
||||||
|
ru:
|
||||||
|
languageName: Russian
|
||||||
|
contentDir: content.ru
|
||||||
|
weight: 2
|
||||||
|
zh:
|
||||||
|
languageName: Chinese
|
||||||
|
contentDir: content.zh
|
||||||
|
weight: 3
|
||||||
|
|
||||||
|
menu:
|
||||||
|
# before: []
|
||||||
|
after:
|
||||||
|
- name: "Github"
|
||||||
|
url: "https://github.com/alex-shpak/hugo-book"
|
||||||
|
weight: 10
|
||||||
|
- name: "Hugo Themes"
|
||||||
|
url: "https://themes.gohugo.io/hugo-book/"
|
||||||
|
weight: 20
|
||||||
|
|
||||||
|
params:
|
||||||
|
# (Optional, default true) Controls table of contents visibility on right side of pages.
|
||||||
|
# Start and end levels can be controlled with markup.tableOfContents setting.
|
||||||
|
# You can also specify this parameter per page in front matter.
|
||||||
|
BookToC: true
|
||||||
|
|
||||||
|
# (Optional, default none) Set the path to a logo for the book. If the logo is
|
||||||
|
# /static/logo.png then the path would be logo.png
|
||||||
|
# BookLogo: /logo.png
|
||||||
|
|
||||||
|
# (Optional, default none) Set leaf bundle to render as side menu
|
||||||
|
# When not specified file structure and weights will be used
|
||||||
|
# BookMenuBundle: /menu
|
||||||
|
|
||||||
|
# (Optional, default docs) Specify root page to render child pages as menu.
|
||||||
|
# Page is resoled by .GetPage function: https://gohugo.io/functions/getpage/
|
||||||
|
# For backward compatibility you can set '*' to render all sections to menu. Acts same as '/'
|
||||||
|
BookSection: docs
|
||||||
|
|
||||||
|
# Set source repository location.
|
||||||
|
# Used for 'Last Modified' and 'Edit this page' links.
|
||||||
|
BookRepo: https://github.com/alex-shpak/hugo-book
|
||||||
|
|
||||||
|
# Enable "Edit this page" links for 'doc' page type.
|
||||||
|
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
|
||||||
|
# Edit path must point to root directory of repo.
|
||||||
|
BookEditPath: edit/master/exampleSite
|
||||||
|
|
||||||
|
# Configure the date format used on the pages
|
||||||
|
# - In git information
|
||||||
|
# - In blog posts
|
||||||
|
BookDateFormat: "January 2, 2006"
|
||||||
|
|
||||||
|
# (Optional, default true) Enables search function with flexsearch,
|
||||||
|
# Index is built on fly, therefore it might slowdown your website.
|
||||||
|
# Configuration for indexing can be adjusted in i18n folder per language.
|
||||||
|
BookSearch: true
|
||||||
|
|
||||||
|
# (Optional, default true) Enables comments template on pages
|
||||||
|
# By default partals/docs/comments.html includes Disqus template
|
||||||
|
# See https://gohugo.io/content-management/comments/#configure-disqus
|
||||||
|
# Can be overwritten by same param in page frontmatter
|
||||||
|
BookComments: true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
|
||||||
|
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
|
||||||
|
# Theme will print warning if page referenced in markdown does not exists.
|
||||||
|
BookPortableLinks: true
|
||||||
|
|
||||||
|
# /!\ This is an experimental feature, might be removed or changed at any time
|
||||||
|
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
|
||||||
|
BookServiceWorker: true
|
79
website/themes/book/exampleSite/content.ru/_index.md
Normal file
79
website/themes/book/exampleSite/content.ru/_index.md
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
title: Введение
|
||||||
|
type: docs
|
||||||
|
---
|
||||||
|
|
||||||
|
# Стартовая страница на русском языке
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Astris ipse furtiva
|
||||||
|
|
||||||
|
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
|
||||||
|
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
|
||||||
|
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Suis quot vota
|
||||||
|
|
||||||
|
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
|
||||||
|
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
|
||||||
|
nunc! Fragosis suae dextra geruntur functus vulgata.
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
|
||||||
|
## Tempora nisi nunc
|
||||||
|
|
||||||
|
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
|
||||||
|
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
|
||||||
|
sequens!
|
||||||
|
|
||||||
|
var panel = ram_design;
|
||||||
|
if (backup + system) {
|
||||||
|
file.readPoint = network_native;
|
||||||
|
sidebar_engine_device(cell_tftp_raster,
|
||||||
|
dual_login_paper.adf_vci.application_reader_design(
|
||||||
|
graphicsNvramCdma, lpi_footer_snmp, integer_model));
|
||||||
|
}
|
||||||
|
public_keyboard_docking += error.controller_gibibyte_plug.ip(4,
|
||||||
|
asciiPetaflops, software(supercomputer_compatible_status + 4));
|
||||||
|
dynamic_disk.indexModeLaptop = bufferTftpReality;
|
||||||
|
var export_vlog_sequence = trinitron_flowchart + supercomputer_cluster_rj(
|
||||||
|
-1, toolbar_powerpoint_query, -2 / multiprocessing_impression);
|
||||||
|
|
||||||
|
## Locis suis novi cum suoque decidit eadem
|
||||||
|
|
||||||
|
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab? Venit spes
|
||||||
|
versus finis sermonibus patefecit murum nec est sine oculis. _Ille_ inmota
|
||||||
|
macies domoque caelestia cadit tantummodo scelus procul, corde!
|
||||||
|
|
||||||
|
1. Dolentem capi parte rostro alvum habentem pudor
|
||||||
|
2. Fulgentia sanguine paret
|
||||||
|
3. E punior consurgit lentus
|
||||||
|
4. Vox hasta eras micantes
|
||||||
|
|
||||||
|
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
|
||||||
|
|
||||||
|
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
|
||||||
|
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
|
||||||
|
at ademptae, mira.
|
||||||
|
|
||||||
|
direct *= font(inputScareware(sliHome), crossplatform.byte(
|
||||||
|
ppl_encryption.excel_e_rte(integratedModelModifier), timeVirtual,
|
||||||
|
floating_speakers.media_printer(us, yahoo, primaryPhp)));
|
||||||
|
friendly_metal_flatbed(cd, isoPrimaryStorage(reader), dmaMirrored);
|
||||||
|
if (parse_flash_cron.metalGif(1, adServiceDevice, utility)) {
|
||||||
|
adf -= operation_cdma_samba;
|
||||||
|
imapGif.switch += torrent;
|
||||||
|
} else {
|
||||||
|
pmu.disk_captcha = digital_ppp_pci + recursionTransistor(5, dram);
|
||||||
|
ajax_service += grayscalePythonLock;
|
||||||
|
google_scroll_capacity = ftp + engine_dslam_sidebar / tape - 1;
|
||||||
|
}
|
||||||
|
drive_rw = zipTftp;
|
||||||
|
var suffix = software_router_extension.dimm_ddr(-5,
|
||||||
|
kernel_digital_minisite);
|
||||||
|
|
||||||
|
Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam
|
||||||
|
tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis
|
||||||
|
innumeris miraturus amplectique collo sustinet quemque! Litora ante turba?
|
79
website/themes/book/exampleSite/content.zh/_index.md
Normal file
79
website/themes/book/exampleSite/content.zh/_index.md
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
---
|
||||||
|
title: 介绍
|
||||||
|
type: docs
|
||||||
|
---
|
||||||
|
|
||||||
|
# 中文索引页
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Astris ipse furtiva
|
||||||
|
|
||||||
|
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
|
||||||
|
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
|
||||||
|
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Suis quot vota
|
||||||
|
|
||||||
|
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
|
||||||
|
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
|
||||||
|
nunc! Fragosis suae dextra geruntur functus vulgata.
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
|
||||||
|
## Tempora nisi nunc
|
||||||
|
|
||||||
|
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
|
||||||
|
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
|
||||||
|
sequens!
|
||||||
|
|
||||||
|
var panel = ram_design;
|
||||||
|
if (backup + system) {
|
||||||
|
file.readPoint = network_native;
|
||||||
|
sidebar_engine_device(cell_tftp_raster,
|
||||||
|
dual_login_paper.adf_vci.application_reader_design(
|
||||||
|
graphicsNvramCdma, lpi_footer_snmp, integer_model));
|
||||||
|
}
|
||||||
|
public_keyboard_docking += error.controller_gibibyte_plug.ip(4,
|
||||||
|
asciiPetaflops, software(supercomputer_compatible_status + 4));
|
||||||
|
dynamic_disk.indexModeLaptop = bufferTftpReality;
|
||||||
|
var export_vlog_sequence = trinitron_flowchart + supercomputer_cluster_rj(
|
||||||
|
-1, toolbar_powerpoint_query, -2 / multiprocessing_impression);
|
||||||
|
|
||||||
|
## Locis suis novi cum suoque decidit eadem
|
||||||
|
|
||||||
|
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab? Venit spes
|
||||||
|
versus finis sermonibus patefecit murum nec est sine oculis. _Ille_ inmota
|
||||||
|
macies domoque caelestia cadit tantummodo scelus procul, corde!
|
||||||
|
|
||||||
|
1. Dolentem capi parte rostro alvum habentem pudor
|
||||||
|
2. Fulgentia sanguine paret
|
||||||
|
3. E punior consurgit lentus
|
||||||
|
4. Vox hasta eras micantes
|
||||||
|
|
||||||
|
## Facibus pharetrae indetonsusque indulsit sic incurrite foliis
|
||||||
|
|
||||||
|
Nefandam et prisci palmas! Blandita cutis flectitur montis macies, te _nati_
|
||||||
|
Latiis; turbaque inferias. Virginis tibi peracta avidusque facies caper nec, e
|
||||||
|
at ademptae, mira.
|
||||||
|
|
||||||
|
direct *= font(inputScareware(sliHome), crossplatform.byte(
|
||||||
|
ppl_encryption.excel_e_rte(integratedModelModifier), timeVirtual,
|
||||||
|
floating_speakers.media_printer(us, yahoo, primaryPhp)));
|
||||||
|
friendly_metal_flatbed(cd, isoPrimaryStorage(reader), dmaMirrored);
|
||||||
|
if (parse_flash_cron.metalGif(1, adServiceDevice, utility)) {
|
||||||
|
adf -= operation_cdma_samba;
|
||||||
|
imapGif.switch += torrent;
|
||||||
|
} else {
|
||||||
|
pmu.disk_captcha = digital_ppp_pci + recursionTransistor(5, dram);
|
||||||
|
ajax_service += grayscalePythonLock;
|
||||||
|
google_scroll_capacity = ftp + engine_dslam_sidebar / tape - 1;
|
||||||
|
}
|
||||||
|
drive_rw = zipTftp;
|
||||||
|
var suffix = software_router_extension.dimm_ddr(-5,
|
||||||
|
kernel_digital_minisite);
|
||||||
|
|
||||||
|
Vocavit toto; alas **mitis** maestus in liquidarum ab legi finitimosque dominam
|
||||||
|
tibi subitus; Orionis vertitur nota. Currere alti etiam seroque cernitis
|
||||||
|
innumeris miraturus amplectique collo sustinet quemque! Litora ante turba?
|
41
website/themes/book/exampleSite/content/_index.md
Normal file
41
website/themes/book/exampleSite/content/_index.md
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
title: Introduction
|
||||||
|
type: docs
|
||||||
|
---
|
||||||
|
|
||||||
|
# Acerbo datus maxime
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Astris ipse furtiva
|
||||||
|
|
||||||
|
Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
|
||||||
|
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
|
||||||
|
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Suis quot vota
|
||||||
|
|
||||||
|
Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
|
||||||
|
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
|
||||||
|
nunc! Fragosis suae dextra geruntur functus vulgata.
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
|
||||||
|
## Tempora nisi nunc
|
||||||
|
|
||||||
|
Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
|
||||||
|
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
|
||||||
|
sequens!
|
||||||
|
|
||||||
|
var panel = ram_design;
|
||||||
|
if (backup + system) {
|
||||||
|
file.readPoint = network_native;
|
||||||
|
sidebar_engine_device(cell_tftp_raster,
|
||||||
|
dual_login_paper.adf_vci.application_reader_design(
|
||||||
|
graphicsNvramCdma, lpi_footer_snmp, integer_model));
|
||||||
|
}
|
||||||
|
|
||||||
|
## Locis suis novi cum suoque decidit eadem
|
||||||
|
|
||||||
|
Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab?
|
@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
weight: 1
|
||||||
|
bookFlatSection: true
|
||||||
|
title: "Example Site"
|
||||||
|
---
|
||||||
|
|
||||||
|
# Introduction
|
||||||
|
|
||||||
|
## Ferre hinnitibus erat accipitrem dixi Troiae tollens
|
||||||
|
|
||||||
|
Lorem markdownum, a quoque nutu est *quodcumque mandasset* veluti. Passim
|
||||||
|
inportuna totidemque nympha fert; repetens pendent, poenarum guttura sed vacet
|
||||||
|
non, mortali undas. Omnis pharetramque gramen portentificisque membris servatum
|
||||||
|
novabis fallit de nubibus atque silvas mihi. **Dixit repetitaque Quid**; verrit
|
||||||
|
longa; sententia [mandat](http://pastor-ad.io/questussilvas) quascumque nescio
|
||||||
|
solebat [litore](http://lacrimas-ab.net/); noctes. *Hostem haerentem* circuit
|
||||||
|
[plenaque tamen](http://www.sine.io/in).
|
||||||
|
|
||||||
|
- Pedum ne indigenae finire invergens carpebat
|
||||||
|
- Velit posses summoque
|
||||||
|
- De fumos illa foret
|
||||||
|
|
||||||
|
## Est simul fameque tauri qua ad
|
||||||
|
|
||||||
|
Locum nullus nisi vomentes. Ab Persea sermone vela, miratur aratro; eandem
|
||||||
|
Argolicas gener.
|
||||||
|
|
||||||
|
## Me sol
|
||||||
|
|
||||||
|
Nec dis certa fuit socer, Nonacria **dies** manet tacitaque sibi? Sucis est
|
||||||
|
iactata Castrumque iudex, et iactato quoque terraeque es tandem et maternos
|
||||||
|
vittis. Lumina litus bene poenamque animos callem ne tuas in leones illam dea
|
||||||
|
cadunt genus, et pleno nunc in quod. Anumque crescentesque sanguinis
|
||||||
|
[progenies](http://www.late.net/alimentavirides) nuribus rustica tinguet. Pater
|
||||||
|
omnes liquido creditis noctem.
|
||||||
|
|
||||||
|
if (mirrored(icmp_dvd_pim, 3, smbMirroredHard) != lion(clickImportQueue,
|
||||||
|
viralItunesBalancing, bankruptcy_file_pptp)) {
|
||||||
|
file += ip_cybercrime_suffix;
|
||||||
|
}
|
||||||
|
if (runtimeSmartRom == netMarketingWord) {
|
||||||
|
virusBalancingWin *= scriptPromptBespoke + raster(post_drive,
|
||||||
|
windowsSli);
|
||||||
|
cd = address_hertz_trojan;
|
||||||
|
soap_ccd.pcbServerGigahertz(asp_hardware_isa, offlinePeopleware, nui);
|
||||||
|
} else {
|
||||||
|
megabyte.api = modem_flowchart - web + syntaxHalftoneAddress;
|
||||||
|
}
|
||||||
|
if (3 < mebibyteNetworkAnimated) {
|
||||||
|
pharming_regular_error *= jsp_ribbon + algorithm * recycleMediaKindle(
|
||||||
|
dvrSyntax, cdma);
|
||||||
|
adf_sla *= hoverCropDrive;
|
||||||
|
templateNtfs = -1 - vertical;
|
||||||
|
} else {
|
||||||
|
expressionCompressionVariable.bootMulti = white_eup_javascript(
|
||||||
|
table_suffix);
|
||||||
|
guidPpiPram.tracerouteLinux += rtfTerabyteQuicktime(1,
|
||||||
|
managementRosetta(webcamActivex), 740874);
|
||||||
|
}
|
||||||
|
var virusTweetSsl = nullGigo;
|
||||||
|
|
||||||
|
## Trepident sitimque
|
||||||
|
|
||||||
|
Sentiet et ferali errorem fessam, coercet superbus, Ascaniumque in pennis
|
||||||
|
mediis; dolor? Vidit imi **Aeacon** perfida propositos adde, tua Somni Fluctibus
|
||||||
|
errante lustrat non.
|
||||||
|
|
||||||
|
Tamen inde, vos videt e flammis Scythica parantem rupisque pectora umbras. Haec
|
||||||
|
ficta canistris repercusso simul ego aris Dixit! Esse Fama trepidare hunc
|
||||||
|
crescendo vigor ululasse vertice *exspatiantur* celer tepidique petita aversata
|
||||||
|
oculis iussa est me ferro.
|
@ -0,0 +1,12 @@
|
|||||||
|
# 4th Level of Menu
|
||||||
|
|
||||||
|
## Caesorum illa tu sentit micat vestes papyriferi
|
||||||
|
|
||||||
|
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||||
|
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||||
|
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||||
|
|
||||||
|
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||||
|
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||||
|
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||||
|
iusto! Sedes ante dum superest **extrema**.
|
@ -0,0 +1,26 @@
|
|||||||
|
# 3rd Level of Menu
|
||||||
|
|
||||||
|
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||||
|
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||||
|
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||||
|
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||||
|
|
||||||
|
iscsi_virus = pitch(json_in_on(eupViral),
|
||||||
|
northbridge_services_troubleshooting, personal(
|
||||||
|
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||||
|
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||||
|
mips_whitelist_duplex, cpa)));
|
||||||
|
if (5) {
|
||||||
|
managementNetwork += dma - boolean;
|
||||||
|
kilohertz_token = 2;
|
||||||
|
honeypot_affiliate_ergonomics = fiber;
|
||||||
|
}
|
||||||
|
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||||
|
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||||
|
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||||
|
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||||
|
ripcordingMashup)));
|
||||||
|
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||||
|
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||||
|
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||||
|
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
bookCollapseSection: true
|
||||||
|
weight: 20
|
||||||
|
---
|
||||||
|
|
||||||
|
# Collapsed Level of Menu
|
||||||
|
|
||||||
|
## Cognita laeva illo fracta
|
||||||
|
|
||||||
|
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
|
||||||
|
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
|
||||||
|
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
|
||||||
|
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
|
||||||
|
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
|
||||||
|
frondes *gelidos* gravidae circumtulit [inpulit armenta
|
||||||
|
nativum](http://incurvasustulit.io/illi-virtute.html).
|
||||||
|
|
||||||
|
1. Te at cruciabere vides rubentis manebo
|
||||||
|
2. Maturuit in praetemptat ruborem ignara postquam habitasse
|
||||||
|
3. Subitarum supplevit quoque fontesque venabula spretis modo
|
||||||
|
4. Montis tot est mali quasque gravis
|
||||||
|
5. Quinquennem domus arsit ipse
|
||||||
|
6. Pellem turis pugnabant locavit
|
@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
bookHidden: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# This page is hidden in menu
|
||||||
|
|
||||||
|
# Quondam non pater est dignior ille Eurotas
|
||||||
|
|
||||||
|
## Latent te facies
|
||||||
|
|
||||||
|
Lorem markdownum arma ignoscas vocavit quoque ille texit mandata mentis ultimus,
|
||||||
|
frementes, qui in vel. Hippotades Peleus [pennas
|
||||||
|
conscia](http://gratia.net/tot-qua.php) cuiquam Caeneus quas.
|
||||||
|
|
||||||
|
- Pater demittere evincitque reddunt
|
||||||
|
- Maxime adhuc pressit huc Danaas quid freta
|
||||||
|
- Soror ego
|
||||||
|
- Luctus linguam saxa ultroque prior Tatiumque inquit
|
||||||
|
- Saepe liquitur subita superata dederat Anius sudor
|
||||||
|
|
||||||
|
## Cum honorum Latona
|
||||||
|
|
||||||
|
O fallor [in sustinui
|
||||||
|
iussorum](http://www.spectataharundine.org/aquas-relinquit.html) equidem.
|
||||||
|
Nymphae operi oris alii fronde parens dumque, in auro ait mox ingenti proxima
|
||||||
|
iamdudum maius?
|
||||||
|
|
||||||
|
reality(burnDocking(apache_nanometer),
|
||||||
|
pad.property_data_programming.sectorBrowserPpga(dataMask, 37,
|
||||||
|
recycleRup));
|
||||||
|
intellectualVaporwareUser += -5 * 4;
|
||||||
|
traceroute_key_upnp /= lag_optical(android.smb(thyristorTftp));
|
||||||
|
surge_host_golden = mca_compact_device(dual_dpi_opengl, 33,
|
||||||
|
commerce_add_ppc);
|
||||||
|
if (lun_ipv) {
|
||||||
|
verticalExtranet(1, thumbnail_ttl, 3);
|
||||||
|
bar_graphics_jpeg(chipset - sector_xmp_beta);
|
||||||
|
}
|
||||||
|
|
||||||
|
## Fronde cetera dextrae sequens pennis voce muneris
|
||||||
|
|
||||||
|
Acta cretus diem restet utque; move integer, oscula non inspirat, noctisque
|
||||||
|
scelus! Nantemque in suas vobis quamvis, et labori!
|
||||||
|
|
||||||
|
var runtimeDiskCompiler = home - array_ad_software;
|
||||||
|
if (internic > disk) {
|
||||||
|
emoticonLockCron += 37 + bps - 4;
|
||||||
|
wan_ansi_honeypot.cardGigaflops = artificialStorageCgi;
|
||||||
|
simplex -= downloadAccess;
|
||||||
|
}
|
||||||
|
var volumeHardeningAndroid = pixel + tftp + onProcessorUnmount;
|
||||||
|
sector(memory(firewire + interlaced, wired));
|
@ -0,0 +1,85 @@
|
|||||||
|
---
|
||||||
|
weight: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
# Ubi loqui
|
||||||
|
|
||||||
|
## Mentem genus facietque salire tempus bracchia
|
||||||
|
|
||||||
|
Lorem markdownum partu paterno Achillem. Habent amne generosi aderant ad pellem
|
||||||
|
nec erat sustinet merces columque haec et, dixit minus nutrit accipiam subibis
|
||||||
|
subdidit. Temeraria servatum agros qui sed fulva facta. Primum ultima, dedit,
|
||||||
|
suo quisque linguae medentes fixo: tum petis.
|
||||||
|
|
||||||
|
## Rapit vocant si hunc siste adspice
|
||||||
|
|
||||||
|
Ora precari Patraeque Neptunia, dixit Danae [Cithaeron
|
||||||
|
armaque](http://mersis-an.org/litoristum) maxima in **nati Coniugis** templis
|
||||||
|
fluidove. Effugit usus nec ingreditur agmen *ac manus* conlato. Nullis vagis
|
||||||
|
nequiquam vultibus aliquos altera *suum venis* teneas fretum. Armos [remotis
|
||||||
|
hoc](http://tutum.io/me) sine ferrea iuncta quam!
|
||||||
|
|
||||||
|
## Locus fuit caecis
|
||||||
|
|
||||||
|
Nefas discordemque domino montes numen tum humili nexilibusque exit, Iove. Quae
|
||||||
|
miror esse, scelerisque Melaneus viribus. Miseri laurus. Hoc est proposita me
|
||||||
|
ante aliquid, aura inponere candidioribus quidque accendit bella, sumpta.
|
||||||
|
Intravit quam erat figentem hunc, motus de fontes parvo tempestate.
|
||||||
|
|
||||||
|
iscsi_virus = pitch(json_in_on(eupViral),
|
||||||
|
northbridge_services_troubleshooting, personal(
|
||||||
|
firmware_rw.trash_rw_crm.device(interactive_gopher_personal,
|
||||||
|
software, -1), megabit, ergonomicsSoftware(cmyk_usb_panel,
|
||||||
|
mips_whitelist_duplex, cpa)));
|
||||||
|
if (5) {
|
||||||
|
managementNetwork += dma - boolean;
|
||||||
|
kilohertz_token = 2;
|
||||||
|
honeypot_affiliate_ergonomics = fiber;
|
||||||
|
}
|
||||||
|
mouseNorthbridge = byte(nybble_xmp_modem.horse_subnet(
|
||||||
|
analogThroughputService * graphicPoint, drop(daw_bit, dnsIntranet),
|
||||||
|
gateway_ospf), repository.domain_key.mouse(serverData(fileNetwork,
|
||||||
|
trim_duplex_file), cellTapeDirect, token_tooltip_mashup(
|
||||||
|
ripcordingMashup)));
|
||||||
|
module_it = honeypot_driver(client_cold_dvr(593902, ripping_frequency) +
|
||||||
|
coreLog.joystick(componentUdpLink), windows_expansion_touchscreen);
|
||||||
|
bashGigabit.external.reality(2, server_hardware_codec.flops.ebookSampling(
|
||||||
|
ciscNavigationBacklink, table + cleanDriver), indexProtocolIsp);
|
||||||
|
|
||||||
|
## Placabilis coactis nega ingemuit ignoscat nimia non
|
||||||
|
|
||||||
|
Frontis turba. Oculi gravis est Delphice; *inque praedaque* sanguine manu non.
|
||||||
|
|
||||||
|
if (ad_api) {
|
||||||
|
zif += usb.tiffAvatarRate(subnet, digital_rt) + exploitDrive;
|
||||||
|
gigaflops(2 - bluetooth, edi_asp_memory.gopher(queryCursor, laptop),
|
||||||
|
panel_point_firmware);
|
||||||
|
spyware_bash.statePopApplet = express_netbios_digital(
|
||||||
|
insertion_troubleshooting.brouter(recordFolderUs), 65);
|
||||||
|
}
|
||||||
|
recursionCoreRay = -5;
|
||||||
|
if (hub == non) {
|
||||||
|
portBoxVirus = soundWeb(recursive_card(rwTechnologyLeopard),
|
||||||
|
font_radcab, guidCmsScalable + reciprocalMatrixPim);
|
||||||
|
left.bug = screenshot;
|
||||||
|
} else {
|
||||||
|
tooltipOpacity = raw_process_permalink(webcamFontUser, -1);
|
||||||
|
executable_router += tape;
|
||||||
|
}
|
||||||
|
if (tft) {
|
||||||
|
bandwidthWeb *= social_page;
|
||||||
|
} else {
|
||||||
|
regular += 611883;
|
||||||
|
thumbnail /= system_lag_keyboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
## Caesorum illa tu sentit micat vestes papyriferi
|
||||||
|
|
||||||
|
Inde aderam facti; Theseus vis de tauri illa peream. Oculos **uberaque** non
|
||||||
|
regisque vobis cursuque, opus venit quam vulnera. Et maiora necemque, lege modo;
|
||||||
|
gestanda nitidi, vero? Dum ne pectoraque testantur.
|
||||||
|
|
||||||
|
Venasque repulsa Samos qui, exspectatum eram animosque hinc, [aut
|
||||||
|
manes](http://www.creveratnon.net/apricaaetheriis), Assyrii. Cupiens auctoribus
|
||||||
|
pariter rubet, profana magni super nocens. Vos ius sibilat inpar turba visae
|
||||||
|
iusto! Sedes ante dum superest **extrema**.
|
@ -0,0 +1,64 @@
|
|||||||
|
---
|
||||||
|
title: With ToC
|
||||||
|
weight: 1
|
||||||
|
---
|
||||||
|
# Caput vino delphine in tamen vias
|
||||||
|
|
||||||
|
## Cognita laeva illo fracta
|
||||||
|
|
||||||
|
Lorem markdownum pavent auras, surgit nunc cingentibus libet **Laomedonque que**
|
||||||
|
est. Pastor [An](http://est.org/ire.aspx) arbor filia foedat, ne [fugit
|
||||||
|
aliter](http://www.indiciumturbam.org/moramquid.php), per. Helicona illas et
|
||||||
|
callida neptem est *Oresitrophos* caput, dentibus est venit. Tenet reddite
|
||||||
|
[famuli](http://www.antro-et.net/) praesentem fortibus, quaeque vis foret si
|
||||||
|
frondes *gelidos* gravidae circumtulit [inpulit armenta
|
||||||
|
nativum](http://incurvasustulit.io/illi-virtute.html).
|
||||||
|
|
||||||
|
1. Te at cruciabere vides rubentis manebo
|
||||||
|
2. Maturuit in praetemptat ruborem ignara postquam habitasse
|
||||||
|
3. Subitarum supplevit quoque fontesque venabula spretis modo
|
||||||
|
4. Montis tot est mali quasque gravis
|
||||||
|
5. Quinquennem domus arsit ipse
|
||||||
|
6. Pellem turis pugnabant locavit
|
||||||
|
|
||||||
|
## Natus quaerere
|
||||||
|
|
||||||
|
Pectora et sine mulcere, coniuge dum tincta incurvae. Quis iam; est dextra
|
||||||
|
Peneosque, metuis a verba, primo. Illa sed colloque suis: magno: gramen, aera
|
||||||
|
excutiunt concipit.
|
||||||
|
|
||||||
|
> Phrygiae petendo suisque extimuit, super, pars quod audet! Turba negarem.
|
||||||
|
> Fuerat attonitus; et dextra retinet sidera ulnas undas instimulat vacuae
|
||||||
|
> generis? *Agnus* dabat et ignotis dextera, sic tibi pacis **feriente at mora**
|
||||||
|
> euhoeque *comites hostem* vestras Phineus. Vultuque sanguine dominoque [metuit
|
||||||
|
> risi](http://iuvat.org/eundem.php) fama vergit summaque meus clarissimus
|
||||||
|
> artesque tinguebat successor nominis cervice caelicolae.
|
||||||
|
|
||||||
|
## Limitibus misere sit
|
||||||
|
|
||||||
|
Aurea non fata repertis praerupit feruntur simul, meae hosti lentaque *citius
|
||||||
|
levibus*, cum sede dixit, Phaethon texta. *Albentibus summos* multifidasque
|
||||||
|
iungitur loquendi an pectore, mihi ursaque omnia adfata, aeno parvumque in animi
|
||||||
|
perlucentes. Epytus agis ait vixque clamat ornum adversam spondet, quid sceptra
|
||||||
|
ipsum **est**. Reseret nec; saeva suo passu debentia linguam terga et aures et
|
||||||
|
cervix [de](http://www.amnem.io/pervenit.aspx) ubera. Coercet gelidumque manus,
|
||||||
|
doluit volvitur induta?
|
||||||
|
|
||||||
|
## Enim sua
|
||||||
|
|
||||||
|
Iuvenilior filia inlustre templa quidem herbis permittat trahens huic. In
|
||||||
|
cruribus proceres sole crescitque *fata*, quos quos; merui maris se non tamen
|
||||||
|
in, mea.
|
||||||
|
|
||||||
|
## Germana aves pignus tecta
|
||||||
|
|
||||||
|
Mortalia rudibusque caelum cognosceret tantum aquis redito felicior texit, nec,
|
||||||
|
aris parvo acre. Me parum contulerant multi tenentem, gratissime suis; vultum tu
|
||||||
|
occupat deficeret corpora, sonum. E Actaea inplevit Phinea concepit nomenque
|
||||||
|
potest sanguine captam nulla et, in duxisses campis non; mercede. Dicere cur
|
||||||
|
Leucothoen obitum?
|
||||||
|
|
||||||
|
Postibus mittam est *nubibus principium pluma*, exsecratur facta et. Iunge
|
||||||
|
Mnemonidas pallamque pars; vere restitit alis flumina quae **quoque**, est
|
||||||
|
ignara infestus Pyrrha. Di ducis terris maculatum At sede praemia manes
|
||||||
|
nullaque!
|
@ -0,0 +1,59 @@
|
|||||||
|
---
|
||||||
|
title: Without ToC
|
||||||
|
weight: 2
|
||||||
|
bookToc: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# At me ipso nepotibus nunc celebratior genus
|
||||||
|
|
||||||
|
## Tanto oblite
|
||||||
|
|
||||||
|
Lorem markdownum pectora novis patenti igne sua opus aurae feras materiaque
|
||||||
|
illic demersit imago et aristas questaque posset. Vomit quoque suo inhaesuro
|
||||||
|
clara. Esse cumque, per referri triste. Ut exponit solisque communis in tendens
|
||||||
|
vincetis agisque iamque huic bene ante vetat omina Thebae rates. Aeacus servat
|
||||||
|
admonitu concidit, ad resimas vultus et rugas vultu **dignamque** Siphnon.
|
||||||
|
|
||||||
|
Quam iugulum regia simulacra, plus meruit humo pecorumque haesit, ab discedunt
|
||||||
|
dixit: ritu pharetramque. Exul Laurenti orantem modo, per densum missisque labor
|
||||||
|
manibus non colla unum, obiectat. Tu pervia collo, fessus quae Cretenque Myconon
|
||||||
|
crate! Tegumenque quae invisi sudore per vocari quaque plus ventis fluidos. Nodo
|
||||||
|
perque, fugisse pectora sorores.
|
||||||
|
|
||||||
|
## Summe promissa supple vadit lenius
|
||||||
|
|
||||||
|
Quibus largis latebris aethera versato est, ait sentiat faciemque. Aequata alis
|
||||||
|
nec Caeneus exululat inclite corpus est, ire **tibi** ostendens et tibi. Rigent
|
||||||
|
et vires dique possent lumina; **eadem** dixit poma funeribus paret et felix
|
||||||
|
reddebant ventis utile lignum.
|
||||||
|
|
||||||
|
1. Remansit notam Stygia feroxque
|
||||||
|
2. Et dabit materna
|
||||||
|
3. Vipereas Phrygiaeque umbram sollicito cruore conlucere suus
|
||||||
|
4. Quarum Elis corniger
|
||||||
|
5. Nec ieiunia dixit
|
||||||
|
|
||||||
|
Vertitur mos ortu ramosam contudit dumque; placabat ac lumen. Coniunx Amoris
|
||||||
|
spatium poenamque cavernis Thebae Pleiadasque ponunt, rapiare cum quae parum
|
||||||
|
nimium rima.
|
||||||
|
|
||||||
|
## Quidem resupinus inducto solebat una facinus quae
|
||||||
|
|
||||||
|
Credulitas iniqua praepetibus paruit prospexit, voce poena, sub rupit sinuatur,
|
||||||
|
quin suum ventorumque arcadiae priori. Soporiferam erat formamque, fecit,
|
||||||
|
invergens, nymphae mutat fessas ait finge.
|
||||||
|
|
||||||
|
1. Baculum mandataque ne addere capiti violentior
|
||||||
|
2. Altera duas quam hoc ille tenues inquit
|
||||||
|
3. Sicula sidereus latrantis domoque ratae polluit comites
|
||||||
|
4. Possit oro clausura namque se nunc iuvenisque
|
||||||
|
5. Faciem posuit
|
||||||
|
6. Quodque cum ponunt novercae nata vestrae aratra
|
||||||
|
|
||||||
|
Ite extrema Phrygiis, patre dentibus, tonso perculit, enim blanda, manibus fide
|
||||||
|
quos caput armis, posse! Nocendo fas Alcyonae lacertis structa ferarum manus
|
||||||
|
fulmen dubius, saxa caelum effuge extremis fixum tumor adfecit **bella**,
|
||||||
|
potentes? Dum nec insidiosa tempora tegit
|
||||||
|
[spirarunt](http://mihiferre.net/iuvenes-peto.html). Per lupi pars foliis,
|
||||||
|
porreximus humum negant sunt subposuere Sidone steterant auro. Memoraverit sine:
|
||||||
|
ferrum idem Orion caelum heres gerebat fixis?
|
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
bookFlatSection: true
|
||||||
|
---
|
@ -0,0 +1,13 @@
|
|||||||
|
# Buttons
|
||||||
|
|
||||||
|
Buttons are styled links that can lead to local page or external link.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* button relref="/" [class="..."] */>}}Get Home{{</* /button */>}}
|
||||||
|
{{</* button href="https://github.com/alex-shpak/hugo-book" */>}}Contribute{{</* /button */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< button relref="/" >}}Get Home{{< /button >}}
|
||||||
|
{{< button href="https://github.com/alex-shpak/hugo-book" >}}Contribute{{< /button >}}
|
@ -0,0 +1,45 @@
|
|||||||
|
# Columns
|
||||||
|
|
||||||
|
Columns help organize shorter pieces of content horizontally for readability.
|
||||||
|
|
||||||
|
|
||||||
|
```html
|
||||||
|
{{</* columns */>}} <!-- begin columns block -->
|
||||||
|
# Left Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
|
||||||
|
<---> <!-- magic sparator, between columns -->
|
||||||
|
|
||||||
|
# Mid Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
|
||||||
|
<---> <!-- magic sparator, between columns -->
|
||||||
|
|
||||||
|
# Right Content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /columns */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
## Left Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Mid Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter!
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
## Right Content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /columns >}}
|
@ -0,0 +1,22 @@
|
|||||||
|
# Details
|
||||||
|
|
||||||
|
Details shortcode is a helper for `details` html5 element. It is going to replace `expand` shortcode.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
```tpl
|
||||||
|
{{</* details "Title" [open] */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /details */>}}
|
||||||
|
```
|
||||||
|
```tpl
|
||||||
|
{{</* details title="Title" open=true */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /details */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< details "Title" open >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{< /details >}}
|
@ -0,0 +1,35 @@
|
|||||||
|
# Expand
|
||||||
|
|
||||||
|
Expand shortcode can help to decrease clutter on screen by hiding part of text. Expand content by clicking on it.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
### Default
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* expand */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /expand */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< expand >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{< /expand >}}
|
||||||
|
|
||||||
|
### With Custom Label
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* expand "Custom Label" "..." */>}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne...
|
||||||
|
{{</* /expand */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< expand "Custom Label" "..." >}}
|
||||||
|
## Markdown content
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /expand >}}
|
@ -0,0 +1,32 @@
|
|||||||
|
# Hints
|
||||||
|
|
||||||
|
Hint shortcode can be used as hint/alerts/notification block.
|
||||||
|
There are 3 colors to choose: `info`, `warning` and `danger`.
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* hint [info|warning|danger] */>}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{</* /hint */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< hint info >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
|
{{< hint warning >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
||||||
|
|
||||||
|
{{< hint danger >}}
|
||||||
|
**Markdown content**
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
{{< /hint >}}
|
@ -0,0 +1,28 @@
|
|||||||
|
# KaTeX
|
||||||
|
|
||||||
|
KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX](https://katex.org/)
|
||||||
|
|
||||||
|
## Example
|
||||||
|
{{< columns >}}
|
||||||
|
|
||||||
|
```latex
|
||||||
|
{{</* katex [display] [class="text-center"] */>}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{</* /katex */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
{{< katex display >}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{< /katex >}}
|
||||||
|
|
||||||
|
{{< /columns >}}
|
||||||
|
|
||||||
|
## Display Mode Example
|
||||||
|
|
||||||
|
Here is some inline example: {{< katex >}}\pi(x){{< /katex >}}, rendered in the same line. And below is `display` example, having `display: block`
|
||||||
|
{{< katex display >}}
|
||||||
|
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
|
||||||
|
{{< /katex >}}
|
||||||
|
Text continues here.
|
@ -0,0 +1,38 @@
|
|||||||
|
# Mermaid Chart
|
||||||
|
|
||||||
|
[Mermaid](https://mermaidjs.github.io/) is library for generating svg charts and diagrams from text.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< columns >}}
|
||||||
|
```tpl
|
||||||
|
{{</* mermaid [class="text-center"]*/>}}
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>Bob: Hello Bob, how are you?
|
||||||
|
alt is sick
|
||||||
|
Bob->>Alice: Not so good :(
|
||||||
|
else is well
|
||||||
|
Bob->>Alice: Feeling fresh like a daisy
|
||||||
|
end
|
||||||
|
opt Extra response
|
||||||
|
Bob->>Alice: Thanks for asking
|
||||||
|
end
|
||||||
|
{{</* /mermaid */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
<--->
|
||||||
|
|
||||||
|
{{< mermaid >}}
|
||||||
|
sequenceDiagram
|
||||||
|
Alice->>Bob: Hello Bob, how are you?
|
||||||
|
alt is sick
|
||||||
|
Bob->>Alice: Not so good :(
|
||||||
|
else is well
|
||||||
|
Bob->>Alice: Feeling fresh like a daisy
|
||||||
|
end
|
||||||
|
opt Extra response
|
||||||
|
Bob->>Alice: Thanks for asking
|
||||||
|
end
|
||||||
|
{{< /mermaid >}}
|
||||||
|
|
||||||
|
{{< /columns >}}
|
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
bookCollapseSection: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Section
|
||||||
|
|
||||||
|
Section renders pages in section as definition list, using title and description.
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* section */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
{{<section>}}
|
@ -0,0 +1 @@
|
|||||||
|
# Page 1
|
@ -0,0 +1 @@
|
|||||||
|
# Page 2
|
@ -0,0 +1,50 @@
|
|||||||
|
# Tabs
|
||||||
|
|
||||||
|
Tabs let you organize content by context, for example installation instructions for each supported platform.
|
||||||
|
|
||||||
|
```tpl
|
||||||
|
{{</* tabs "uniqueid" */>}}
|
||||||
|
{{</* tab "MacOS" */>}} # MacOS Content {{</* /tab */>}}
|
||||||
|
{{</* tab "Linux" */>}} # Linux Content {{</* /tab */>}}
|
||||||
|
{{</* tab "Windows" */>}} # Windows Content {{</* /tab */>}}
|
||||||
|
{{</* /tabs */>}}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example
|
||||||
|
|
||||||
|
{{< tabs "uniqueid" >}}
|
||||||
|
{{< tab "MacOS" >}}
|
||||||
|
# MacOS
|
||||||
|
|
||||||
|
This is tab **MacOS** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
|
||||||
|
{{< tab "Linux" >}}
|
||||||
|
|
||||||
|
# Linux
|
||||||
|
|
||||||
|
This is tab **Linux** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
|
||||||
|
{{< tab "Windows" >}}
|
||||||
|
|
||||||
|
# Windows
|
||||||
|
|
||||||
|
This is tab **Windows** content.
|
||||||
|
|
||||||
|
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
|
||||||
|
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
|
||||||
|
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
|
||||||
|
Miseratus fonte Ditis conubia.
|
||||||
|
{{< /tab >}}
|
||||||
|
{{< /tabs >}}
|
22
website/themes/book/exampleSite/content/menu/index.md
Normal file
22
website/themes/book/exampleSite/content/menu/index.md
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
headless: true
|
||||||
|
---
|
||||||
|
|
||||||
|
- [**Example Site**]({{< relref "/docs/example" >}})
|
||||||
|
- [Table of Contents]({{< relref "/docs/example/table-of-contents" >}})
|
||||||
|
- [With ToC]({{< relref "/docs/example/table-of-contents/with-toc" >}})
|
||||||
|
- [Without ToC]({{< relref "/docs/example/table-of-contents/without-toc" >}})
|
||||||
|
- [Collapsed]({{< relref "/docs/example/collapsed" >}})
|
||||||
|
- [3rd]({{< relref "/docs/example/collapsed/3rd-level" >}})
|
||||||
|
- [4th]({{< relref "/docs/example/collapsed/3rd-level/4th-level" >}})
|
||||||
|
<br />
|
||||||
|
|
||||||
|
- **Shortcodes**
|
||||||
|
- [Buttons]({{< relref "/docs/shortcodes/buttons" >}})
|
||||||
|
- [Columns]({{< relref "/docs/shortcodes/columns" >}})
|
||||||
|
- [Expand]({{< relref "/docs/shortcodes/expand" >}})
|
||||||
|
- [Hints]({{< relref "/docs/shortcodes/hints" >}})
|
||||||
|
- [Katex]({{< relref "/docs/shortcodes/katex" >}})
|
||||||
|
- [Mermaid]({{< relref "/docs/shortcodes/mermaid" >}})
|
||||||
|
- [Tabs]({{< relref "/docs/shortcodes/tabs" >}})
|
||||||
|
<br />
|
7
website/themes/book/exampleSite/content/posts/_index.md
Normal file
7
website/themes/book/exampleSite/content/posts/_index.md
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
menu:
|
||||||
|
after:
|
||||||
|
name: blog
|
||||||
|
weight: 5
|
||||||
|
title: Blog
|
||||||
|
---
|
File diff suppressed because it is too large
Load Diff
344
website/themes/book/exampleSite/content/posts/goisforlovers.md
Normal file
344
website/themes/book/exampleSite/content/posts/goisforlovers.md
Normal file
@ -0,0 +1,344 @@
|
|||||||
|
+++
|
||||||
|
title = "(Hu)go Template Primer"
|
||||||
|
description = ""
|
||||||
|
tags = [
|
||||||
|
"go",
|
||||||
|
"golang",
|
||||||
|
"templates",
|
||||||
|
"themes",
|
||||||
|
"development",
|
||||||
|
]
|
||||||
|
date = "2014-04-02"
|
||||||
|
categories = [
|
||||||
|
"Development",
|
||||||
|
"golang",
|
||||||
|
]
|
||||||
|
menu = "main"
|
||||||
|
+++
|
||||||
|
|
||||||
|
Hugo uses the excellent [Go][] [html/template][gohtmltemplate] library for
|
||||||
|
its template engine. It is an extremely lightweight engine that provides a very
|
||||||
|
small amount of logic. In our experience that it is just the right amount of
|
||||||
|
logic to be able to create a good static website. If you have used other
|
||||||
|
template systems from different languages or frameworks you will find a lot of
|
||||||
|
similarities in Go templates.
|
||||||
|
|
||||||
|
This document is a brief primer on using Go templates. The [Go docs][gohtmltemplate]
|
||||||
|
provide more details.
|
||||||
|
|
||||||
|
## Introduction to Go Templates
|
||||||
|
|
||||||
|
Go templates provide an extremely simple template language. It adheres to the
|
||||||
|
belief that only the most basic of logic belongs in the template or view layer.
|
||||||
|
One consequence of this simplicity is that Go templates parse very quickly.
|
||||||
|
|
||||||
|
A unique characteristic of Go templates is they are content aware. Variables and
|
||||||
|
content will be sanitized depending on the context of where they are used. More
|
||||||
|
details can be found in the [Go docs][gohtmltemplate].
|
||||||
|
|
||||||
|
## Basic Syntax
|
||||||
|
|
||||||
|
Golang templates are HTML files with the addition of variables and
|
||||||
|
functions.
|
||||||
|
|
||||||
|
**Go variables and functions are accessible within {{ }}**
|
||||||
|
|
||||||
|
Accessing a predefined variable "foo":
|
||||||
|
|
||||||
|
{{ foo }}
|
||||||
|
|
||||||
|
**Parameters are separated using spaces**
|
||||||
|
|
||||||
|
Calling the add function with input of 1, 2:
|
||||||
|
|
||||||
|
{{ add 1 2 }}
|
||||||
|
|
||||||
|
**Methods and fields are accessed via dot notation**
|
||||||
|
|
||||||
|
Accessing the Page Parameter "bar"
|
||||||
|
|
||||||
|
{{ .Params.bar }}
|
||||||
|
|
||||||
|
**Parentheses can be used to group items together**
|
||||||
|
|
||||||
|
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
## Variables
|
||||||
|
|
||||||
|
Each Go template has a struct (object) made available to it. In hugo each
|
||||||
|
template is passed either a page or a node struct depending on which type of
|
||||||
|
page you are rendering. More details are available on the
|
||||||
|
[variables](/layout/variables) page.
|
||||||
|
|
||||||
|
A variable is accessed by referencing the variable name.
|
||||||
|
|
||||||
|
<title>{{ .Title }}</title>
|
||||||
|
|
||||||
|
Variables can also be defined and referenced.
|
||||||
|
|
||||||
|
{{ $address := "123 Main St."}}
|
||||||
|
{{ $address }}
|
||||||
|
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
Go template ship with a few functions which provide basic functionality. The Go
|
||||||
|
template system also provides a mechanism for applications to extend the
|
||||||
|
available functions with their own. [Hugo template
|
||||||
|
functions](/layout/functions) provide some additional functionality we believe
|
||||||
|
are useful for building websites. Functions are called by using their name
|
||||||
|
followed by the required parameters separated by spaces. Template
|
||||||
|
functions cannot be added without recompiling hugo.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ add 1 2 }}
|
||||||
|
|
||||||
|
## Includes
|
||||||
|
|
||||||
|
When including another template you will pass to it the data it will be
|
||||||
|
able to access. To pass along the current context please remember to
|
||||||
|
include a trailing dot. The templates location will always be starting at
|
||||||
|
the /layout/ directory within Hugo.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ template "chrome/header.html" . }}
|
||||||
|
|
||||||
|
|
||||||
|
## Logic
|
||||||
|
|
||||||
|
Go templates provide the most basic iteration and conditional logic.
|
||||||
|
|
||||||
|
### Iteration
|
||||||
|
|
||||||
|
Just like in Go, the Go templates make heavy use of range to iterate over
|
||||||
|
a map, array or slice. The following are different examples of how to use
|
||||||
|
range.
|
||||||
|
|
||||||
|
**Example 1: Using Context**
|
||||||
|
|
||||||
|
{{ range array }}
|
||||||
|
{{ . }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 2: Declaring value variable name**
|
||||||
|
|
||||||
|
{{range $element := array}}
|
||||||
|
{{ $element }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 2: Declaring key and value variable name**
|
||||||
|
|
||||||
|
{{range $index, $element := array}}
|
||||||
|
{{ $index }}
|
||||||
|
{{ $element }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
### Conditionals
|
||||||
|
|
||||||
|
If, else, with, or, & and provide the framework for handling conditional
|
||||||
|
logic in Go Templates. Like range, each statement is closed with `end`.
|
||||||
|
|
||||||
|
|
||||||
|
Go Templates treat the following values as false:
|
||||||
|
|
||||||
|
* false
|
||||||
|
* 0
|
||||||
|
* any array, slice, map, or string of length zero
|
||||||
|
|
||||||
|
**Example 1: If**
|
||||||
|
|
||||||
|
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
|
||||||
|
|
||||||
|
**Example 2: If -> Else**
|
||||||
|
|
||||||
|
{{ if isset .Params "alt" }}
|
||||||
|
{{ index .Params "alt" }}
|
||||||
|
{{else}}
|
||||||
|
{{ index .Params "caption" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
**Example 3: And & Or**
|
||||||
|
|
||||||
|
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
||||||
|
|
||||||
|
**Example 4: With**
|
||||||
|
|
||||||
|
An alternative way of writing "if" and then referencing the same value
|
||||||
|
is to use "with" instead. With rebinds the context `.` within its scope,
|
||||||
|
and skips the block if the variable is absent.
|
||||||
|
|
||||||
|
The first example above could be simplified as:
|
||||||
|
|
||||||
|
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
|
||||||
|
|
||||||
|
**Example 5: If -> Else If**
|
||||||
|
|
||||||
|
{{ if isset .Params "alt" }}
|
||||||
|
{{ index .Params "alt" }}
|
||||||
|
{{ else if isset .Params "caption" }}
|
||||||
|
{{ index .Params "caption" }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
## Pipes
|
||||||
|
|
||||||
|
One of the most powerful components of Go templates is the ability to
|
||||||
|
stack actions one after another. This is done by using pipes. Borrowed
|
||||||
|
from unix pipes, the concept is simple, each pipeline's output becomes the
|
||||||
|
input of the following pipe.
|
||||||
|
|
||||||
|
Because of the very simple syntax of Go templates, the pipe is essential
|
||||||
|
to being able to chain together function calls. One limitation of the
|
||||||
|
pipes is that they only can work with a single value and that value
|
||||||
|
becomes the last parameter of the next pipeline.
|
||||||
|
|
||||||
|
A few simple examples should help convey how to use the pipe.
|
||||||
|
|
||||||
|
**Example 1 :**
|
||||||
|
|
||||||
|
{{ if eq 1 1 }} Same {{ end }}
|
||||||
|
|
||||||
|
is the same as
|
||||||
|
|
||||||
|
{{ eq 1 1 | if }} Same {{ end }}
|
||||||
|
|
||||||
|
It does look odd to place the if at the end, but it does provide a good
|
||||||
|
illustration of how to use the pipes.
|
||||||
|
|
||||||
|
**Example 2 :**
|
||||||
|
|
||||||
|
{{ index .Params "disqus_url" | html }}
|
||||||
|
|
||||||
|
Access the page parameter called "disqus_url" and escape the HTML.
|
||||||
|
|
||||||
|
**Example 3 :**
|
||||||
|
|
||||||
|
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
|
||||||
|
Stuff Here
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
Could be rewritten as
|
||||||
|
|
||||||
|
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
|
||||||
|
Stuff Here
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
## Context (aka. the dot)
|
||||||
|
|
||||||
|
The most easily overlooked concept to understand about Go templates is that {{ . }}
|
||||||
|
always refers to the current context. In the top level of your template this
|
||||||
|
will be the data set made available to it. Inside of a iteration it will have
|
||||||
|
the value of the current item. When inside of a loop the context has changed. .
|
||||||
|
will no longer refer to the data available to the entire page. If you need to
|
||||||
|
access this from within the loop you will likely want to set it to a variable
|
||||||
|
instead of depending on the context.
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
{{ $title := .Site.Title }}
|
||||||
|
{{ range .Params.tags }}
|
||||||
|
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
Notice how once we have entered the loop the value of {{ . }} has changed. We
|
||||||
|
have defined a variable outside of the loop so we have access to it from within
|
||||||
|
the loop.
|
||||||
|
|
||||||
|
# Hugo Parameters
|
||||||
|
|
||||||
|
Hugo provides the option of passing values to the template language
|
||||||
|
through the site configuration (for sitewide values), or through the meta
|
||||||
|
data of each specific piece of content. You can define any values of any
|
||||||
|
type (supported by your front matter/config format) and use them however
|
||||||
|
you want to inside of your templates.
|
||||||
|
|
||||||
|
|
||||||
|
## Using Content (page) Parameters
|
||||||
|
|
||||||
|
In each piece of content you can provide variables to be used by the
|
||||||
|
templates. This happens in the [front matter](/content/front-matter).
|
||||||
|
|
||||||
|
An example of this is used in this documentation site. Most of the pages
|
||||||
|
benefit from having the table of contents provided. Sometimes the TOC just
|
||||||
|
doesn't make a lot of sense. We've defined a variable in our front matter
|
||||||
|
of some pages to turn off the TOC from being displayed.
|
||||||
|
|
||||||
|
Here is the example front matter:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
title: "Permalinks"
|
||||||
|
date: "2013-11-18"
|
||||||
|
aliases:
|
||||||
|
- "/doc/permalinks/"
|
||||||
|
groups: ["extras"]
|
||||||
|
groups_weight: 30
|
||||||
|
notoc: true
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is the corresponding code inside of the template:
|
||||||
|
|
||||||
|
{{ if not .Params.notoc }}
|
||||||
|
<div id="toc" class="well col-md-4 col-sm-6">
|
||||||
|
{{ .TableOfContents }}
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Using Site (config) Parameters
|
||||||
|
In your top-level configuration file (eg, `config.yaml`) you can define site
|
||||||
|
parameters, which are values which will be available to you in chrome.
|
||||||
|
|
||||||
|
For instance, you might declare:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
params:
|
||||||
|
CopyrightHTML: "Copyright © 2013 John Doe. All Rights Reserved."
|
||||||
|
TwitterUser: "spf13"
|
||||||
|
SidebarRecentLimit: 5
|
||||||
|
```
|
||||||
|
|
||||||
|
Within a footer layout, you might then declare a `<footer>` which is only
|
||||||
|
provided if the `CopyrightHTML` parameter is provided, and if it is given,
|
||||||
|
you would declare it to be HTML-safe, so that the HTML entity is not escaped
|
||||||
|
again. This would let you easily update just your top-level config file each
|
||||||
|
January 1st, instead of hunting through your templates.
|
||||||
|
|
||||||
|
```
|
||||||
|
{{if .Site.Params.CopyrightHTML}}<footer>
|
||||||
|
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
|
||||||
|
</footer>{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
An alternative way of writing the "if" and then referencing the same value
|
||||||
|
is to use "with" instead. With rebinds the context `.` within its scope,
|
||||||
|
and skips the block if the variable is absent:
|
||||||
|
|
||||||
|
```
|
||||||
|
{{with .Site.Params.TwitterUser}}<span class="twitter">
|
||||||
|
<a href="https://twitter.com/{{.}}" rel="author">
|
||||||
|
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
|
||||||
|
alt="Twitter"></a>
|
||||||
|
</span>{{end}}
|
||||||
|
```
|
||||||
|
|
||||||
|
Finally, if you want to pull "magic constants" out of your layouts, you can do
|
||||||
|
so, such as in this example:
|
||||||
|
|
||||||
|
```
|
||||||
|
<nav class="recent">
|
||||||
|
<h1>Recent Posts</h1>
|
||||||
|
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
|
||||||
|
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
|
||||||
|
{{end}}</ul>
|
||||||
|
</nav>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
[go]: https://golang.org/
|
||||||
|
[gohtmltemplate]: https://golang.org/pkg/html/template/
|
@ -0,0 +1,89 @@
|
|||||||
|
+++
|
||||||
|
title = "Getting Started with Hugo"
|
||||||
|
description = ""
|
||||||
|
tags = [
|
||||||
|
"go",
|
||||||
|
"golang",
|
||||||
|
"hugo",
|
||||||
|
"development",
|
||||||
|
]
|
||||||
|
date = "2014-04-02"
|
||||||
|
categories = [
|
||||||
|
"Development",
|
||||||
|
"golang",
|
||||||
|
]
|
||||||
|
menu = "main"
|
||||||
|
+++
|
||||||
|
|
||||||
|
## Step 1. Install Hugo
|
||||||
|
|
||||||
|
Go to [Hugo releases](https://github.com/spf13/hugo/releases) and download the
|
||||||
|
appropriate version for your OS and architecture.
|
||||||
|
|
||||||
|
Save it somewhere specific as we will be using it in the next step.
|
||||||
|
|
||||||
|
More complete instructions are available at [Install Hugo](https://gohugo.io/getting-started/installing/)
|
||||||
|
|
||||||
|
## Step 2. Build the Docs
|
||||||
|
|
||||||
|
Hugo has its own example site which happens to also be the documentation site
|
||||||
|
you are reading right now.
|
||||||
|
|
||||||
|
Follow the following steps:
|
||||||
|
|
||||||
|
1. Clone the [Hugo repository](http://github.com/spf13/hugo)
|
||||||
|
2. Go into the repo
|
||||||
|
3. Run hugo in server mode and build the docs
|
||||||
|
4. Open your browser to http://localhost:1313
|
||||||
|
|
||||||
|
Corresponding pseudo commands:
|
||||||
|
|
||||||
|
git clone https://github.com/spf13/hugo
|
||||||
|
cd hugo
|
||||||
|
/path/to/where/you/installed/hugo server --source=./docs
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 27 ms
|
||||||
|
> Web Server is available at http://localhost:1313
|
||||||
|
> Press ctrl+c to stop
|
||||||
|
|
||||||
|
Once you've gotten here, follow along the rest of this page on your local build.
|
||||||
|
|
||||||
|
## Step 3. Change the docs site
|
||||||
|
|
||||||
|
Stop the Hugo process by hitting Ctrl+C.
|
||||||
|
|
||||||
|
Now we are going to run hugo again, but this time with hugo in watch mode.
|
||||||
|
|
||||||
|
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 27 ms
|
||||||
|
> Web Server is available at http://localhost:1313
|
||||||
|
> Watching for changes in /Users/spf13/Code/hugo/docs/content
|
||||||
|
> Press ctrl+c to stop
|
||||||
|
|
||||||
|
|
||||||
|
Open your [favorite editor](http://vim.spf13.com) and change one of the source
|
||||||
|
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
|
||||||
|
|
||||||
|
Content files are found in `docs/content/`. Unless otherwise specified, files
|
||||||
|
are located at the same relative location as the url, in our case
|
||||||
|
`docs/content/overview/quickstart.md`.
|
||||||
|
|
||||||
|
Change and save this file.. Notice what happened in your terminal.
|
||||||
|
|
||||||
|
> Change detected, rebuilding site
|
||||||
|
|
||||||
|
> 29 pages created
|
||||||
|
> 0 tags index created
|
||||||
|
> in 26 ms
|
||||||
|
|
||||||
|
Refresh the browser and observe that the typo is now fixed.
|
||||||
|
|
||||||
|
Notice how quick that was. Try to refresh the site before it's finished building. I double dare you.
|
||||||
|
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
|
||||||
|
|
||||||
|
## Step 4. Have fun
|
||||||
|
|
||||||
|
The best way to learn something is to play with it.
|
@ -0,0 +1,156 @@
|
|||||||
|
---
|
||||||
|
date: 2014-03-10
|
||||||
|
linktitle: Migrating from Jekyll
|
||||||
|
menu:
|
||||||
|
main:
|
||||||
|
parent: tutorials
|
||||||
|
prev: /tutorials/mathjax
|
||||||
|
title: Migrate to Hugo from Jekyll
|
||||||
|
weight: 10
|
||||||
|
---
|
||||||
|
|
||||||
|
## Move static content to `static`
|
||||||
|
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
|
||||||
|
With Jekyll, something that looked like
|
||||||
|
|
||||||
|
▾ <root>/
|
||||||
|
▾ images/
|
||||||
|
logo.png
|
||||||
|
|
||||||
|
should become
|
||||||
|
|
||||||
|
▾ <root>/
|
||||||
|
▾ static/
|
||||||
|
▾ images/
|
||||||
|
logo.png
|
||||||
|
|
||||||
|
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
|
||||||
|
|
||||||
|
## Create your Hugo configuration file
|
||||||
|
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
|
||||||
|
|
||||||
|
## Set your configuration publish folder to `_site`
|
||||||
|
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
|
||||||
|
|
||||||
|
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
|
||||||
|
|
||||||
|
git submodule deinit _site
|
||||||
|
git rm _site
|
||||||
|
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
|
||||||
|
|
||||||
|
2. Or, change the Hugo configuration to use `_site` instead of `public`.
|
||||||
|
|
||||||
|
{
|
||||||
|
..
|
||||||
|
"publishdir": "_site",
|
||||||
|
..
|
||||||
|
}
|
||||||
|
|
||||||
|
## Convert Jekyll templates to Hugo templates
|
||||||
|
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
|
||||||
|
|
||||||
|
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
|
||||||
|
|
||||||
|
## Convert Jekyll plugins to Hugo shortcodes
|
||||||
|
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
|
||||||
|
|
||||||
|
### Implementation
|
||||||
|
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
|
||||||
|
|
||||||
|
Jekyll's plugin:
|
||||||
|
|
||||||
|
module Jekyll
|
||||||
|
class ImageTag < Liquid::Tag
|
||||||
|
@url = nil
|
||||||
|
@caption = nil
|
||||||
|
@class = nil
|
||||||
|
@link = nil
|
||||||
|
// Patterns
|
||||||
|
IMAGE_URL_WITH_CLASS_AND_CAPTION =
|
||||||
|
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
|
||||||
|
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
|
||||||
|
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
|
||||||
|
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
|
||||||
|
def initialize(tag_name, markup, tokens)
|
||||||
|
super
|
||||||
|
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
@caption = $7
|
||||||
|
@link = $9
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
@caption = $7
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CAPTION
|
||||||
|
@url = $1
|
||||||
|
@caption = $5
|
||||||
|
elsif markup =~ IMAGE_URL_WITH_CLASS
|
||||||
|
@class = $1
|
||||||
|
@url = $3
|
||||||
|
elsif markup =~ IMAGE_URL
|
||||||
|
@url = $1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
def render(context)
|
||||||
|
if @class
|
||||||
|
source = "<figure class='#{@class}'>"
|
||||||
|
else
|
||||||
|
source = "<figure>"
|
||||||
|
end
|
||||||
|
if @link
|
||||||
|
source += "<a href=\"#{@link}\">"
|
||||||
|
end
|
||||||
|
source += "<img src=\"#{@url}\">"
|
||||||
|
if @link
|
||||||
|
source += "</a>"
|
||||||
|
end
|
||||||
|
source += "<figcaption>#{@caption}</figcaption>" if @caption
|
||||||
|
source += "</figure>"
|
||||||
|
source
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
Liquid::Template.register_tag('image', Jekyll::ImageTag)
|
||||||
|
|
||||||
|
is written as this Hugo shortcode:
|
||||||
|
|
||||||
|
<!-- image -->
|
||||||
|
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
|
||||||
|
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
||||||
|
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
|
||||||
|
{{ if .Get "link"}}</a>{{ end }}
|
||||||
|
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
|
||||||
|
<figcaption>{{ if isset .Params "title" }}
|
||||||
|
{{ .Get "title" }}{{ end }}
|
||||||
|
{{ if or (.Get "caption") (.Get "attr")}}<p>
|
||||||
|
{{ .Get "caption" }}
|
||||||
|
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
|
||||||
|
{{ .Get "attr" }}
|
||||||
|
{{ if .Get "attrlink"}}</a> {{ end }}
|
||||||
|
</p> {{ end }}
|
||||||
|
</figcaption>
|
||||||
|
{{ end }}
|
||||||
|
</figure>
|
||||||
|
<!-- image -->
|
||||||
|
|
||||||
|
### Usage
|
||||||
|
I simply changed:
|
||||||
|
|
||||||
|
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
|
||||||
|
|
||||||
|
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
|
||||||
|
|
||||||
|
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
|
||||||
|
|
||||||
|
As a bonus, the shortcode named parameters are, arguably, more readable.
|
||||||
|
|
||||||
|
## Finishing touches
|
||||||
|
### Fix content
|
||||||
|
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
|
||||||
|
|
||||||
|
### Clean up
|
||||||
|
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
|
||||||
|
|
||||||
|
## A practical example in a diff
|
||||||
|
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
{"Target":"book.min.6cd8553a6854f4812343f0f0c8baca31271e686434f381fbe3c7226f66639176.css","MediaType":"text/css","Data":{"Integrity":"sha256-bNhVOmhU9IEjQ/DwyLrKMSceaGQ084H748cib2ZjkXY="}}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1 @@
|
|||||||
|
{"Target":"book.min.284c8fc21ced13c579d9027a9d14893c56b243c6045001180391cebb4cc36ab8.css","MediaType":"text/css","Data":{"Integrity":"sha256-KEyPwhztE8V52QJ6nRSJPFayQ8YEUAEYA5HOu0zDarg="}}
|
21
website/themes/book/i18n/cn.yaml
Normal file
21
website/themes/book/i18n/cn.yaml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# This should be removed in future, 'cn' is moved to `zh'
|
||||||
|
- id: Search
|
||||||
|
translation: 搜索
|
||||||
|
|
||||||
|
- id: Edit this page
|
||||||
|
translation: 编辑本页
|
||||||
|
|
||||||
|
- id: Last modified by
|
||||||
|
translation: 最后修改者
|
||||||
|
|
||||||
|
- id: Expand
|
||||||
|
translation: 展开
|
||||||
|
|
||||||
|
- id: bookSearchConfig
|
||||||
|
translation: |
|
||||||
|
{
|
||||||
|
encode: false,
|
||||||
|
tokenize: function(str) {
|
||||||
|
return str.replace(/[\x00-\x7F]/g, '').split('');
|
||||||
|
}
|
||||||
|
}
|
14
website/themes/book/i18n/cs.yaml
Normal file
14
website/themes/book/i18n/cs.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- id: Search
|
||||||
|
translation: Vyhledávat
|
||||||
|
|
||||||
|
- id: Edit this page
|
||||||
|
translation: Upravit tuto stránku
|
||||||
|
|
||||||
|
- id: Last modified by
|
||||||
|
translation: Autor poslední změny
|
||||||
|
|
||||||
|
- id: Expand
|
||||||
|
translation: Rozbalit
|
||||||
|
|
||||||
|
- id: bookSearchConfig
|
||||||
|
translation: '{ cache: true }'
|
14
website/themes/book/i18n/de.yaml
Normal file
14
website/themes/book/i18n/de.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- id: Search
|
||||||
|
translation: Suche
|
||||||
|
|
||||||
|
- id: Edit this page
|
||||||
|
translation: Seite bearbeiten
|
||||||
|
|
||||||
|
- id: Last modified by
|
||||||
|
translation: Zuletzt geändert von
|
||||||
|
|
||||||
|
- id: Expand
|
||||||
|
translation: Erweitern
|
||||||
|
|
||||||
|
- id: bookSearchConfig
|
||||||
|
translation: '{ cache: true }'
|
14
website/themes/book/i18n/en.yaml
Normal file
14
website/themes/book/i18n/en.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- id: Search
|
||||||
|
translation: Search
|
||||||
|
|
||||||
|
- id: Edit this page
|
||||||
|
translation: Edit this page
|
||||||
|
|
||||||
|
- id: Last modified by
|
||||||
|
translation: Last modified by
|
||||||
|
|
||||||
|
- id: Expand
|
||||||
|
translation: Expand
|
||||||
|
|
||||||
|
- id: bookSearchConfig
|
||||||
|
translation: '{ cache: true }'
|
14
website/themes/book/i18n/es.yaml
Normal file
14
website/themes/book/i18n/es.yaml
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
- id: Search
|
||||||
|
translation: Buscar
|
||||||
|
|
||||||
|
- id: Edit this page
|
||||||
|
translation: Editar esta página
|
||||||
|
|
||||||
|
- id: Last modified by
|
||||||
|
translation: Última modificación por
|
||||||
|
|
||||||
|
- id: Expand
|
||||||
|
translation: Expand
|
||||||
|
|
||||||
|
- id: bookSearchConfig
|
||||||
|
translation: '{ cache: true }'
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user