From 692973e9f5d294937c5d31bd8dc3f9658ea88fb9 Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sun, 22 May 2022 13:13:27 +0800 Subject: [PATCH] :construction: Feat: add content encryption crude demo (#123) --- exampleSite/content/tests/encrypt-content.md | 49 ++++++++++++++++++++ layouts/partials/single/decrypt-form.html | 32 +++++++++++++ layouts/posts/single.html | 28 +++++++++-- 3 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 exampleSite/content/tests/encrypt-content.md create mode 100644 layouts/partials/single/decrypt-form.html diff --git a/exampleSite/content/tests/encrypt-content.md b/exampleSite/content/tests/encrypt-content.md new file mode 100644 index 00000000..f919c8a6 --- /dev/null +++ b/exampleSite/content/tests/encrypt-content.md @@ -0,0 +1,49 @@ +--- +title: "Encrypt Test" +date: 2022-05-21T22:31:22+08:00 +description: "Test for encrypting content" +type: 'posts' +draft: true +password: 1212 +message: password is 1212 + +tags: +- Test +- Encrypt +categories: +- Test + +menu: + main: + title: "Test for encrypting content" + parent: "tests" + pre: "" +--- + +I was shy, so I hid. + + + +## Shortcodes in encrypted Content + +{{< version 0.2.8 >}} + +`script` is a shortcode to insert custom **:(fa-brands fa-js fa-fw): Javascript** in your post. + +{{< admonition >}} +The script content can be guaranteed to be executed in order after all third-party libraries are loaded. So you are free to use third-party libraries. +{{< /admonition >}} + +Example `script` input: + +```go-html-template +{{* script */>}} +console.log('Hello FixIt!'); +{{* /script */>}} +``` + +You can see the output in the console of the developer tool. + +{{< script >}} +console.log('Hello FixIt!'); +{{< /script >}} \ No newline at end of file diff --git a/layouts/partials/single/decrypt-form.html b/layouts/partials/single/decrypt-form.html new file mode 100644 index 00000000..674b9dc4 --- /dev/null +++ b/layouts/partials/single/decrypt-form.html @@ -0,0 +1,32 @@ +