File tree Expand file tree Collapse file tree 5 files changed +106
-1
lines changed Expand file tree Collapse file tree 5 files changed +106
-1
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ $mobile-breakpoint: 740px;
30
30
@import ' styles/keywords' ;
31
31
@import ' styles/layout' ;
32
32
@import ' styles/maintainer_info' ;
33
+ @import ' styles/maintenance' ;
33
34
@import ' styles/markdown' ;
34
35
@import ' styles/matrix' ;
35
36
@import ' styles/modal_panel' ;
Original file line number Diff line number Diff line change
1
+ // Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ // -------------------------------------------------------------------------
16
+ // Site maintenance page, set by HOMEPAGE_INTERSTITIAL in the environment.
17
+ // -------------------------------------------------------------------------
18
+
19
+ body .maintenance {
20
+ main {
21
+ display : flex ;
22
+ align-items : center ;
23
+ min-height : 500px ;
24
+ text-align : center ;
25
+
26
+ h1 {
27
+ padding-top : 50px ;
28
+ font-size : 30px ;
29
+ background-position : top center ;
30
+ background-repeat : no-repeat ;
31
+ background-size : 40px ;
32
+ background-image : var (--image-warning );
33
+ }
34
+ }
35
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import Foundation
16
+ import Ink
17
+
18
+ enum MaintenanceIndex {
19
+
20
+ struct Model {
21
+
22
+ var markdown : String
23
+ var html : String
24
+
25
+ init ( markdown: String ) {
26
+ self . markdown = markdown
27
+ self . html = MarkdownParser ( ) . parse ( markdown) . html
28
+ }
29
+
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright Dave Verwer, Sven A. Schmidt, and other contributors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ import Foundation
16
+ import Plot
17
+
18
+ extension MaintenanceIndex {
19
+
20
+ class View : PublicPage {
21
+
22
+ let model : Model
23
+
24
+ init ( path: String , model: Model ) {
25
+ self . model = model
26
+ super. init ( path: path)
27
+ }
28
+
29
+ override func bodyClass( ) -> String ? {
30
+ " maintenance "
31
+ }
32
+
33
+ override func content( ) -> Node < HTML . BodyContext > {
34
+ . raw( model. html)
35
+ }
36
+ }
37
+ }
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ func routes(_ app: Application) throws {
24
24
do { // home page
25
25
app. get { req in
26
26
if let interstitial = Current . homepageInterstitial ( ) {
27
- return MarkdownPage ( path: req. url. path, markdown: interstitial) . document ( )
27
+ let model = MaintenanceIndex . Model ( markdown: interstitial)
28
+ return MaintenanceIndex . View ( path: req. url. path, model: model) . document ( )
28
29
} else {
29
30
let model = try await HomeIndex . Model. query ( database: req. db)
30
31
return HomeIndex . View ( path: req. url. path, model: model) . document ( )
You can’t perform that action at this time.
0 commit comments