Files
blog/content/demo/index.md
daudix 6124fdfc60 Add hot/poor article types, move article list to a partial (fixes #58 and #53)
Among other things introduce new --fg-contrast color variable.
2024-08-26 03:35:30 +03:00

17 KiB

+++ title = "Demo Page" +++

Demo Page

{% alert(note=true) %} This is a demo of most of the components, but some of them are only accessible on specific pages. If you wish to see them, follow one of these:

Markdown

Text can be bold, italic, strikethrough, and all at the same time.

Link to another page.

There should be whitespace between paragraphs1 .

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This is a normal paragraph2 following a header.

😭😂🥺🤣❤️🙏😍🥰😊

Long, single-line code blocks should not wrap. They should horizontally scroll if they are too long. This line should be long enough to demonstrate this.

"Original content is original only for a few seconds before getting old"

Rule #21 of the internet

  • Item 1
  • Item 2
    • Item 2.1
    • Item 2.2
  • Item 3
  • Item 4
  1. Perform step #1
  2. Proceed to step #2
  3. Conclude with step #3
  • Milk
  • Eggs
  • Flour
  • Coffee
  • Combustible lemons

Male mallard duck

Mare Rating Additional info
Fluttershy Best pone Shy and adorable
Apple Jack Good pone Honest and nice
Pinkie Pie Fun pone Party horn!
Twilight Decent pone Neeerd
Rainbow Dash Annoying pone Looks badass
Rarity Fancy pone Sometimes nice
let highlight = true;
pre mark {
  // If you want your highlights to take the full width
  display: block;
  color: currentcolor;
}
pre table td:nth-of-type(1) {
  // Select a colour matching your theme
  color: #6b6b6b;
  font-style: italic;
}

Extra

Shortcodes

Duckquill provides a few useful shortcodes that simplify some tasks. They can be used on all pages.

Alerts

GitHub-style alerts. Simply wrap the text of desired alert inside the shortcode to get the desired look.

Available alert types:

  • note: Useful information that users should know, even when skimming content.
  • tip: Helpful advice for doing things better or more easily.
  • important: Key information users need to know to achieve their goal.
  • warning: Urgent info that needs immediate user attention to avoid problems.
  • caution: Advises about risks or negative outcomes of certain actions.
{%/* alert(note=true) */%}
-> Alert text <-
{%/* end */%}

{% alert(note=true) %} Useful information that users should know, even when skimming content. {% end %}

{% alert(tip=true) %} Helpful advice for doing things better or more easily. {% end %}

{% alert(important=true) %} Key information users need to know to achieve their goal. {% end %}

{% alert(warning=true) %} Urgent info that needs immediate user attention to avoid problems. {% end %}

{% alert(caution=true) %} Advises about risks or negative outcomes of certain actions. {% end %}

Images and Videos

By default images and videos come with some generic styling, such as rounded corners and shadow. To fine-tune these, you can use shortcodes with different variable combinations.

Available variables are:

  • url: URL to an image.
  • url_min: URL to compressed version of an image, original can be opened by clicking on the image.
  • alt: Alt text, same as if the text were inside square brackets in Markdown.
  • full: Forces image to be full-width.
  • full_bleed: Forces image to fill all the available screen width. Removes shadow, rounded corners and zoom on hover.
  • start: Float image to the start of paragraph and scale it down.
  • end: Float image to the end of paragraph and scale it down.
  • pixels: Uses nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.
  • transparent: Removes rounded corners and shadow, useful for images with transparency.
  • no_hover: Removes zoom on hover.
{{/* image(url="image.png", alt="This is an image" no_hover=true) */}}
{{ image(url="https://i1.theportalwiki.net/img/2/23/Ashpd_blueprint.jpg", alt="Portal Gun blueprint", no_hover=true) }}
Image with an alt text and without zoom on hover
{{ image(url="https://upload.wikimedia.org/wikipedia/commons/b/b4/JPEG_example_JPG_RIP_100.jpg", url_min="https://upload.wikimedia.org/wikipedia/commons/3/38/JPEG_example_JPG_RIP_010.jpg", alt="The gravestone of J.P.G.", no_hover=true) }}
Image with compressed version, an alt text, and without zoom on hover

Alternatively, you can append the following URL anchors. It can be more handy in some cases, e.g. such images will render normally in any Markdown editor, opposed to the Zola shortcodes.

  • #full: Forces image to be full-width.
  • #full-bleed: Forces image to fill all the available screen width. Removes shadow, rounded corners and zoom on hover.
  • #start: Float image to the start of paragraph and scale it down.
  • #end: Float image to the end of paragraph and scale it down.
  • #pixels: Uses nearest neighbor algorithm for scaling, useful for keeping pixel-art sharp.
  • #transparent: Removes rounded corners and shadow, useful for images with transparency.
  • #no-hover: Removes zoom on hover.

Toolbx header image

Full-width image with an alt text, pixel-art rendering, no shadow and rounded corners, and no zoom on hover

1966 Ford Mustang coupe white Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim aeque doleamus animo, cum corpore dolemus, fieri tamen permagna accessio potest, si aliquod aeternum et infinitum impendere malum nobis opinemur.


Picture of the magnificent lej da staz just before sunrise in october

For videos it's all the same except for a few differences: no_hover and url_min variables are not available.

{{/* video(url="video.webm", alt="This is a video") */}}
{{ video(url="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm", alt="Red flower wakes up") }}
WebM video example from MDN
{{ video(url="https://upload.wikimedia.org/wikipedia/commons/transcoded/0/0e/Duckling_preening_%2881313%29.webm/Duckling_preening_%2881313%29.webm.720p.vp9.webm", alt="Duckling preening", full_bleed=true) }}
Duckling preening

CRT

Alright, this one doesn't simplify anything, it just adds a CRT-like effect around Markdown code blocks.

{%/* crt() */%}
-> Markdown code block <-
{%/* end */%}

{% crt() %}

 _____________________________________________
|.'',        Public_Library_Halls         ,''.|
|.'.'',                                 ,''.'.|
|.'.'.'',                             ,''.'.'.|
|.'.'.'.'',                         ,''.'.'.'.|
|.'.'.'.'.|                         |.'.'.'.'.|
|.'.'.'.'.|===;                 ;===|.'.'.'.'.|
|.'.'.'.'.|:::|',             ,'|:::|.'.'.'.'.|
|.'.'.'.'.|---|'.|, _______ ,|.'|---|.'.'.'.'.|
|.'.'.'.'.|:::|'.|'|???????|'|.'|:::|.'.'.'.'.|
|,',',',',|---|',|'|???????|'|,'|---|,',',',',|
|.'.'.'.'.|:::|'.|'|???????|'|.'|:::|.'.'.'.'.|
|.'.'.'.'.|---|','   /%%%\   ','|---|.'.'.'.'.|
|.'.'.'.'.|===:'    /%%%%%\    ':===|.'.'.'.'.|
|.'.'.'.'.|%%%%%%%%%%%%%%%%%%%%%%%%%|.'.'.'.'.|
|.'.'.'.','       /%%%%%%%%%\       ','.'.'.'.|
|.'.'.','        /%%%%%%%%%%%\        ','.'.'.|
|.'.','         /%%%%%%%%%%%%%\         ','.'.|
|.','          /%%%%%%%%%%%%%%%\          ','.|
|;____________/%%%%%Spicer%%%%%%\____________;|

{% end %}

There's also a cursor class that you can add to a span with e.g. character to simulate the terminal cursor. It doesn't work from inside Markdown code blocks though.

Description List (<dl>)

<dl>
<dt>Something</dt>
<dd>And its description</dd>
</dl>
Name
Godzilla
Born
1952
Birthplace
Japan
Color
Green

Form Input (<input>)

<input type="checkbox" />
<label>Checkbox</label>
  •  Milk
  •  Eggs
  •  Flour
  •  Coffee
  •  Combustible lemons

With radio type:

<input type="radio" name="test" />
<label>Radio</label>
  •  Milk
  •  Eggs
  •  Flour
  •  Coffee
  •  Combustible lemons

With color type:

<label>Color:</label>
<input type="color" value="#000000" />

With range type:

<input type="range" max="100" value="33">
<script type="text/javascript"> var slider = document.getElementById("range"); var output = document.getElementById("range-value"); output.innerHTML = slider.value; slider.oninput = function() { output.innerHTML = this.value; } </script>

Figure Captions (<figcaption>)

<figure>
  -> Whatever content <-
  <figcaption>Caption of content above</figcaption>
</figure>

The Office

The Office where Stanley works, it has yellow floor and beige walls

Accordion (<details>)

<details>
  <summary>Accordion title</summary>
  -> Contents here <-
</details>
Reveal accordion

Get it? I know, it's an awful pun. Piano Accordion

Side Comment (<small>)

<small>Small, cute text that doesn't catch attention.</small>

Small, cute text that doesn't catch attention.

Abbreviation (<abbr>)

<abbr title="American Standard Code for Information Interchange">ASCII</abbr>

The ASCII art are awesome!

Aside (<aside>)

<aside>
-> Contents here <-
</aside>

A quill is a writing tool made from a moulted flight feather (preferably a primary wing-feather) of a large bird. Quills were used for writing with ink before the invention of the dip pen, the metal-nibbed pen, the fountain pen, and, eventually, the ballpoint pen.

As with the earlier reed pen (and later dip pen), a quill has no internal ink reservoir and therefore needs to periodically be dipped into an inkwell during writing. The hand-cut goose quill is rarely used as a calligraphy tool anymore because many papers are now derived from wood pulp and would quickly wear a quill down. However it is still the tool of choice for a few scribes who have noted that quills provide an unmatched sharp stroke as well as greater flexibility than a steel pen.

Keyboard Input (<kbd>)

<kbd>⌘ Command</kbd>.

To switch the keyboard layout, press ⌘ Super + Space.

Mark Text (<mark>)

<mark>Marked text</mark>

You know what? I'm gonna say some very important stuff, so important that even bold is not enough.

Deleted and Inserted Text (<del> and <ins>)

<del>Something deleted</del> <ins>Something added</ins>

Text deleted Text added

Progress Indicator (<progress>)

<progress></progress>
<progress value="33" max="100"></progress>

Sample Output (<samp>)

<samp>Sample Output</samp>

Sample Output

Inline Quotation (<q>)

<q>Someone said something</q>

Blah blah Inline Quote hmm.

Unarticulated Annotation (<u>)

<u>Gmarrar mitsakes</u>

Yeet the sus drip while vibing with the TikTok fam on a cap-free boomerang.

<a class="external" href="https://example.org">External link</a>

Link to site

Buttons Dialog

<div class="dialog-buttons">
  <a class="inline-button" href="#top">Go to Top</a>
  <a class="inline-button colored external" href="https://example.org">Example</a>
</div>
<style> #color-picker-container { -webkit-backdrop-filter: var(--blur); position: fixed; bottom: 1rem; left: 0; transform: translateX(calc(-100% + 1rem)); z-index: 1; backdrop-filter: var(--blur); transition: var(--transition); box-shadow: var(--edge-highlight); border-start-end-radius: var(--rounded-corner); border-end-end-radius: var(--rounded-corner); background-color: var(--nav-bg); padding: 0.5rem; } #color-picker-container:hover { transform: none; } #color-picker-container label { margin-inline-end: 0.25rem; color: var(--fg-muted-4); font-weight: bold; } :root[dir*="rtl"] #color-picker-container { right: 0; left: unset; transform: translateX(calc(100% - 1rem)); } :root[dir*="rtl"] #color-picker-container:hover { transform: none; } </style> <script type="text/javascript"> let colorPicker; const defaultColor = window.getComputedStyle(document.documentElement).getPropertyValue("--primary-color"); console.log(defaultColor); window.addEventListener("load", startup, false); function hexToRGB(hex, alpha) { var r = parseInt(hex.slice(1, 3), 16), g = parseInt(hex.slice(3, 5), 16), b = parseInt(hex.slice(5, 7), 16); if (alpha) { return "rgb(" + r + " " + g + " " + b + " / " + alpha + ")"; } else { return "rgb(" + r + " " + g + " " + b + ")"; } } function startup() { colorPicker = document.querySelector("#color-picker"); colorPicker.value = defaultColor; colorPicker.addEventListener("input", update, false); colorPicker.select(); } function update(event) { document.documentElement.style.setProperty('--primary-color', event.target.value); document.documentElement.style.setProperty('--primary-color-alpha', hexToRGB(event.target.value, 0.2)); } </script>