Skip to content

rs_server_catalog/landing_page.md

<< Back to index

Contains all functions for the landing page.

add the CATALOG_PREFIX if it is not present

Parameters:

Name Type Description Default
content dict

the landing page

required
url str

the url

required
Source code in docs/rs-server/services/catalog/rs_server_catalog/landing_page.py
21
22
23
24
25
26
27
28
29
30
31
32
33
def add_prefix_link_landing_page(content: dict, url: str):
    """add the CATALOG_PREFIX if it is not present

    Args:
        content (dict): the landing page
        url (str): the url
    """
    for link in content["links"]:
        if "href" in link and CATALOG_PREFIX not in link["href"]:
            href = link["href"]
            url_size = len(url)
            link["href"] = href[:url_size] + CATALOG_PREFIX + href[url_size:]
    return content