mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-04-24 20:21:52 +02:00
Merge pull request #1121 from nunocoracao/1115-external-markdown-importer-shortcode
✨ External Markdown Importer Shortcode
This commit is contained in:
commit
ff9839965f
2 changed files with 31 additions and 0 deletions
|
@ -456,6 +456,31 @@ The `where` and `value` values are used in the following query `where .Site.Regu
|
||||||
|
|
||||||
<br/><br/><br/>
|
<br/><br/><br/>
|
||||||
|
|
||||||
|
## Markdown Importer
|
||||||
|
|
||||||
|
This shortcode allows you to import markdown files from external sources. This is useful for including content from other repositories or websites without having to copy and paste the content.
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
| Parameter | Description |
|
||||||
|
| --------- | ------------------------------------------------------- |
|
||||||
|
| `url` | **Required** URL to an externally hosted markdown file. |
|
||||||
|
|
||||||
|
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
|
||||||
|
**Example:**
|
||||||
|
|
||||||
|
```md
|
||||||
|
{{</* mdimporter url="https://raw.githubusercontent.com/nunocoracao/nunocoracao/master/README.md" */>}}
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
{{< mdimporter url="https://raw.githubusercontent.com/nunocoracao/nunocoracao/master/README.md" >}}
|
||||||
|
|
||||||
|
|
||||||
|
<br/><br/>
|
||||||
|
|
||||||
## Mermaid
|
## Mermaid
|
||||||
|
|
||||||
`mermaid` allows you to draw detailed diagrams and visualisations using text. It uses Mermaid under the hood and supports a wide variety of diagrams, charts and other output formats.
|
`mermaid` allows you to draw detailed diagrams and visualisations using text. It uses Mermaid under the hood and supports a wide variety of diagrams, charts and other output formats.
|
||||||
|
|
6
layouts/shortcodes/mdimporter.html
Normal file
6
layouts/shortcodes/mdimporter.html
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{{ $url := .Get "url"}}
|
||||||
|
{{ with resources.GetRemote (printf $url) }}
|
||||||
|
{{ .Content | markdownify }}
|
||||||
|
{{ else }}
|
||||||
|
{{ errorf "Mardown Importer Shortcode - Unable to get remote resource" . }}
|
||||||
|
{{ end }}
|
Loading…
Add table
Reference in a new issue