def slide_path(builder, pagename=None):
    """Calculate the relative path to the Slides for pagename."""

    return builder.get_relative_uri(
        pagename or builder.current_docname,
        os.path.join(
            builder.app.config.slide_relative_path,
            pagename or builder.current_docname,
        ))