mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-08 22:17:59 -05:00
Some config cleanup
This commit is contained in:
@@ -19,10 +19,8 @@ import myHtaccess from './integrations/my_htaccess';
|
|||||||
Prism.languages.none = Prism.languages.text;
|
Prism.languages.none = Prism.languages.text;
|
||||||
Prism.languages.code = Prism.languages.text;
|
Prism.languages.code = Prism.languages.text;
|
||||||
|
|
||||||
const basePath = '/' + metadata.version;
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: basePath,
|
base: '/' + metadata.version,
|
||||||
integrations: [
|
integrations: [
|
||||||
myBuildChecks(),
|
myBuildChecks(),
|
||||||
myAutoLinkHeadings({ exclude: 'h1, .no-anchor' }),
|
myAutoLinkHeadings({ exclude: 'h1, .no-anchor' }),
|
||||||
@@ -31,7 +29,7 @@ export default defineConfig({
|
|||||||
myAddTooltips({ constantsFile: 'src/include/constants.json' }),
|
myAddTooltips({ constantsFile: 'src/include/constants.json' }),
|
||||||
myFixupLinks(),
|
myFixupLinks(),
|
||||||
myCleanupHtml(),
|
myCleanupHtml(),
|
||||||
myHtaccess(basePath),
|
myHtaccess(),
|
||||||
],
|
],
|
||||||
markdown: {
|
markdown: {
|
||||||
syntaxHighlight: 'prism',
|
syntaxHighlight: 'prism',
|
||||||
|
|||||||
@@ -9,10 +9,14 @@ function writeHtaccess(base, dir, logger) {
|
|||||||
logger.info(`Wrote .htaccess file to ${file}`);
|
logger.info(`Wrote .htaccess file to ${file}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function (base) {
|
export default function () {
|
||||||
|
let base;
|
||||||
return {
|
return {
|
||||||
name: 'myHtaccess',
|
name: 'myHtaccess',
|
||||||
hooks: {
|
hooks: {
|
||||||
|
'astro:config:done': ({ config }) => {
|
||||||
|
base = config.base;
|
||||||
|
},
|
||||||
'astro:build:done': ({ dir, logger }) => {
|
'astro:build:done': ({ dir, logger }) => {
|
||||||
writeHtaccess(base, dir, logger);
|
writeHtaccess(base, dir, logger);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ function getGitBranch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const date = new Date().toISOString().substr(0, 16).replace('T', ' ') + ' UTC';
|
const date = new Date().toISOString().substr(0, 16).replace('T', ' ') + ' UTC';
|
||||||
const version = getGitBranch();
|
|
||||||
const hostname = 'https://eth2book.info';
|
const hostname = 'https://eth2book.info';
|
||||||
const canonical = hostname + '/latest';
|
const canonical = hostname + '/latest';
|
||||||
|
|
||||||
@@ -30,13 +29,13 @@ const metadata = {
|
|||||||
description:
|
description:
|
||||||
"A technical handbook on Ethereum's move to proof of stake and beyond",
|
"A technical handbook on Ethereum's move to proof of stake and beyond",
|
||||||
author: 'Ben Edgington',
|
author: 'Ben Edgington',
|
||||||
gitHash: getGitHash(),
|
gitHash: getGitHash() || 'unknown',
|
||||||
gitUrl: 'https://github.com/benjaminion/upgrading-ethereum-book',
|
gitUrl: 'https://github.com/benjaminion/upgrading-ethereum-book',
|
||||||
date: date,
|
date: date,
|
||||||
licenceUrl: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
licenceUrl: 'https://creativecommons.org/licenses/by-sa/4.0/',
|
||||||
licence: 'CC BY-SA 4.0',
|
licence: 'CC BY-SA 4.0',
|
||||||
hostname: hostname,
|
hostname: hostname,
|
||||||
version: version,
|
version: getGitBranch() || 'unknown',
|
||||||
canonical: canonical,
|
canonical: canonical,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user