File tree Expand file tree Collapse file tree 4 files changed +110
-1
lines changed Expand file tree Collapse file tree 4 files changed +110
-1
lines changed Original file line number Diff line number Diff line change 24
24
25
25
< body >
26
26
< div class ="wrapper {{'decorated' if active_section == 'home'}} ">
27
+ {% block top_bar %}
27
28
< header class ="top-bar ">
28
29
< div class ="logo ">
29
30
< a href ="{{ url_for('frontend_handlers.index') }} " aria-label ="Home page ">
63
64
</ li >
64
65
</ ul >
65
66
</ header >
67
+ {% endblock %}
66
68
{% block content %}{% endblock %}
67
69
</ div >
68
70
< link href ="https://fonts.googleapis.com/css?family=Material+Icons&display=block " rel ="stylesheet ">
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ $osv-accent-color-hover: #c5221fb2;
7
7
$osv-red-300 : #ec928e ;
8
8
$osv-grey-600 : #80868b ;
9
9
$osv-grey-800 : #3C4043 ;
10
+ $osv-cyan-300 : #C9F5F7 ;
10
11
$osv-body-font-family : string .unquote (' Overpass, sans-serif' );
11
12
$osv-heading-font-family : string .unquote (' "Overpass Mono", monospace' );
12
13
$osv-heading-size : 60px ;
@@ -1271,7 +1272,7 @@ div.highlight {
1271
1272
}
1272
1273
1273
1274
a {
1274
- color : #C9F5F7
1275
+ color : $osv-cyan-300
1275
1276
}
1276
1277
1277
1278
.author {
@@ -1289,4 +1290,79 @@ div.highlight {
1289
1290
margin : 0 auto ;
1290
1291
font-size : 16px ;
1291
1292
}
1293
+ }
1294
+
1295
+ /* * 404 page */
1296
+ .not-found-page {
1297
+ height : 100% ;
1298
+ margin : 0 ;
1299
+ align-items : center ;
1300
+ justify-content : center ;
1301
+ font-family : $osv-heading-font-family ;
1302
+ color : $osv-text-color ;
1303
+ font-size : 15px ;
1304
+ max-width : 1200px ;
1305
+ margin : 0 auto ;
1306
+
1307
+ .mdc-layout-grid__cell--span-12 {
1308
+ margin : 0 24px ;
1309
+ }
1310
+
1311
+ .text-info {
1312
+ max-width : 900px ;
1313
+ margin : 20px auto 0 ;
1314
+
1315
+ .heading {
1316
+ font-size : $osv-heading-size ;
1317
+ text-align : center ;
1318
+ margin-bottom : 32px ;
1319
+ }
1320
+
1321
+ @media (max-width : $osv-mobile-breakpoint ) {
1322
+ .heading {
1323
+ font-size : $osv-heading-size-mobile ;
1324
+ }
1325
+ }
1326
+
1327
+ .description {
1328
+ font-size : 20px ;
1329
+ line-height : 26px ;
1330
+ margin-bottom : 24px ;
1331
+ margin-left : 8px ;
1332
+ margin-right : 8px ;
1333
+ text-align : center ;
1334
+ }
1335
+
1336
+ .cta {
1337
+ margin : 32px 0 ;
1338
+ display : flex ;
1339
+ flex-wrap : wrap ;
1340
+ justify-content : center ;
1341
+ gap : 4px ;
1342
+ }
1343
+
1344
+ h2 ,h3 ,h4 {
1345
+ line-height : 1.1 ;
1346
+ font-weight : 300 ;
1347
+ margin-top : 3rem ;
1348
+ margin-bottom : 1.5rem ;
1349
+ }
1350
+
1351
+ p {
1352
+ margin-bottom : 16px ;
1353
+ line-height : 1.6 ;
1354
+ }
1355
+
1356
+ a {
1357
+ color : $osv-cyan-300 ;
1358
+ }
1359
+ }
1360
+
1361
+ footer {
1362
+ background : url (' /static/img/footer-decoration.png' );
1363
+ background-repeat : no-repeat ;
1364
+ background-position : center ;
1365
+ min-height : 500px ;
1366
+ width : 100% ;
1367
+ }
1292
1368
}
Original file line number Diff line number Diff line change
1
+ {% extends 'base.html' %}
2
+
3
+ {% block top_bar %} {% endblock %}
4
+
5
+ {% block content %}
6
+ < div class ="mdc-layout-grid not-found-page ">
7
+ < div class ="mdc-layout-grid__inner ">
8
+ < div class ="mdc-layout-grid__cell--span-12 text-info ">
9
+ < h2 class ="heading "> Oops! Page Not Found!</ h2 >
10
+ < p class ="description ">
11
+ While you're here, why not check out our
12
+ < a href ="https://google.github.io/osv.dev/ "> documentation</ a > or
13
+ < a href ="https://google.github.io/osv.dev/faq/ "> FAQ</ a > ?
14
+ </ p >
15
+ < div class ="cta ">
16
+ < a class ="cta-primary link-button " href ="{{ url_for('frontend_handlers.index') }} "
17
+ aria-label ="Get me back Home! "> Back to Home</ a >
18
+ </ div >
19
+ </ div >
20
+ </ div >
21
+ < footer > </ footer >
22
+ </ div >
23
+ {% endblock %}
Original file line number Diff line number Diff line change 17
17
import os
18
18
import math
19
19
import re
20
+ import logging
20
21
21
22
from flask import abort
22
23
from flask import current_app
38
39
import rate_limiter
39
40
import source_mapper
40
41
import utils
42
+ from werkzeug import exceptions
41
43
42
44
blueprint = Blueprint ('frontend_handlers' , __name__ )
43
45
@@ -590,3 +592,9 @@ def list_packages(vuln_affected: list[dict]):
590
592
packages .append (parsed_scheme )
591
593
592
594
return packages
595
+
596
+
597
+ @blueprint .app_errorhandler (404 )
598
+ def not_found_error (error : exceptions .HTTPException ):
599
+ logging .info ('Handled %s - Path attempted: %s' , error , request .path )
600
+ return render_template ('404.html' ), 404
You can’t perform that action at this time.
0 commit comments