def insert_sidebar_code(data, sidebar_code, filename):
    pos = data.find(body_sidebar_dynamic_data_placeholder)
    if (pos < 0):
        logfunc(f'Error, could not find {body_sidebar_dynamic_data_placeholder} in file {filename}')
        return data
    else:
        ret = ((data[0:pos] + sidebar_code) + data[(pos + len(body_sidebar_dynamic_data_placeholder)):])
        return ret
def insert_sidebar_code(data, sidebar_code, filename):
    pos = data.find(body_sidebar_dynamic_data_placeholder)
    if (pos < 0):
        logfunc(f'Error, could not find {body_sidebar_dynamic_data_placeholder} in file {filename}')
        return data
    else:
        ret = ((data[0:pos] + sidebar_code) + data[(pos + len(body_sidebar_dynamic_data_placeholder)):])
        return ret