import{BinaryFile}from"file/classes";importloggerfrom"utils/log";import{HtmlPage}from"../../html";importtype{PageSettings}from"../../types/site";// can follow!! https://github.com/lovell/sharp/issues/1118// for html, you should inline the base64 image: https://stackoverflow.com/questions/13094257/display-an-ico-within-an-image-element-img/** * An ICO file, usually to represent a page favicon. */classIcoFileextendsBinaryFile{staticfiletypes=["ico"];serve(){return{contents: this.path.readBinary()??"",mimeType: "image/x-icon"};}asHtml(settings: PageSettings){constbinaryContents=this.path.readBinary();logger.file("Reading favicon binary. Contents:",binaryContents);constsrc=`data:image/x-icon;base64,${binaryContents??""}`;returnHtmlPage.create(["html",["img",{ src }]],settings);}}exportdefaultIcoFile;