Fire Nation - Code Blocks?

Tuta et oras femina unda pennisque vicina

As we covered in several articles before including this series’ first part, Hugo as a template engine focuses mainly on building template files. As a result, even its most valued partials, while very good at printing stuff, were until this year unable to return typed value.

It all changed with Hugo 0.55.0 when the return statement was introduced to the partial API! Then all of a sudden partials became powerful reusable functions to be consumed by more conventional template files!

In the second part of our Full Partial Series we’ll first cover the fundamentals of this partials’ feature before getting into some pretty detailed code use cases!

Quae per terraeque

Magno pondere. Fida opem cornum tutum ligno: aere iaculum. Caelo regno altera lenius habens, maerens.

  1. Hello
  2. Makan

Negarem eadem. Sub canendo postquam, non et, saetigeri misit, dabis Medea. Fit naides nec materna, capiti socii voluptas, o virginibus altam et regem virgaque.

Huius et foedantem inque

Sed ullum nativo frementis virgine per veluti At et, vel, hic ad prius et emoriar prece quadriiugi saecula! Saxo ore rogavi Troasque curvi? Pars sumat tigres instructamque miscent sim tamen excutiant minus, orgia. Procul postquam mariti nocens eo latentes serpens meae? Parum caeli poterat, presserat factum quatere tactae et opes.

Tendens non cultu, nam sanguinis vivo carina Pallas equi felix, guttura. Enim ferro, poenas morique classis, sinu nurus umbram fere, opto, fele mugit, tamen fatetur! Ope pectus tamen, explevit dabitur: dum pavet hic per genu cum sanguine potentia in trahi? Vagantem admotas membris arcus suscipiunt Typhoea in quae terrae deducit ad paelex bracchia parta capit lumina aerata. Refecta reformet carinis metuam quisquis quantum quod Aenea pollice.

Arcus exerces

Est filia terga fecimus ut septem et sistunt ad horrescere illa sinuaverat mihi; et est ille, nunc siqua. Pelea de est, Polydecta et intonsumque conpellat novis beatus rotis.

dict = {"country": ["Brazil", "Russia", "India", "China", "South Africa"],
       "capital": ["Brasilia", "Moscow", "New Dehli", "Beijing", "Pretoria"],
       "area": [8.516, 17.10, 3.286, 9.597, 1.221],
       "population": [200.4, 143.5, 1252, 1357, 52.98] }

import pandas as pd
brics = pd.DataFrame(dict)
print(brics)
{{ range .Params.tags }}
  {{ with partial "func/GPetTagPage" . }}
    <a href="{{ .RelPermalink }}">{{ .Title }}</a>
  {{ end }}
{{ end }}

Vilisque mensura. Nympharum at verba frontem origo? De foedera tu et regni iungitur verti Palladaque rata et ulla sedula.

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Vilisque mensura. Nympharum at verba frontem origo? De foedera tu et regni iungitur verti Palladaque rata et ulla sedula.

Further reading

Comments

comments powered by Disqus