Repository: gohugoio/hugo (language: go)

Issue:
OutputFormats via GetPage ignores custom Rel
`.OutputFormats` obtained through `.Site.GetPage` completely ignores the Rel value.

## Example
Part of `config.yaml` config:
```yaml
outputFormats:
  humansTXT:
    name: HUMANS
    mediaType: text/plain
    baseName: humans
    isPlainText: true
    rel: author
```

`<head>...</head>` part of `layouts/_default/baseof.html` template:
```html
<!-- Get 'content/humans.md' with 'outputs: [ HUMANS ]' param -->
{{ with ($.Site.GetPage "humans").OutputFormats.Get "humans" }}
  <link rel="{{ .Rel }}" type="{{ .MediaType.String }}" href="{{ .Permalink }}">
{{ end }}
```

### What did I expect
```html
<link rel="author" type="text/plain" href="http://localhost:1313/humans.txt">
```

### What did I get
```html
<link rel="canonical" type="text/plain" href="http://localhost:1313/humans.txt">
```

## Debug
Here is the content of the structure inside the block:

```html
&page.OutputFormat{Rel:"canonical", Format:output.Format{Name:"HUMANS", MediaType:media.Type{MainType:"text", SubType:"plain", mimeSuffix:"", Delimiter:".", Suffixes:[]string{"txt"}, fileSuffix:""}, Path:"", BaseName:"humans", Rel:"author", Protocol:"", IsPlainText:true, IsHTML:false, NoUgly:false, NotAlternative:false, Permalinkable:false, Weight:0}, relPermalink:"/humans.txt", permalink:"http://localhost:1313/humans.txt"}
```

So, root `.Rel` is `"canonical"`, but `.Format.Rel` is valid `"author"`.

### What version of Hugo are you using (`hugo version`)?
<pre>
) hugo version
Hugo Static Site Generator v0.79.0/extended linux/amd64 BuildDate: unknown
</pre>

### Does this issue reproduce with the latest release?
Yes


Discussion / hints:

Fix patch:
diff --git a/resources/page/page_outputformat.go b/resources/page/page_outputformat.go
index 9eed8241e6d..44f29002517 100644
--- a/resources/page/page_outputformat.go
+++ b/resources/page/page_outputformat.go
@@ -66,8 +66,18 @@ func (o OutputFormat) RelPermalink() string {
 }
 
 func NewOutputFormat(relPermalink, permalink string, isCanonical bool, f output.Format) OutputFormat {
+	isUserConfigured := true
+	for _, d := range output.DefaultFormats {
+		if strings.EqualFold(d.Name, f.Name) {
+			isUserConfigured = false
+		}
+	}
 	rel := f.Rel
-	if isCanonical {
+	// If the output format is the canonical format for the content, we want
+	// to specify this in the "rel" attribute of an HTML "link" element.
+	// However, for custom output formats, we don't want to surprise users by
+	// overwriting "rel"
+	if isCanonical && !isUserConfigured {
 		rel = "canonical"
 	}
 	return OutputFormat{Rel: rel, Format: f, relPermalink: relPermalink, permalink: permalink}


Test patch:
diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go
index f3455f3692c..815625ff10d 100644
--- a/hugolib/site_output_test.go
+++ b/hugolib/site_output_test.go
@@ -324,6 +324,36 @@ baseName = "customdelimbase"
 	c.Assert(outputs.Get("CUS").RelPermalink(), qt.Equals, "/blog/customdelimbase_del")
 }
 
+// Issue 8030
+func TestGetOutputFormatRel(t *testing.T) {
+	b := newTestSitesBuilder(t).
+		WithSimpleConfigFileAndSettings(map[string]interface{}{
+			"outputFormats": map[string]interface{}{
+				"humansTXT": map[string]interface{}{
+					"name":        "HUMANS",
+					"mediaType":   "text/plain",
+					"baseName":    "humans",
+					"isPlainText": true,
+					"rel":         "author",
+				},
+			},
+		}).WithTemplates("index.html", `
+{{- with ($.Site.GetPage "humans").OutputFormats.Get "humans" -}}
+<link rel="{{ .Rel }}" type="{{ .MediaType.String }}" href="{{ .Permalink }}">
+{{- end -}}
+`).WithContent("humans.md", `---
+outputs:
+- HUMANS
+---
+This is my content.
+`)
+
+	b.Build(BuildCfg{})
+	b.AssertFileContent("public/index.html", `
+<link rel="author" type="text/plain" href="/humans.txt">
+`)
+}
+
 func TestCreateSiteOutputFormats(t *testing.T) {
 	t.Run("Basic", func(t *testing.T) {
 		c := qt.New(t)