From f771f6acb3c43fda38c11fae1700d50ea03dd29f Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 28 Nov 2025 16:53:42 +0800 Subject: [PATCH] test: migrate tests from docs repo --- apps/test/content/posts/aplayer-test/index.md | 2 + apps/test/content/posts/codeblock-test.md | 83 ++++++++ .../content/posts/encryption-test/index.md | 179 ++++++++++++++++++ apps/test/content/posts/fontawesome-test.md | 78 ++++++++ apps/test/content/posts/json-viewer-test.md | 4 - 5 files changed, 342 insertions(+), 4 deletions(-) create mode 100644 apps/test/content/posts/codeblock-test.md create mode 100644 apps/test/content/posts/encryption-test/index.md create mode 100644 apps/test/content/posts/fontawesome-test.md diff --git a/apps/test/content/posts/aplayer-test/index.md b/apps/test/content/posts/aplayer-test/index.md index 431caea0..f5c1384a 100644 --- a/apps/test/content/posts/aplayer-test/index.md +++ b/apps/test/content/posts/aplayer-test/index.md @@ -9,6 +9,8 @@ tags: - APlayer --- +Testing APlayer shortcode in FixIt theme. + {{< aplayer fixed=false mini=false autoplay=false theme="#b7daff" loop="all" order="list" preload="auto" volume=0.7 mutex=true lrcType=3 listFolded=false listMaxHeight="" storageName="aplayer-setting" >}} diff --git a/apps/test/content/posts/codeblock-test.md b/apps/test/content/posts/codeblock-test.md new file mode 100644 index 00000000..217e4f97 --- /dev/null +++ b/apps/test/content/posts/codeblock-test.md @@ -0,0 +1,83 @@ +--- +title: Code Block Test +date: 2025-11-28T15:16:35+08:00 +collections: + - Tests +categories: + - Markdown +tags: + - Code Block +--- +Testing code block in FixIt theme. + + + +```fixit +🎉🥚 in development mode! +``` + +## Diff Code + +```diff +- theme = "LoveIt" ++ theme = "FixIt" +! enhancements and fixes +``` + +## Long Code + +```html +

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

