diff --git a/updates_autogeneration_plugin/plugin.py b/updates_autogeneration_plugin/plugin.py index 2a7a05418fef20eb284671fed67e92fa559b9a2d..6cdc31a7b8638c26a0b2f779fb0eb6b1d0360f55 100644 --- a/updates_autogeneration_plugin/plugin.py +++ b/updates_autogeneration_plugin/plugin.py @@ -11,9 +11,9 @@ from mkdocs.utils import nest_paths from mkdocs.structure.nav import Navigation, Section, Page, \ _get_by_type, _add_parent_links, _data_to_navigation -# Files need to be in YYYYMMDD.md format, on the root of the configured path for autogeneration, -# i.e. updates/c8/20200101.md -FILE_NAME_REGEX = re.compile(r'.+\/(\d*)\.md') +# Files need to be in YYYYMMDD.html format, on the root of the configured path for autogeneration, +# i.e. updates/c8/20200101.html +FILE_NAME_REGEX = re.compile(r'.+\/(\d*)\.html') # Exclude pages like updates/slc6/test/latest_updates/ from having footer links, # previous and next do not make sense here REGEX_EXCLUDE_FOOTER_LINKS = re.compile(r'updates/.+\/.+\/latest_updates\/') @@ -28,12 +28,12 @@ plugins: - AUTOGENERATE_C8_PROD: section_name: Production path: updates/c8/prod/ - # This template will be used for the latest_updates.md final result. It is optional + # This template will be used for the latest_updates.html final result. It is optional template_path: updates/prod.tpl - AUTOGENERATE_C8_TEST: section_name: Testing path: updates/c8/test/ - # This template will be used for the latest_updates.md final result. It is optional + # This template will be used for the latest_updates.html final result. It is optional template_path: updates/test.tpl autogenerate_sitemap: true - search: @@ -92,7 +92,7 @@ class UpdatesAutogenerationPlugin(BasePlugin): # This markdown File has the combined result of all monthly updates, concat in a single file combined_file_path = os.path.join(section_plugin_config['path'], - year_title, month_numeric, "monthly_updates.md") + year_title, month_numeric, "monthly_updates.html") docs_combined_file_path = os.path.join(config['docs_dir'], combined_file_path) if not os.path.exists(os.path.dirname(docs_combined_file_path)): @@ -131,7 +131,7 @@ class UpdatesAutogenerationPlugin(BasePlugin): def build_last_updates(self, section_plugin_config, config, files, file_dates): # This markdown File has the combined result of all monthly updates, concat in a single file - combined_file_path = os.path.join(section_plugin_config['path'], "latest_updates.md") + combined_file_path = os.path.join(section_plugin_config['path'], "latest_updates.html") docs_combined_file_path = os.path.join(config['docs_dir'], combined_file_path) if not os.path.exists(os.path.dirname(docs_combined_file_path)): @@ -220,7 +220,7 @@ class UpdatesAutogenerationPlugin(BasePlugin): nav = Navigation(items, pages) # This markdown File has the sitemap with all pages, even if not present on the nav - sitemap_file_path = os.path.join("sitemap", "index.md") + sitemap_file_path = os.path.join("sitemap", "index.html") docs_sitemap_file_path = os.path.join(config['docs_dir'], sitemap_file_path) if not os.path.exists(os.path.dirname(docs_sitemap_file_path)): try: @@ -236,7 +236,7 @@ class UpdatesAutogenerationPlugin(BasePlugin): return file_sitemap - # After a build, we should regenerate our nav according to the provided .md files. + # After a build, we should regenerate our nav according to the provided .html files. def on_nav(self, nav: Navigation, config: Config, files: Files): # Generate new nav based on the config['nav'] plus autogenerate the specified path nav.items = self._process_nav_items_recursive(nav, self.config, config, files)