From d190b28f88637b7e4e2569e423a70daca9ae025b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 10 Apr 2021 00:54:33 +0300 Subject: add snippets example --- _posts/2021-04-09-test-post3.md | 10 +++++++++- _posts/snippets/snippet.cpp | 7 +++++++ _posts/snippets/snippet.hpp | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 _posts/snippets/snippet.cpp create mode 100644 _posts/snippets/snippet.hpp (limited to '_posts') diff --git a/_posts/2021-04-09-test-post3.md b/_posts/2021-04-09-test-post3.md index 340fc56..a1ca425 100644 --- a/_posts/2021-04-09-test-post3.md +++ b/_posts/2021-04-09-test-post3.md @@ -1,7 +1,13 @@ --- title: Test post 3 excerpt: > - This is test post #3. + This is test post #3. With snippets! +snippets_root_directory: snippets +snippets_language: c++ +snippets: + hello: + - snippet.hpp + - snippet.cpp --- Aenean ex ipsum, feugiat vel tortor sit amet, dictum facilisis dui. Pellentesque commodo leo at eros elementum porta. @@ -14,3 +20,5 @@ Nullam eget tortor nisl. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque posuere nunc a purus eleifend pulvinar. + +{% include snippets/section.html section_id='hello' %} diff --git a/_posts/snippets/snippet.cpp b/_posts/snippets/snippet.cpp new file mode 100644 index 0000000..bc4122e --- /dev/null +++ b/_posts/snippets/snippet.cpp @@ -0,0 +1,7 @@ +#include "snippet.hpp" + +#include + +void hello_snippets() { + std::cout << "Hello snippets!\n"; +} diff --git a/_posts/snippets/snippet.hpp b/_posts/snippets/snippet.hpp new file mode 100644 index 0000000..46556b6 --- /dev/null +++ b/_posts/snippets/snippet.hpp @@ -0,0 +1,3 @@ +#pragma once + +void hello_snippets(); -- cgit v1.2.3