Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{ $tpl := printf "print/content-%s.html" .Page.Type }}

{{ if templates.Exists (printf "partials/%s" $tpl) }}
{{ if templates.Exists (printf "_partials/%s" $tpl) }}
{{ partial $tpl . }}
{{ else -}}
{{ $break := cond .DoPageBreak "page-break-before: always" "" -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/* Use the title and description of the first page to begin the document */}}

{{ $tpl := printf "print/page-heading-%s.html" .Page.Type }}
{{ if templates.Exists (printf "partials/%s" $tpl) }}
{{ if templates.Exists (printf "_partials/%s" $tpl) }}
{{ partial $tpl . }}
{{ else -}}
<h1 class="title">{{ .Title }}</h1>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $tpl := printf "print/toc-li-%s.html" .Page.Type }}
{{ if templates.Exists (printf "partials/%s" $tpl) }}
{{ if templates.Exists (printf "_partials/%s" $tpl) }}
{{ partial $tpl . }}
{{ else -}}
<li>{{ .sid}}: <a href="#pg-{{.Page.File.UniqueID}}">{{ .Page.Title }}</a></li>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
{{ partial "td/heading-self-link.html" . -}}
</h{{ .Level }}>

{{- define "partials/td/heading-self-link.html" -}}
{{- define "_partials/td/heading-self-link.html" -}}
<a class="td-heading-self-link" href="#{{ .Anchor | safeURL }}" aria-label="Heading self-link"></a>
{{- end -}}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions userguide/content/en/docs/adding-content/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ using the first of the following that is defined:
- For non-index pages, the page [summary][], as computed by Hugo
- The site description taken from the [site `params`][]

For the template code used to perform this computation, see
[layouts/partials/page-description.html][].
For the code used to perform this computation, see [page-description.html].

Add more meta tags as needed to your project's copy of the `head-end.html`
partial. For details, see
Expand All @@ -308,8 +307,8 @@ partial. For details, see
[gtag.js]: https://support.google.com/analytics/answer/10220869
[hugo-ga]: https://gohugo.io/templates/internal/#google-analytics
[internal templates]: https://gohugo.io/templates/internal/
[layouts/partials/page-description.html]:
https://github.com/google/docsy/blob/main/layouts/partials/page-description.html
[page-description.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/page-description.html
[site `params`]: https://gohugo.io/variables/site/#the-siteparams-variable
[summary]: https://gohugo.io/content-management/summaries/
[configure]: #setup-1
Expand Down
2 changes: 1 addition & 1 deletion userguide/content/en/docs/adding-content/iconsimages.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ favicons you can use this site to generate them, then use Icongen to create more
sizes (if necessary) from your generated `.png` file.

If you have special favicon requirements, you can create your own
`layouts/partials/favicons.html` with your links.
`layouts/_partials/favicons.html` with your links.

## Add images

Expand Down
34 changes: 14 additions & 20 deletions userguide/content/en/docs/adding-content/lookandfeel.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,28 +484,22 @@ this:
### Add code to head or before body end

If you need to add some code (CSS import, cookie consent, or similar) to the
`head` section on every page, add the `head-end.html` partial to your project:

```
layouts/partials/hooks/head-end.html
```

And add the code you need in that file. Your partial code is automatically
included just before the end of the theme partial
[`head.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html).
The theme version of
[`head-end.html`](https://github.com/google/docsy/blob/main/layouts/partials/hooks/head-end.html)
is empty.
`head` section on every page, add a [hooks/head-end.html] partial to your
project (the theme version is an empty placeholder). The content of this partial
is automatically included just before the end of the theme partial [head.html].

Similarly, if you want to add some code right before the `body` end, create your
own version of the following file:

```
layouts/partials/hooks/body-end.html
```

Any code in this file is included automatically at the end of the theme partial
[`scripts.html`](https://github.com/google/docsy/blob/main/layouts/partials/head.html).
own version of [hooks/body-end.html]. This partial is included automatically at
the end of the theme partial [scripts.html].

[head.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/head.html
[hooks/body-end.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/hooks/body-end.html
[hooks/head-end.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/hooks/head-end.html
[scripts.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/head.html

Both `head.html` and `scripts.html` are then used to build Docsy's
[base page layout](https://github.com/google/docsy/blob/main/layouts/_default/baseof.html),
Expand Down
6 changes: 3 additions & 3 deletions userguide/content/en/docs/adding-content/navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,10 +459,10 @@ defaults:

Your projects can also reuse (in your own custom heading render hook) or
override the heading self-link partial `td/heading-self-link.html`, which is
defined in [layouts/partials/td/render-heading.html].
defined in [layouts/_partials/td/render-heading.html].

[configuration file]:
https://gohugo.io/getting-started/configuration/#configuration-file
[layouts/partials/td/render-heading.html]:
https://github.com/google/docsy/tree/main/layouts/partials/td/render-heading.html
[layouts/_partials/td/render-heading.html]:
https://github.com/google/docsy/tree/main/layouts/_partials/td/render-heading.html
[hook]: https://gohugo.io/templates/render-hooks/
6 changes: 3 additions & 3 deletions userguide/content/en/docs/adding-content/print.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ params:
## Layout hooks

A number of layout partials and hooks are defined that can be used to customize
the printed format. These can be found in `layouts/partials/print`.
the printed format. These can be found in `layouts/_partials/print`.

Hooks can be defined on a per-type basis. For example, you may want to customize
the layouts of heading for "blog" pages vs "docs". This can be achieved by
creating `layouts/partials/print/page-heading-<type>.html` - eg.
creating `layouts/_partials/print/page-heading-<type>.html` such as
`page-heading-blog.html`. It defaults to using the page title and description as
a heading.

Similarly, the formatting for each page can be customized by creating
`layouts/partials/print/content-<type>.html`.
`layouts/_partials/print/content-<type>.html`.
10 changes: 5 additions & 5 deletions userguide/content/en/docs/adding-content/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ search results page.
You can customize or disable Docsy's default Algolia support by creating the
following template files:

- `layouts/partials/algolia/head.html` used by `head.html` to load Algolia
- `layouts/_partials/algolia/head.html` used by `head.html` to load Algolia
DocSearch styles. It also issues a deprecation warning for
`params.algolia_docsearch`.
- `layouts/partials/algolia/scripts.html` used by `scripts.html` to load and
- `layouts/_partials/algolia/scripts.html` used by `scripts.html` to load and
configure Algolia DocSearch.

Leave either file empty to disable Docsy's implementation.
Expand Down Expand Up @@ -414,7 +414,7 @@ If none of the supported search engines address your project's needs, you can
implement your own custom search. If your searchbox fits within Docsy's standard
design, then you can implement custom search by overriding the following files:

- [layouts/partials/search-input.html]
- [layouts/_partials/search-input.html]
- [assets/scss/_search.scss]
- [assets/js/search.js]

Expand All @@ -426,5 +426,5 @@ design, then you can implement custom search by overriding the following files:
[configuration file]:
https://gohugo.io/getting-started/configuration/#configuration-file
[GCSE]: https://cse.google.com/cse/all
[layouts/partials/search-input.html]:
https://github.com/google/docsy/blob/main/layouts/partials/search-input.html
[layouts/_partials/search-input.html]:
https://github.com/google/docsy/blob/main/layouts/_partials/search-input.html