diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-24 22:54:43 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-25 05:05:48 +0300 |
commit | 9b3ad53e855764e46a9febe395b88d3ca1aeaf45 (patch) | |
tree | 9930fcc81ef6fd38cb168732bdfd6bf87a4f0828 /_includes/snippets/section.html | |
parent | add _drafts/ (diff) | |
download | jekyll-theme-9b3ad53e855764e46a9febe395b88d3ca1aeaf45.tar.gz jekyll-theme-9b3ad53e855764e46a9febe395b88d3ca1aeaf45.zip |
add post "static vs. inline vs. namespace {"
Also includes a bunch of includes to easily add grouped code snippets to
a post.
They were present before, but I wiped them away during the recent major
history rewriting which I still regret about.
Diffstat (limited to '')
-rw-r--r-- | _includes/snippets/section.html | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/_includes/snippets/section.html b/_includes/snippets/section.html new file mode 100644 index 0000000..79be3c1 --- /dev/null +++ b/_includes/snippets/section.html @@ -0,0 +1,25 @@ +{% if page.snippets_collapsible %} +<div class="panel-group" id="accordion_{{ include.section_id }}"> +{% else %} +<div class="panel-group"> +{% endif %} + +{% for i in page.snippets[include.section_id] %} + {% include snippets/header.html snippet_path=i section_id=include.section_id %} + +{% capture snippet %} +```c++ +{% include_relative {{ page.snippets_root_directory }}/{{ i }} %}``` +{% endcapture %} + +{{ snippet | markdownify }} + + {% include snippets/footer.html %} +{% endfor %} + +</div> + +{% for i in page.snippets[include.section_id] %} + {% capture snippet_id %}{{ i | replace:"/","_" | replace:".","_" }}{% endcapture %} +[{{ i }}]: #{{ snippet_id }} +{% endfor %} |