hugo/docs/content/en/methods/page/BundleType.md
Bjørn Erik Pedersen 5fd1e74903
Merge commit '9b0050e9aabe4be65c78ccf292a348f309d50ccd' as 'docs'
```
git subtree add --prefix=docs/ https://github.com/gohugoio/hugoDocs.git master --squash
```

Closes #11925
2024-01-27 10:48:57 +01:00

1.2 KiB

title description categories keywords action
BundleType Returns the bundle type of the given page, or an empty string if the page is not a page bundle.
related returnType signatures
files.ContentClass
PAGE.BundleType

A page bundle is a directory that encapsulates both content and associated resources. There are two types of page bundles: leaf bundles and branch bundles. See details.

The BundleType method on a Page object returns branch for branch bundles, leaf for leaf bundles, and an empty string if the page is not a page bundle.

content/
├── films/
│   ├── film-1/
│   │   ├── a.jpg
│   │   └── index.md  <-- leaf bundle
│   ├── _index.md     <-- branch bundle
│   ├── b.jpg
│   ├── film-2.md
│   └── film-3.md
└── _index.md         <-- branch bundle

To get the value within a template:

{{ .BundleType }}