Skip to content

Instantly share code, notes, and snippets.

@abitrolly
Created June 1, 2020 09:00
Show Gist options
  • Save abitrolly/945097afa020ddd68ab2ed3b0976cabf to your computer and use it in GitHub Desktop.
Save abitrolly/945097afa020ddd68ab2ed3b0976cabf to your computer and use it in GitHub Desktop.
Data, logic into markup in a single file

Both Jykyll and Hugo support front-matter/

Jekyll

---
food: Pizza
---

<h1>{{ page.food }}</h1>

Hugo

TBD

Simplates

Something about embedding Python and logic to the "front-matter".

http://simplates.org/

import random

[----]
program = request.qs['program']
excitement = "!" * random.randint(1, 10)

[----] text/html via stdlib_format
<h1>Greetings, {program}{excitement}</h1>

[----] text/plain via stdlib_format
Greetings, {program}{excitement}

[----] application/json via json_dump
{ "program": program
, "excitement": excitement
 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment