mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
d3c4fdb8ff
In page.NewOutputFormat, we take an output.Format f and use it to create a page.OutputFormat. If the format is canonical, we assign the final OutputFormat's Rel to "canonical" rather than using f.Rel. However, this leads to unexpected behavior for custom output formats, where a user can define a "rel" for a format via the config file. For example, the standard for "humans.txt" files requires using rel="author" in HTML "link" elements. Meanwhile, humans.txt is usually the only format used for its content. As a result, for Hugo configurations that define a humans.txt custom output format, Hugo will render "link" elements to content in this format with rel="canonical," rather than "author" as required by the standard. This commit changes page.NewOutputFormat to check whether a given format is user defined and, if so, skips assigning Rel to "canonical," even if isCanonical is true. Fixes #8030 |
||
---|---|---|
.. | ||
images | ||
internal | ||
jsconfig | ||
page | ||
postpub | ||
resource | ||
resource_factories | ||
resource_transformers | ||
testdata | ||
errorResource.go | ||
image.go | ||
image_cache.go | ||
image_extended_test.go | ||
image_test.go | ||
post_publish.go | ||
resource.go | ||
resource_cache.go | ||
resource_cache_test.go | ||
resource_metadata.go | ||
resource_metadata_test.go | ||
resource_spec.go | ||
resource_test.go | ||
testhelpers_test.go | ||
transform.go | ||
transform_test.go |