def build(self, dist=False):
        """
        Save the rendered output to the output file.
        """
        logging.info("Building %s", self.path)

        data = self.render()

        # Make sure a folder for the output path exists
        try:
            os.makedirs(
                os.path.dirname(
                    os.path.join(
                        self.site.paths["dist" if dist else "build"],
                        self.path
                    )
                )
            )
        except __HOLE__:
            pass

        # Write the data to the output file
        f = codecs.open(
            os.path.join(
                self.site.paths["dist" if dist else "build"],
                self.path
            ),
            'w',
            'utf-8'
        )
        f.write(data)
        f.close()

        # Run all plugins
        #self.site.pluginMethod('postBuildPage',
        #    self.site, self.paths['full-build'])
dataset/ETHPy150Open randomknowledge/Cactus_Refactored/cactus/page.py/Page.build