Partials
Hugo partials are bits of reusable content. They’re primarily used for parts of theme files, other HTML (such as layout) files, and within shortcodes.
Partials may exist in the theme for use on all content sites, or in a specific repository, such as the handbook. Many partials are duplicated, sometimes with minor edits, in the handbook projects.
Partials are easy to make, so many have been created without documentation.
If you encounter a partial that is not listed, please look for the merge request that introduced it to ask the creator to document it,
or ask in the #handbook
Slack channel.
Partials as listed in alphabetical order after the theme section.
Theme and layout partials
A lot of the partials are used for the theme, or within the basic layout files. These partials are not documented in detail.
Including:
about-gitlab.html
used inlayouts/job-families
.controlled-document.html
shows the relevant banner on any page with controlled document set to true in frontmatter.footer.html
on all pages.page-meta-lastmod.html
andpage-meta-links.html
for last commit, and view/edit page links.section-index.html
to show the list of subpages if any.gitlab/codeowner(s).html
for showing the “Maintained by” list in the right sidebar.hooks/
folder for any hooks required in the theme.
Math
The math.html
partial is used for the math embed.
Member
These partials are used frequently in shortcodes, other partials, and in Markdown files.
Typically, there is a list of team member slugs, and the partial is used to display a list of team members using one of the partials.
For example, the handbook group-table.html
partial is used to list the members of a product group, which uses the member-
partials.
News related
The internal handbook used to have “news” content, with the latest items featured on the home page.
As the internal communications team no longer uses it, the content was removed and the home page edited to no longer use that partial to display the news items. Howevers, the partials have been kept for the time being.
Including:
company-fyi.html
featured-news.html
Performance indicators
These partials are used for the performance indicator shortcode.
tableau-with-filters
If you’re looking for the Tableau embed, see the Tableau shortcode.
This partial is the primary way for embedding Tableau charts in the handbooks.
It should be used in all shortcodes that need to embed a tableau chart.
It is set up to a named parameters or a data file as the source.
In each shortcode this partial is called a flag must be set, hastableau=true
,
so that the correct JavaScript is applied to the page at the time of construction.
- parameters
url
: (required)- The shareable URL of the view to be embedded
tabs
: (optional defaults to false)- A flag to indicate if other views should be shown as tabs,
true | false
- A flag to indicate if other views should be shown as tabs,
toolbar
: (optional defaults to hidden)- A value to indicate the location, including hidden, of the tool bar as part of the embed.
hidden | top | bottom
- A value to indicate the location, including hidden, of the tool bar as part of the embed.
height
: (optional defaults to 300px)- The fixed height of the embedded view in pixels.
filters
: (optional)- A list of filters and values (key value pairs) to filter the view by.
When passing the chart data directly filter fields and their values should be separated by an equal symbol,
=
, and subsequent fields should be separated with a double pipe symbol,||
, and if multiple values are used in a single filter the values should be separated by a comma symbol,
.
- A list of filters and values (key value pairs) to filter the view by.
When passing the chart data directly filter fields and their values should be separated by an equal symbol,
parameters
: (optional)- A list of parameters and values (key value pairs) to set in the view.
When passing the chart data directly parameter names and their values should be separated by an equal symbol,
=
, and subsequent parameters should be separated with a double pipe symbol,||
.
- A list of parameters and values (key value pairs) to set in the view.
When passing the chart data directly parameter names and their values should be separated by an equal symbol,
When referencing the chart data directly
{{ .Page.Store.Set "hastableau" true -}}
// shortcode content
{{ partial "tableau-with-filters" url="url" tabs="true" toolbar="top" height="200px" filters="field=value||field=value,value,value" parameters="name=value||name=value" }}
When using a data file for the chart data.
{{ .Page.Store.Set "hastableau" true -}}
// shortcode content that gets chart information from a data file
{{- with .tableau_data }}
{{- range .charts }}
{{- partial "tableau-with-filters" . }}
{{- end }}
{{- end }}