Merge pull request #5055 from mempool/mononaut/custom-build-html
Update custom sv html
This commit is contained in:
commit
dcdb9361e8
@ -10,6 +10,7 @@ let settings = [];
|
|||||||
let configContent = {};
|
let configContent = {};
|
||||||
let gitCommitHash = '';
|
let gitCommitHash = '';
|
||||||
let packetJsonVersion = '';
|
let packetJsonVersion = '';
|
||||||
|
let customConfig;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const rawConfig = fs.readFileSync(CONFIG_FILE_NAME);
|
const rawConfig = fs.readFileSync(CONFIG_FILE_NAME);
|
||||||
@ -23,7 +24,13 @@ try {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const indexFilePath = configContent.BASE_MODULE ? 'src/index.' + configContent.BASE_MODULE + '.html' : 'src/index.mempool.html';
|
if (configContent && configContent.CUSTOMIZATION) {
|
||||||
|
customConfig = readConfig(configContent.CUSTOMIZATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseModuleName = configContent.BASE_MODULE || 'mempool';
|
||||||
|
const customBuildName = (customConfig && configContent.enterprise) ? ('.' + configContent.enterprise) : '';
|
||||||
|
const indexFilePath = 'src/index.' + baseModuleName + customBuildName + '.html';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fs.copyFileSync(indexFilePath, 'src/index.html');
|
fs.copyFileSync(indexFilePath, 'src/index.html');
|
||||||
@ -111,20 +118,14 @@ writeConfigTemplate(GENERATED_TEMPLATE_CONFIG_FILE_NAME, newConfigTemplate);
|
|||||||
const currentConfig = readConfig(GENERATED_CONFIG_FILE_NAME);
|
const currentConfig = readConfig(GENERATED_CONFIG_FILE_NAME);
|
||||||
|
|
||||||
let customConfigJs = '';
|
let customConfigJs = '';
|
||||||
if (configContent && configContent.CUSTOMIZATION) {
|
if (customConfig) {
|
||||||
const customConfig = readConfig(configContent.CUSTOMIZATION);
|
console.log(`Customizing frontend using ${configContent.CUSTOMIZATION}`);
|
||||||
if (customConfig) {
|
customConfigJs = `(function (window) {
|
||||||
console.log(`Customizing frontend using ${configContent.CUSTOMIZATION}`);
|
window.__env = window.__env || {};
|
||||||
customConfigJs = `(function (window) {
|
window.__env.customize = ${customConfig};
|
||||||
window.__env = window.__env || {};
|
}((typeof global !== 'undefined') ? global : this));
|
||||||
window.__env.customize = ${customConfig};
|
`;
|
||||||
}((typeof global !== 'undefined') ? global : this));
|
|
||||||
`;
|
|
||||||
} else {
|
|
||||||
throw new Error('Failed to load customization file');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
writeConfig(GENERATED_CUSTOMIZATION_FILE_NAME, customConfigJs);
|
writeConfig(GENERATED_CUSTOMIZATION_FILE_NAME, customConfigJs);
|
||||||
|
|
||||||
if (currentConfig && currentConfig === newConfig) {
|
if (currentConfig && currentConfig === newConfig) {
|
||||||
|
@ -3,22 +3,22 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<title>Bitcoin Office - Explorer</title>
|
<title>National Bitcoin Office of El Salvador</title>
|
||||||
<script src="/resources/config.js"></script>
|
<script src="/resources/config.js"></script>
|
||||||
<script src="/resources/customize.js"></script>
|
<script src="/resources/customize.js"></script>
|
||||||
<base href="/">
|
<base href="/">
|
||||||
|
|
||||||
<meta name="description" content="Explore the full Bitcoin ecosystem with The Mempool Open Source Project®. See the real-time status of your transactions, get network info, and more." />
|
<meta name="description" content="The National Bitcoin Office (ONBTC) of El Salvador under President @nayibbukele" />
|
||||||
<meta property="og:image" content="https://mempool.space/resources/onbtc/onbtc-preview.jpg" />
|
<meta property="og:image" content="https://mempool.space/resources/onbtc/onbtc-preview.jpg" />
|
||||||
<meta property="og:image:type" content="image/jpeg" />
|
<meta property="og:image:type" content="image/jpeg" />
|
||||||
<meta property="og:image:width" content="2000" />
|
<meta property="og:image:width" content="2000" />
|
||||||
<meta property="og:image:height" content="1000" />
|
<meta property="og:image:height" content="1000" />
|
||||||
<meta property="og:description" content="Explore the full Bitcoin ecosystem with The Mempool Open Source Project®. See the real-time status of your transactions, get network info, and more." />
|
<meta property="og:description" content="The National Bitcoin Office (ONBTC) of El Salvador under President @nayibbukele" />
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:site" content="@mempool">
|
<meta name="twitter:site" content="@mempool">
|
||||||
<meta name="twitter:creator" content="@mempool">
|
<meta name="twitter:creator" content="@mempool">
|
||||||
<meta name="twitter:title" content="Oficina Nacional del Bitcoin - Bitcoin Explorer">
|
<meta name="twitter:title" content="National Bitcoin Office of El Salvador">
|
||||||
<meta name="twitter:description" content="Explore the full Bitcoin ecosystem with The Mempool Open Source Project®. See the real-time status of your transactions, get network info, and more." />
|
<meta name="twitter:description" content="The National Bitcoin Office (ONBTC) of El Salvador under President @nayibbukele" />
|
||||||
<meta name="twitter:image" content="https://mempool.space/resources/onbtc/onbtc-preview.jpg" />
|
<meta name="twitter:image" content="https://mempool.space/resources/onbtc/onbtc-preview.jpg" />
|
||||||
<meta name="twitter:domain" content="bitcoin.gob.sv">
|
<meta name="twitter:domain" content="bitcoin.gob.sv">
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user