mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Merge commit 'eb16165694f868d73e57b6aed5c26ba5e98229de'
This commit is contained in:
@@ -48,7 +48,7 @@ You can then call the shortcode as follows inside of your content's markup:
|
||||
|
||||
The above shortcode [is part of the code for the Hugo docs][dirindex]. Here it lists this site's CSS files:
|
||||
|
||||
{{< directoryindex path="/themes/gohugoioTheme/static/dist" pathURL="/css" >}}
|
||||
{{< directoryindex path="/themes/gohugoioTheme/static" pathURL="/css" >}}
|
||||
|
||||
{{% note "Slashes are Important" %}}
|
||||
The initial slash `/` in `pathURL` is important in the `directoryindex` shortcode. Otherwise, `pathURL` becomes relative to the current web page.
|
||||
|
@@ -60,6 +60,10 @@ All partials are called within your templates using the following pattern:
|
||||
One of the most common mistakes with new Hugo users is failing to pass a context to the partial call. In the pattern above, note how "the dot" (`.`) is required as the second argument to give the partial context. You can read more about "the dot" in the [Hugo templating introduction](/templates/introduction/).
|
||||
{{% /note %}}
|
||||
|
||||
{{% note %}}
|
||||
`<PARTIAL>` including `baseof` is reserved. ([#5373](https://github.com/gohugoio/hugo/issues/5373))
|
||||
{{% /note %}}
|
||||
|
||||
As shown in the above example directory structure, you can nest your directories within `partials` for better source organization. You only need to call the nested partial's path relative to the `partials` directory:
|
||||
|
||||
```
|
||||
|
Reference in New Issue
Block a user