File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ public struct EnvironmentValues {
105105 site: any Site ,
106106 allContent: [ Article ] ,
107107 pageMetadata: PageMetadata ,
108- pageContent: any LayoutContent
108+ pageContent: any LayoutContent ,
109+ httpError: HTTPError = EmptyHTTPError ( )
109110 ) {
110111 self . decode = DecodeAction ( sourceDirectory: sourceDirectory)
111112 self . articles = ArticleLoader ( content: allContent)
@@ -117,6 +118,7 @@ public struct EnvironmentValues {
117118 self . builtInIconsEnabled = site. builtInIconsEnabled
118119 self . timeZone = site. timeZone
119120 self . page = pageMetadata
121+ self . httpError = httpError
120122
121123 self . site = SiteMetadata (
122124 name: site. name,
Original file line number Diff line number Diff line change @@ -138,8 +138,6 @@ extension PublishingContext {
138138 if site. errorPage is EmptyErrorPage { return }
139139
140140 for error in [ PageNotFoundError ( ) ] {
141- environment. httpError = error
142-
143141 let metadata = PageMetadata (
144142 title: site. errorPage. title,
145143 description: site. errorPage. description,
@@ -151,7 +149,9 @@ extension PublishingContext {
151149 site: site,
152150 allContent: allContent,
153151 pageMetadata: metadata,
154- pageContent: site. errorPage)
152+ pageContent: site. errorPage,
153+ httpError: error
154+ )
155155
156156 let outputString = withEnvironment ( values) {
157157 site. errorPage. layout. body. render ( )
You can’t perform that action at this time.
0 commit comments