Skip to content

Commit

Permalink
alex-shpak#422, add support for column ratios in shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-shpak authored and Hanekihyouka committed Oct 11, 2024
1 parent 91a4a72 commit 9dce619
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 186 deletions.
2 changes: 1 addition & 1 deletion assets/_shortcodes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

> div {
margin: $padding-16 0;
min-width: $body-min-width / 2;
min-width: $body-min-width * 0.66;
padding: 0 $padding-16;
}
}
Expand Down
79 changes: 0 additions & 79 deletions exampleSite/content.bn/_index.md

This file was deleted.

47 changes: 41 additions & 6 deletions exampleSite/content.en/docs/shortcodes/columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

Columns help organize shorter pieces of content horizontally for readability.

## Example

```html
{{%/* columns */%}} <!-- begin columns block -->
{{%/* columns [ratio="1:1"] [class="..."] */%}} <!-- begin columns block -->
# Left Content
Lorem markdownum insigne...

Expand All @@ -20,26 +21,60 @@ Lorem markdownum insigne...
{{%/* /columns */%}}
```

## Example

{{% columns %}}
## Left Content
### Left Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.

<--->

## Mid Content
### Mid Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter!

<--->

## Right Content
### Right Content
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.
{{% /columns %}}

## Settings size ratio for columns

```html
{{%/* columns ratio="1:2" */%}} <!-- begin columns block -->

## x1 Column
Lorem markdownum insigne...

<---> <!-- magic separator, between columns -->

## x2 Column
Lorem markdownum insigne...

{{%/* /columns */%}}
```

{{% columns ratio="1:2" %}}
### x1 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.

<--->

### x2 Column
Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter!

Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat
stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa
protulit, sed sed aere valvis inhaesuro Pallas animam: qui _quid_, ignes.
Miseratus fonte Ditis conubia.

{{% /columns %}}
6 changes: 3 additions & 3 deletions exampleSite/content.en/docs/shortcodes/katex.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ KaTeX shortcode let you render math typesetting in markdown document. See [KaTeX
{{% columns %}}

```latex
{{</* katex display=true class="optional" >}}
{{</* katex display=true [class="..."] >}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex */>}}
```

<--->

{{< katex display=true class="optional" >}}
{{<katex display=true>}}
f(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi
{{< /katex >}}
{{</katex>}}

{{% /columns %}}

Expand Down
6 changes: 3 additions & 3 deletions exampleSite/content.en/docs/shortcodes/mermaid.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ create a `mermaid.json` file in your `assets` folder!
{{% columns %}}

```tpl
{{</* mermaid class="optional" >}}
{{</* mermaid [class="..."] >}}
stateDiagram-v2
State1: The state with a note
note right of State1
Expand All @@ -28,7 +28,7 @@ stateDiagram-v2

<--->

{{< mermaid class="optional" >}}
{{<mermaid>}}
stateDiagram-v2
State1: The state with a note
note right of State1
Expand All @@ -37,6 +37,6 @@ stateDiagram-v2
end note
State1 --> State2
note left of State2 : This is the note to the left.
{{< /mermaid >}}
{{</mermaid>}}

{{% /columns %}}
41 changes: 41 additions & 0 deletions exampleSite/content.he/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Introduction
type: docs
---

# Example of RTL page

{{% columns %}}
## Astris ipse furtiva

Est in vagis et Pittheus tu arge accipiter regia iram vocatur nurus. Omnes ut
olivae sensit **arma sorori** deducit, inesset **crudus**, ego vetuere aliis,
modo arsit? Utinam rapta fiducia valuere litora _adicit cursu_, ad facies

<--->

## Suis quot vota

Ea _furtique_ risere fratres edidit terrae magis. Colla tam mihi tenebat:
miseram excita suadent es pecudes iam. Concilio _quam_ velatus posset ait quod
nunc! Fragosis suae dextra geruntur functus vulgata.
{{% /columns %}}


## Tempora nisi nunc

Lorem **markdownum** emicat gestu. Cannis sol pressit ducta. **Est** Idaei,
tremens ausim se tutaeque, illi ulnis hausit, sed, lumina cutem. Quae avis
sequens!

var panel = ram_design;
if (backup + system) {
file.readPoint = network_native;
sidebar_engine_device(cell_tftp_raster,
dual_login_paper.adf_vci.application_reader_design(
graphicsNvramCdma, lpi_footer_snmp, integer_model));
}

## Locis suis novi cum suoque decidit eadem

Idmoniae ripis, at aves, ali missa adest, ut _et autem_, et ab?
79 changes: 0 additions & 79 deletions exampleSite/content.ru/_index.md

This file was deleted.

11 changes: 6 additions & 5 deletions exampleSite/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ enableGitInfo = true
contentDir = 'content.en'
weight = 1

[languages.ru]
languageName = 'Russian'
contentDir = 'content.ru'
weight = 2

[languages.zh]
languageName = 'Chinese'
contentDir = 'content.zh'
weight = 2

[languages.he]
languageName = 'Hebrew'
contentDir = 'content.he'
languageDirection = 'rtl'
weight = 3

[menu]
Expand Down
9 changes: 5 additions & 4 deletions exampleSite/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ languages:
languageName: English
contentDir: content.en
weight: 1
ru:
languageName: Russian
contentDir: content.ru
weight: 2
zh:
languageName: Chinese
contentDir: content.zh
weight: 2
he:
languageName: Hebrew
contentDir: content.he
languageDirection: rtl
weight: 3

menu:
Expand Down
Loading

0 comments on commit 9dce619

Please sign in to comment.