Skip to content

Commit

Permalink
use isMarkdown to make sure markdown is formated
Browse files Browse the repository at this point in the history
  • Loading branch information
aloxe committed Dec 20, 2024
1 parent 4db0555 commit f5ea50a
Show file tree
Hide file tree
Showing 13 changed files with 48 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/_assets/public/admin/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ collections:
name: "layout"
widget: "hidden"
default: "base"
- label: "isMarkdown"
name: "isMarkdown"
widget: "hidden"
default: true
- label: "Title"
name: "title"
widget: "string"
Expand All @@ -54,6 +58,10 @@ collections:
name: "layout"
widget: "hidden"
default: "base"
- label: "isMarkdown"
name: "isMarkdown"
widget: "hidden"
default: true
- label: "Title"
name: "title"
widget: "string"
Expand Down
2 changes: 2 additions & 0 deletions src/pages/documentation/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ templateEngineOverride: md # for when you have njk in code blocks

This is explained in detail in [Eleventy: Escaping Nunjucks Statements in Markdown Code Blocks](https://markllobrera.com/posts/eleventy-escaping-nunjucks-statements-in-markdown-code-blocks/)

Note that this option is not added in the default pages when they are created by the [CMS](/documentation/cms/).

### Images

Markdown is not known to be flexible with styling images, but you find a workaround for most of your wishes. There is an extensive blog post about the matter in [How to Style Images With Markdown](https://dzone.com/articles/how-to-style-images-with-markdown).
Expand Down
7 changes: 6 additions & 1 deletion src/pages/examples/images/global/cows.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,21 @@
layout: base
title: Cows
subtitle: Yet another example page
ismarkdown: true
---

## Picture of cows

This is an example page with an image of cows. The image file is not a global file but it is located higher in the section of the current page.

It can be used with the path from the root of pages but will not be able to be used on other sections.

`![drooderfiets and cows](/examples/cows.jpg)`
```markdown
![drooderfiets and cows](/examples/cows.jpg)
```

Also it will not be visible in the CMS when editing the current page.


![drooderfiets and cows](/examples/cows.jpg)

5 changes: 4 additions & 1 deletion src/pages/examples/images/global/grasshoper.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ layout: base
title: Grasshoper
subtitle: drooderfiets and grasshopper
description: An example page with a grasshopper from general folder
ismarkdown: true
---
## Picture with a grasshopper

This is an example page with the image of a grasshopper (made of steel) that was uploaded in the global media folder (Uncategorized). The resulting Markdown code is:

`![drooderfiets and grasshopper](/img/grasshopper.jpg)`
```markdown
![drooderfiets and grasshopper](/img/grasshopper.jpg)
```

![drooderfiets and grasshopper](/img/grasshopper.jpg)
8 changes: 6 additions & 2 deletions src/pages/examples/images/global/heron.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ layout: base
title: Heron
subtitle: drooderfiets and heron
description: An example page with a heron from general folder
ismarkdown: true
---
This is an example page with the image of a heron that was uploaded in the global media folder (Uncategorized). The resulting Markdown code is:
## Picture of a heron
This is an example page with the image of a heron that was uploaded in a subfolder of the global media folder (Uncategorized). It is accessible from any page. The resulting Markdown code is:

`![drooderfiets and grasshopper](/img/animals/heron.jpg)`
```markdown
![drooderfiets and grasshopper](/img/animals/heron.jpg)
```

![drooderfiets and grasshopper](/img/animals/heron.jpg)
1 change: 1 addition & 0 deletions src/pages/examples/images/global/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: base
title: Global images
subtitle: Yet another example page
ismarkdown: true
---
This is the head of section global

1 change: 1 addition & 0 deletions src/pages/examples/images/local/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: base
title: Local images
subtitle: Yet another example page
ismarkdown: true
---
## This is section A of Part 1

11 changes: 11 additions & 0 deletions src/pages/examples/images/local/sheep.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@
layout: base
title: Sheep
subtitle: Yet another example page
ismarkdown: true
---
## A picture of sheep

This is an example page with photo of sheep that sits in the same folder as the current page.

It is possible to display the image giving the entire path to the file as bellow.

```markdown
![drooderfiets and sheep](/examples/images/local/sheep.jpg)
```

While this may help you understand where the file is, it is less practical in the CMS as the image will not be visible in the editor. Though it will still display in the page.

![drooderfiets and sheep](/examples/images/local/sheep.jpg)

5 changes: 4 additions & 1 deletion src/pages/examples/images/local/wasps.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
layout: base
title: Wasps
subtitle: Yet another example page
ismarkdown: true
---
## A picture with wasps

This is an example page with a photo of wasps that sits in the same folder as the current page. The resulting Markdown code is:

`![drooderfiets and wasps](wasps.jpg)`
```markdown
![drooderfiets and wasps](wasps.jpg)
```

![drooderfiets and wasps](wasps.jpg)

4 changes: 2 additions & 2 deletions src/pages/examples/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: examples
subtitle: A few pages to show.
title: Examples
subtitle: A few showcase pages.
description: Page with huwindty.
layout: base.njk
---
Expand Down
1 change: 1 addition & 0 deletions src/pages/examples/pages/1st-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: base
title: First page
subtitle: Finally I am not single
ismarkdown: true
---
First Page in Part 2

1 change: 1 addition & 0 deletions src/pages/examples/pages/2nd-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: base
title: Second page
subtitle: Finally I am not single
ismarkdown: true
---
Second Page in Part 2

1 change: 1 addition & 0 deletions src/pages/examples/pages/3rd-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
layout: base
title: Third page
subtitle: Finally I am not single
ismarkdown: true
---
Third Page in Part 2

0 comments on commit f5ea50a

Please sign in to comment.