MCPcopy Create free account
hub / github.com/bytecodealliance/component-docs / determine_priority

Function determine_priority

scripts/generate_sitemap.py:19–26  ·  view source on GitHub ↗

Determine the priority based on the URL path and specified higher priority section.

(url_path, higher_priority_section)

Source from the content-addressed store, hash-verified

17 yield url
18
19def determine_priority(url_path, higher_priority_section):
20 """Determine the priority based on the URL path and specified higher priority section."""
21 if url_path.count("/") <= 1: # Pages directly under the base URL
22 return "1.0"
23 elif higher_priority_section and url_path.startswith(f"./{higher_priority_section}"): # Pages in the specified higher priority section
24 return "0.8"
25 else:
26 return "0.5" # All other pages
27
28def generate_sitemap(domain, output_path, summary_file_path, higher_priority_section):
29 """Generate a sitemap XML file from SUMMARY.md structure."""

Callers 1

generate_sitemapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…