Skip to content

Commit 06726e8

Browse files
Add OOP Introduction
1 parent 0a70b81 commit 06726e8

File tree

6 files changed

+39
-32
lines changed

6 files changed

+39
-32
lines changed
File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# OOP Introduction
2+
3+
This is a scripting tutorial explaining to you what object orientated programming is and teaching you how to use the OOP features of MTA.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
title: "OOP Introduction"
2+
content: "article.md"
3+
author: "multitheftauto"
4+
date: "January 1, 2025"
5+
assets: []

web/scripts/builder.py

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -445,28 +445,6 @@ def create_category(self, web_path, category_data):
445445

446446
self.logger.info(f"Generated {output_path} for category {category_name}")
447447

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-
470448
def create_pages(self):
471449
self.navigation = [
472450
{
@@ -478,25 +456,25 @@ def create_pages(self):
478456
},
479457
},
480458
{
481-
'name': 'Guides',
459+
'name': 'Articles',
482460
'subitems': [
483461
{
484-
'name': 'Official guides',
485-
'path_html': '/guides/official',
462+
'name': 'Official articles',
463+
'path_html': '/official',
486464
'category': {
487-
'name': 'Official guides',
465+
'name': 'Official articles',
488466
'articles': {
489-
'path': 'official-guides',
467+
'path': 'official',
490468
},
491469
},
492470
},
493471
{
494-
'name': 'Community guides',
495-
'path_html': '/guides/community',
472+
'name': 'Community articles',
473+
'path_html': '/community',
496474
'category': {
497-
'name': 'Community guides',
475+
'name': 'Community articles',
498476
'articles': {
499-
'path': 'community-guides',
477+
'path': 'community',
500478
},
501479
},
502480
},
@@ -602,7 +580,28 @@ def create_item(item):
602580
for function in self.functions:
603581
self.create_function_page(function)
604582

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']}")
606605

607606
def copy_assets(self):
608607

0 commit comments

Comments
 (0)