mirror of
				https://github.com/gohugoio/hugo.git
				synced 2024-05-11 05:54:58 +00:00 
			
		
		
		
	Add custom protocol support in Permalink
This commit is contained in:
		| @@ -52,7 +52,7 @@ func TestDefaultOutputFormats(t *testing.T) { | ||||
| } | ||||
|  | ||||
| func TestSiteWithPageOutputs(t *testing.T) { | ||||
| 	for _, outputs := range [][]string{{"html", "json"}, {"json"}} { | ||||
| 	for _, outputs := range [][]string{{"html", "json", "calendar"}, {"json"}} { | ||||
| 		t.Run(fmt.Sprintf("%v", outputs), func(t *testing.T) { | ||||
| 			doTestSiteWithPageOutputs(t, outputs) | ||||
| 		}) | ||||
| @@ -146,4 +146,12 @@ Output/Rel: {{ .Name -}}/{{ .Rel }}| | ||||
| 	require.Equal(t, "/blog/index.json", json.RelPermalink()) | ||||
| 	require.Equal(t, "http://example.com/blog/index.json", json.Permalink()) | ||||
|  | ||||
| 	if helpers.InStringArray(outputs, "cal") { | ||||
| 		// TODO(bep) output have do some protocil handling for the default too if set. | ||||
| 		cal := of.Get("calendar") | ||||
| 		require.NotNil(t, cal) | ||||
| 		require.Equal(t, "/blog/index.ics", cal.RelPermalink()) | ||||
| 		require.Equal(t, "webcal://example.com/blog/index.ics", cal.Permalink()) | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user