/* * Copyright (C) 2024 Puter Technologies Inc. * * This file is part of Puter. * * Puter is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published * by the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ const {encode} = require('html-entities'); const path_ = require('path'); const fs_ = require('fs'); const generate_puter_page_html = ({ env, manifest, gui_path, use_bundled_gui, app_origin, api_origin, meta, gui_params, }) => { const e = encode; const { title, description, short_description, company, canonical_url, } = meta; gui_params = { ...meta, ...gui_params, app_origin, api_origin, gui_origin: app_origin, }; const asset_dir = env === 'dev' ? '/src' : '/dist' ; // const asset_dir = '/dist'; const bundled = env != 'dev' || use_bundled_gui; return ` ${e(title)} ${ ((!bundled && manifest?.css_paths) ? manifest.css_paths.map(path => `\n`) : []).join('') } ${ use_bundled_gui ? `` : '' } ${ ((!bundled && manifest?.lib_paths) ? manifest.lib_paths.map(path => `\n`) : []).join('') } ${ ((!bundled && manifest?.js_paths) ? manifest.js_paths.map(path => `\n`) : []).join('') } `; }; module.exports = { generate_puter_page_html, };