15 lines
688 B
PHP
15 lines
688 B
PHP
<?php
|
|
/**
|
|
* Used by scripts/e2e-color-system.mjs: reads {title,css,html,headCode,design} JSON on stdin and prints what the
|
|
* BACKEND publishes (generateCompiledHTML in api/site-builder.php). Usage: php e2e-color-system-backend.php <backend repo dir>
|
|
*/
|
|
ob_start();
|
|
define('SB_API_LIBRARY_ONLY', true);
|
|
define('AUTH_USER', 'alice');
|
|
define('HOME_DIR', '/docker/users/alice');
|
|
require rtrim($argv[1], '/') . '/web-files/api/site-builder.php';
|
|
ob_end_clean();
|
|
$in = json_decode(stream_get_contents(STDIN), true);
|
|
$U = 'https://example.com/';
|
|
echo generateCompiledHTML($in['title'], $in['css'], $in['html'], $in['headCode'], [], '', $in['design'], $U, sb_canonical_url($U, 'index.html'));
|