mirror of
https://github.com/gohugoio/hugo.git
synced 2025-01-19 00:34:45 +00:00
1f1c62e6c7
Named segments can be defined in `hugo.toml`. * Eeach segment consists of zero or more `exclude` filters and zero or more `include` filters. * Eeach filter consists of one or more field Glob matchers. * Eeach filter in a section (`exclude` or `include`) is ORed together, each matcher in a filter is ANDed together. The current list of fields that can be filtered are: * path as defined in https://gohugo.io/methods/page/path/ * kind * lang * output (output format, e.g. html). It is recommended to put coarse grained filters (e.g. for language and output format) in the excludes section, e.g.: ```toml [segments.segment1] [[segments.segment1.excludes]] lang = "n*" [[segments.segment1.excludes]] no = "en" output = "rss" [[segments.segment1.includes]] term = "{home,term,taxonomy}" [[segments.segment1.includes]] path = "{/docs,/docs/**}" ``` By default, Hugo will render all segments, but you can enable filters by setting the `renderSegments` option or `--renderSegments` flag, e.g: ``` hugo --renderSegments segment1,segment2 ``` For segment `segment1` in the configuration above, this will: * Skip rendering of all languages matching `n*`, e.g. `no`. * Skip rendering of the output format `rss` for the `en` language. * It will render all pages of kind `home`, `term` or `taxonomy` * It will render the `/docs` section and all pages below. Fixes #10106 |
||
---|---|---|
.. | ||
doctree | ||
filesystems | ||
paths | ||
segments | ||
testdata | ||
testsite | ||
404_test.go | ||
alias.go | ||
alias_test.go | ||
breaking_changes_test.go | ||
cascade_test.go | ||
codeowners.go | ||
collections.go | ||
collections_test.go | ||
config.go | ||
config_test.go | ||
configdir_test.go | ||
content_factory.go | ||
content_factory_test.go | ||
content_map.go | ||
content_map_page.go | ||
content_map_test.go | ||
content_render_hooks_test.go | ||
datafiles_test.go | ||
dates_test.go | ||
disableKinds_test.go | ||
embedded_shortcodes_test.go | ||
embedded_templates_test.go | ||
fileInfo.go | ||
fileInfo_test.go | ||
frontmatter_test.go | ||
gitinfo.go | ||
hugo_modules_test.go | ||
hugo_sites.go | ||
hugo_sites_build.go | ||
hugo_sites_build_errors_test.go | ||
hugo_sites_build_test.go | ||
hugo_sites_multihost_test.go | ||
hugo_sites_test.go | ||
hugo_smoke_test.go | ||
hugolib_integration_test.go | ||
image_test.go | ||
integrationtest_builder.go | ||
language_content_dir_test.go | ||
language_test.go | ||
menu_test.go | ||
minify_publisher_test.go | ||
mount_filters_test.go | ||
page.go | ||
page__common.go | ||
page__content.go | ||
page__data.go | ||
page__fragments_test.go | ||
page__menus.go | ||
page__meta.go | ||
page__meta_test.go | ||
page__new.go | ||
page__output.go | ||
page__paginator.go | ||
page__paths.go | ||
page__per_output.go | ||
page__position.go | ||
page__ref.go | ||
page__tree.go | ||
page_kinds.go | ||
page_permalink_test.go | ||
page_test.go | ||
page_unwrap.go | ||
page_unwrap_test.go | ||
pagebundler_test.go | ||
pagecollections.go | ||
pagecollections_test.go | ||
pages_capture.go | ||
pages_language_merge_test.go | ||
pages_test.go | ||
paginator_test.go | ||
params_test.go | ||
permalinker.go | ||
prune_resources.go | ||
rebuild_test.go | ||
rendershortcodes_test.go | ||
renderstring_test.go | ||
resource_chain_test.go | ||
robotstxt_test.go | ||
rss_test.go | ||
securitypolicies_test.go | ||
shortcode.go | ||
shortcode_page.go | ||
shortcode_test.go | ||
site.go | ||
site_benchmark_new_test.go | ||
site_new.go | ||
site_output.go | ||
site_output_test.go | ||
site_render.go | ||
site_sections.go | ||
site_sections_test.go | ||
site_stats_test.go | ||
site_test.go | ||
site_url_test.go | ||
siteJSONEncode_test.go | ||
sitemap_test.go | ||
taxonomy_test.go | ||
template_test.go | ||
testhelpers_test.go |