@register.tag
def render_page(parser, token):
    token_items = token.split_contents()
    # The first item is necessarily the tag name
    tag_name = token_items[0]
    layout_name = None
    # One argument (optional) ==> name of layout
    if len(token_items) == 2:
        layout_name = token_items[1]
        if not (layout_name[0] == layout_name[-1] and layout_name[0] in ('"', "'")):
            raise template.TemplateSyntaxError("%r tag's argument should be in quotes" % tag_name)
    # Too much arguments
    elif len(token_items) > 2:
        raise template.TemplateSyntaxError(
            "%r tag accept only one optional argument" % tag_name)
    # Make layout slug rendering
    layout_slug = settings.SLUG_CONTENT
    if layout_name:
        layout_slug += '%s%s' % (settings.SLUG_SEP, layout_name[1:-1])
    return RenderLayoutNode(layout_slug)
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/website/templatetags/ionyweb_tags.py/render_page/original