def METHOD_NAME(self):
    s = HEAD % self.variables
    if self.uplink:
        if self.uptitle:
            link = ('<link rel="up" href="%s" title="%s">\n  '
                    '<link rel="start" href="%s" title="%s">'
                    % (self.uplink, self.uptitle,
                       self.uplink, self.uptitle))
        else:
            link = ('<link rel="up" href="%s">\n  '
                    '<link rel="start" href="%s">'
                    % (self.uplink, self.uplink))
        repl = "  %s\n</head>" % link
        s = s.replace("</head>", repl, 1)
    if self.aesop_type:
        meta = '<meta name="aesop" content="%s">\n  ' % self.aesop_type
        # Insert this in the middle of the head that's been
        # generated so far, keeping <meta> and <link> elements in
        # neat groups:
        s = s.replace("<link ", meta + "<link ", 1)
    if self.favicon:
        ext = os.path.splitext(self.favicon)[1]
        if ext in (".gif", ".png"):
            type = ' type="image/%s"' % ext[1:]
        else:
            type = ''
        link = ('<link rel="SHORTCUT ICON" href="%s"%s>\n  '
                % (self.favicon, type))
        s = s.replace("<link ", link + "<link ", 1)
    return s