Skip to content

Commit

Permalink
docs: additional shortcodes (#441)
Browse files Browse the repository at this point in the history
* Create pdf.md

* Update pdf.md

* Escape PDF shortcode examples

* Remove markdown syntax highlight

* chore: update Hugo and Go versions for deployment

* docs: add additional shortcodes

* chore: re-compile

---------

Co-authored-by: Shahar Naveh <[email protected]>
  • Loading branch information
imfing and ShaharNaveh authored Aug 18, 2024
1 parent 526be88 commit 66d2bf5
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 17 deletions.
2 changes: 1 addition & 1 deletion assets/css/compiled/main.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
! tailwindcss v3.4.9 | MIT License | https://tailwindcss.com
! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com
*//*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
Expand Down
6 changes: 3 additions & 3 deletions exampleSite/content/docs/guide/deploy-site.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.121.2
HUGO_VERSION: 0.131.0
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -64,7 +64,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version: '1.22'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
Expand Down Expand Up @@ -146,7 +146,7 @@ For more details, check out:
3. If you are not using [hextra-starter-template][hextra-starter-template], configure the following manually:
- Configure the Build command to `hugo --gc --minify`
- Specify the Publish directory to `public`
- Add Environment variable `HUGO_VERSION` and set to `0.119.0`
- Add Environment variable `HUGO_VERSION` and set to `0.132.2`
4. Deploy!

Check [Hugo on Netlify](https://docs.netlify.com/integrations/frameworks/hugo/) for more details.
Expand Down
9 changes: 8 additions & 1 deletion exampleSite/content/docs/guide/shortcodes/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ next: /docs/guide/shortcodes/callout

Hextra provides a collection of beautiful shortcodes to enhance your content.


{{< cards >}}
{{< card link="callout" title="Callout" icon="warning" >}}
{{< card link="cards" title="Cards" icon="card" >}}
Expand All @@ -19,3 +18,11 @@ Hextra provides a collection of beautiful shortcodes to enhance your content.
{{< card link="steps" title="Steps" icon="one" >}}
{{< card link="tabs" title="Tabs" icon="collection" >}}
{{< /cards >}}

<div style="padding-top:4rem"></div>

Additional shortcodes provided by Hugo and Hextra:

{{< cards >}}
{{< card link="others" title="Others" icon="view-grid" >}}
{{< /cards >}}
43 changes: 43 additions & 0 deletions exampleSite/content/docs/guide/shortcodes/others.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Other Shortcodes
linkTitle: Others
sidebar:
exclude: true
---

{{< callout emoji="ℹ️" >}}
Some of these are Hugo built-in shortcodes.
These shortcodes are considered less stable and may be changed anytime.
{{< /callout >}}

## YouTube

Embed a YouTube video.

```
{{</* youtube VIDEO_ID */>}}
```

Result:

{{< youtube id=dQw4w9WgXcQ loading=lazy >}}

For more information, see [Hugo's YouTube Shortcode](https://gohugo.io/content-management/shortcodes/#youtube).

## PDF

With PDF shortcode, you can embed a PDF file in your content.

```
{{</* pdf "https://example.com/sample.pdf" */>}}
```

You can also place the PDF file in your project directory and use the relative path.

```
{{</* pdf "path/to/file.pdf" */>}}
```

Example:

{{< pdf "https://upload.wikimedia.org/wikipedia/commons/1/13/Example.pdf" >}}
2 changes: 2 additions & 0 deletions exampleSite/hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"head",
"hr",
"html",
"iframe",
"img",
"input",
"kbd",
Expand Down Expand Up @@ -221,6 +222,7 @@
"hextra-filetree",
"hextra-filetree-folder",
"hextra-footer",
"hextra-pdf",
"hextra-scrollbar",
"hextra-sidebar-collapsible-button",
"hextra-tabs-panel",
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 66d2bf5

Please sign in to comment.