mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
test: migrate tests from docs repo
This commit is contained in:
@@ -9,6 +9,8 @@ tags:
|
||||
- APlayer
|
||||
---
|
||||
|
||||
Testing APlayer shortcode in FixIt theme.
|
||||
|
||||
<!--more-->
|
||||
|
||||
{{< 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" >}}
|
||||
|
||||
@@ -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.
|
||||
|
||||
<!--more-->
|
||||
|
||||
```fixit
|
||||
🎉🥚 in development mode!
|
||||
```
|
||||
|
||||
## Diff Code
|
||||
|
||||
```diff
|
||||
- theme = "LoveIt"
|
||||
+ theme = "FixIt"
|
||||
! enhancements and fixes
|
||||
```
|
||||
|
||||
## Long Code
|
||||
|
||||
```html
|
||||
<p>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.</p>
|
||||
```
|
||||
|
||||
<p>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.</p>
|
||||
|
||||
## 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 >}}
|
||||
|
||||
<!-- markdownlint-disable-file blanks-around-lists ul-style ul-indent code-block-style -->
|
||||
@@ -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.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 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 %}}
|
||||
@@ -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.
|
||||
|
||||
<!--more-->
|
||||
|
||||
## 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):
|
||||
@@ -55,10 +55,6 @@ disabled copy:
|
||||
}
|
||||
```
|
||||
|
||||
```fixit
|
||||
🎉🥚 in development mode!
|
||||
```
|
||||
|
||||
## JSON Code
|
||||
|
||||
```json {enable=false}
|
||||
|
||||
Reference in New Issue
Block a user