+``` + +

Lorem ipsum dolor sit amet, graecis denique ei vel, at duo primis mandamus. Et legere ocurreret pri, animal tacimates complectitur ad cum. Cu eum inermis inimicus efficiendi. Labore officiis his ex, soluta officiis concludaturque ei qui, vide sensibus vim ad.

+ +## Highlighting + +Highlighting in code fences is enabled by default. + +```js {linenos=table,linenostart=287,hl_lines=[2,"8-10"]} +/** + * check if a string is a JS object string + * @example isObjectLiteral("{a:1,b:2}") // true + * @param {string} str string to check + * @returns {boolean} whether the string is a JS object string + */ +function isObjectLiteral(str) { + if (typeof str !== 'string') { + return false + } + str = str.replace(/\s+/g, ' ').trim().replace(/;$/, '') + if (str.startsWith('{') && str.endsWith('}')) { + return true + } + return false +} +``` + +Highlighting in shortcode highlight. + +{{< highlight javascript "linenos=table,hl_lines=2 8-10,linenostart=287" >}} +/** + * check if a string is a JS object string + * @example isObjectLiteral("{a:1,b:2}") // true + * @param {string} str string to check + * @returns {boolean} whether the string is a JS object string + */ +function isObjectLiteral(str) { + if (typeof str !== 'string') { + return false + } + str = str.replace(/\s+/g, ' ').trim().replace(/;$/, '') + if (str.startsWith('{') && str.endsWith('}')) { + return true + } + return false +} +{{< /highlight >}} + +## Gist Embed + +{{< gist Lruihao fb8b2d0353465c4d40bf74818db80710 >}} + + diff --git a/apps/test/content/posts/encryption-test/index.md b/apps/test/content/posts/encryption-test/index.md new file mode 100644 index 00000000..4e9b1d66 --- /dev/null +++ b/apps/test/content/posts/encryption-test/index.md @@ -0,0 +1,179 @@ +--- +title: Encryption Test +date: 2022-05-21T22:31:22+08:00 +description: Test for encrypting content +password: 1212 +message: Password is 1212 +collections: + - Tests +categories: + - Features +tags: + - Encryption +--- + +I was shy, so I hid. + + + +## Ruby + +[Hugo]^(An open-source static site generator) + +## Math + +$$ \ce{CO2 + C -> 2 CO} $$ + +$$ \ce{Hg^2+ ->[I-] HgI2 ->[I-] [Hg^{II}I4]^2-} $$ + +## style + +{{< style "text-align:right; strong{color:#00b1ff;}" >}} +This is a **right-aligned** paragraph. +{{< /style >}} + +## Script + +{{< script >}} +console.log('before decrypting'); + +document.addEventListener('DOMContentLoaded', () => { + fixit.decryptor.addEventListener('decrypted', function() { + console.log('after decrypting') + }) +}); +{{< /script >}} + +## Mermaid + +```mermaid +graph LR; + A[Hard edge] -->|Link text| B(Round edge) + B --> C{Decision} + C -->|One| D[Result one] + C -->|Two| E[Result two] +``` + +## Echarts + +```echarts +title: + text: Summary Line Chart + top: 2% + left: center +tooltip: + trigger: axis +legend: + data: + - Email Marketing + - Affiliate Advertising + - Video Advertising + - Direct View + - Search Engine + top: 10% +grid: + left: 5% + right: 5% + bottom: 5% + top: 20% + containLabel: true +toolbox: + feature: + saveAsImage: + title: Save as Image +xAxis: + type: category + boundaryGap: false + data: + - Monday + - Tuesday + - Wednesday + - Thursday + - Friday + - Saturday + - Sunday +yAxis: + type: value +series: + - name: Email Marketing + type: line + stack: Total + data: + - 120 + - 132 + - 101 + - 134 + - 90 + - 230 + - 210 + - name: Affiliate Advertising + type: line + stack: Total + data: + - 220 + - 182 + - 191 + - 234 + - 290 + - 330 + - 310 + - name: Video Advertising + type: line + stack: Total + data: + - 150 + - 232 + - 201 + - 154 + - 190 + - 330 + - 410 + - name: Direct View + type: line + stack: Total + data: + - 320 + - 332 + - 301 + - 334 + - 390 + - 330 + - 320 + - name: Search Engine + type: line + stack: Total + data: + - 820 + - 932 + - 901 + - 934 + - 1290 + - 1330 + - 1320 +``` + +## Typeit + +{{< typeit code=javascript >}} +console.log('before decrypting'); + +document.addEventListener('DOMContentLoaded', () => { + fixit.decryptor.addEventListener('decrypted', function() { + console.log('after decrypting') + }) +}); +{{< /typeit >}} + +## fixit-encryptor + +All the following shortcodes passwords are `1212`. + +{{% fixit-encryptor "1212" %}} +{{< typeit >}}如果你愿意一层一层一层地剥开我的心{{< /typeit >}} +{{% fixit-encryptor "1212" %}} +{{< typeit >}}你会发现 你会讶异{{< /typeit >}} +{{% fixit-encryptor "1212" %}} +{{< typeit >}}你是我最压抑最深处的秘密{{< /typeit >}} +{{% /fixit-encryptor %}} +{{% /fixit-encryptor %}} +{{% /fixit-encryptor %}} diff --git a/apps/test/content/posts/fontawesome-test.md b/apps/test/content/posts/fontawesome-test.md new file mode 100644 index 00000000..290346b9 --- /dev/null +++ b/apps/test/content/posts/fontawesome-test.md @@ -0,0 +1,78 @@ +--- +title: Font Awesome Test +date: 2025-11-28T08:30:39+08:00 +collections: + - Tests +categories: + - Markdown +tags: + - Font Awesome +--- + +Test for rendering Font Awesome icons. + + + +## Size + +:(fa-solid fa-camera fa-xs): +:(fa-solid fa-camera fa-sm): +:(fa-solid fa-camera fa-lg): +:(fa-solid fa-camera fa-2x): +:(fa-solid fa-camera fa-3x): +:(fa-solid fa-camera fa-5x): +:(fa-solid fa-camera fa-7x): +:(fa-solid fa-camera fa-10x): + +## Fixed width + +:(fa-solid fa-skating fa-fw fa-2x): Skating\ +:(fa-solid fa-skiing fa-fw fa-2x): Skiing\ +:(fa-solid fa-skiing-nordic fa-fw fa-2x): Nordic Skiing + +## List icon + +:(fa-regular fa-check-square): Eat a hamburger\ +:(fa-regular fa-square): Get a girlfriend + +:(fa-regular fa-check-circle): Go to beach\ +:(fa-regular fa-circle): Go to Tibet + +## Rotate + +:(fa-solid fa-snowboarding): +:(fa-solid fa-snowboarding fa-rotate-90): +:(fa-solid fa-snowboarding fa-rotate-180): +:(fa-solid fa-snowboarding fa-rotate-270): + +## Flip + +:(fa-solid fa-snowboarding): +:(fa-solid fa-snowboarding fa-flip-horizontal): +:(fa-solid fa-snowboarding fa-flip-vertical): +:(fa-solid fa-snowboarding fa-flip-both): + +## Animation + +:(fa-solid fa-spinner): +:(fa-solid fa-spinner fa-spin): +:(fa-solid fa-spinner fa-pulse): +:(fa-solid fa-circle-notch fa-spin): +:(fa-solid fa-circle-notch fa-pulse): +:(fa-solid fa-sync fa-spin): +:(fa-solid fa-sync fa-pulse): +:(fa-solid fa-cog fa-spin): +:(fa-solid fa-cog fa-pulse): + +## Float + +:(fa-solid fa-quote-left fa-pull-left): + +hey guys! +{.text-center} + +:(fa-solid fa-quote-right fa-pull-right): + +## Border + +:(fa-brands fa-apple fa-border fa-fw fa-10x): diff --git a/apps/test/content/posts/json-viewer-test.md b/apps/test/content/posts/json-viewer-test.md index c43776d9..f4ca0e29 100644 --- a/apps/test/content/posts/json-viewer-test.md +++ b/apps/test/content/posts/json-viewer-test.md @@ -55,10 +55,6 @@ disabled copy: } ``` -```fixit -🎉🥚 in development mode! -``` - ## JSON Code ```json {enable=false}