@@ -445,28 +445,6 @@ def create_category(self, web_path, category_data):
445
445
446
446
self .logger .info (f"Generated { output_path } for category { category_name } " )
447
447
448
- def create_misc_pages (self ):
449
-
450
- # Predefined articles
451
- self .create_article ('privacy' )
452
-
453
- other_pages = [
454
- {
455
- 'path_html' : '404.html' ,
456
- 'template' : '404.html' ,
457
- },
458
- ]
459
-
460
- for page in other_pages :
461
- template = self .input_env .get_template (page ['template' ])
462
- html_content = self .render_page (page ['path_html' ], template .render ())
463
-
464
- output_path = os .path .join (OUTPUT_HTML_PATH , page ['path_html' ])
465
- with open (output_path , 'w' ) as html_file :
466
- html_file .write (html_content )
467
-
468
- self .logger .info (f"Generated { output_path } for { page ['path_html' ]} " )
469
-
470
448
def create_pages (self ):
471
449
self .navigation = [
472
450
{
@@ -478,25 +456,25 @@ def create_pages(self):
478
456
},
479
457
},
480
458
{
481
- 'name' : 'Guides ' ,
459
+ 'name' : 'Articles ' ,
482
460
'subitems' : [
483
461
{
484
- 'name' : 'Official guides ' ,
485
- 'path_html' : '/guides/ official' ,
462
+ 'name' : 'Official articles ' ,
463
+ 'path_html' : '/official' ,
486
464
'category' : {
487
- 'name' : 'Official guides ' ,
465
+ 'name' : 'Official articles ' ,
488
466
'articles' : {
489
- 'path' : 'official-guides ' ,
467
+ 'path' : 'official' ,
490
468
},
491
469
},
492
470
},
493
471
{
494
- 'name' : 'Community guides ' ,
495
- 'path_html' : '/guides/ community' ,
472
+ 'name' : 'Community articles ' ,
473
+ 'path_html' : '/community' ,
496
474
'category' : {
497
- 'name' : 'Community guides ' ,
475
+ 'name' : 'Community articles ' ,
498
476
'articles' : {
499
- 'path' : 'community-guides ' ,
477
+ 'path' : 'community' ,
500
478
},
501
479
},
502
480
},
@@ -602,7 +580,28 @@ def create_item(item):
602
580
for function in self .functions :
603
581
self .create_function_page (function )
604
582
605
- self .create_misc_pages ()
583
+
584
+ # Other types of articles
585
+ self .create_article ('privacy' )
586
+
587
+ # Official articles
588
+ self .create_article ('OOP_Introduction' , 'official' )
589
+
590
+ other_pages = [
591
+ {
592
+ 'path_html' : '404.html' ,
593
+ 'template' : '404.html' ,
594
+ },
595
+ ]
596
+ for page in other_pages :
597
+ template = self .input_env .get_template (page ['template' ])
598
+ html_content = self .render_page (page ['path_html' ], template .render ())
599
+
600
+ output_path = os .path .join (OUTPUT_HTML_PATH , page ['path_html' ])
601
+ with open (output_path , 'w' ) as html_file :
602
+ html_file .write (html_content )
603
+
604
+ self .logger .info (f"Generated { output_path } for { page ['path_html' ]} " )
606
605
607
606
def copy_assets (self ):
608
607
0 commit comments