Add some shortcodes for making the game theory post nicer.
This commit is contained in:
parent
29d12a9914
commit
e317c56c99
11
assets/scss/gametheory.scss
Normal file
11
assets/scss/gametheory.scss
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
@import "variables.scss";
|
||||||
|
@import "mixins.scss";
|
||||||
|
|
||||||
|
.assumption-number {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.assumption {
|
||||||
|
@include bordered-block;
|
||||||
|
padding: 0.8rem;
|
||||||
|
}
|
9
layouts/shortcodes/gt_assumption.html
Normal file
9
layouts/shortcodes/gt_assumption.html
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{{ $n := .Page.Scratch.Get "gt-assumption-count" }}
|
||||||
|
{{ $newN := add 1 (int $n) }}
|
||||||
|
{{ .Page.Scratch.Set "gt-assumption-count" $newN }}
|
||||||
|
{{ .Page.Scratch.SetInMap "gt-assumptions" (.Get 0) $newN }}
|
||||||
|
<div class="assumption">
|
||||||
|
<span id="gt-assumption-{{ .Get 0 }}" class="assumption-number">
|
||||||
|
Assumption {{ $newN }} ({{ .Get 1 }}).
|
||||||
|
</span> {{ .Inner }}
|
||||||
|
</div>
|
2
layouts/shortcodes/gt_css.html
Normal file
2
layouts/shortcodes/gt_css.html
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
{{ $style := resources.Get "scss/gametheory.scss" | resources.ToCSS | resources.Minify }}
|
||||||
|
<link rel="stylesheet" href="{{ $style.Permalink }}">
|
1
layouts/shortcodes/gt_link.html
Normal file
1
layouts/shortcodes/gt_link.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<a href="#gt-assumption-{{ .Get 0 }}">assumption {{ index (.Page.Scratch.Get "gt-assumptions") (.Get 0) }}</a>
|
Loading…
Reference in New Issue
Block a user