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