forked from ros2/ros2_documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add sitemap plugin * Make sitemapindex Signed-off-by: Audrow Nash <[email protected]>
- Loading branch information
Showing
4 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from xml.etree.ElementTree import Element, SubElement, ElementTree | ||
from conf import distro_full_names, html_baseurl | ||
|
||
|
||
def make_sitemapindex(sitemap_file): | ||
|
||
sitemapindex = Element('sitemapindex') | ||
sitemapindex.set('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9') | ||
for distro in distro_full_names.keys(): | ||
node = SubElement(sitemapindex, 'sitemap') | ||
SubElement(node, 'loc').text = f'{html_baseurl}/{distro}/sitemap.xml' | ||
|
||
ElementTree(sitemapindex).write(sitemap_file, encoding='utf-8', xml_declaration=True) | ||
|
||
if __name__ == '__main__': | ||
sitemap_file = 'build/html/sitemap.xml' | ||
make_sitemapindex(sitemap_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ sphinx | |
sphinx-copybutton | ||
sphinx-multiversion | ||
sphinx-rtd-theme | ||
sphinx-sitemap | ||
sphinx-tabs |