diff --git a/README.md b/README.md index 252cf65..22ec15c 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,12 @@ Properties with corresponding names in the `topics` object in `config.yaml` also If your documentation makes use of the name of a certificate's identity, its certificate filename, its private key filename, or the root certificate filename, please use these template tokens. They will be interpolated with the appropriate values at build time in different contexts: - `{{ server_name }}` — Name of the identity like `example.internal.net` -- `{{ server_cert }}` — Filename of the server's certificate like `example.crt` -- `{{ server_key }}` — Filename of the server's private key like `example.key` +- `{{ server_cert }}` — Filename of the server's certificate like `server.crt` +- `{{ server_key }}` — Filename of the server's private key like `server.key` - `{{ server_port }}` — Port number that that the server binds in the server auth docs - `{{ client_name }}` — Name of the identity like `example.internal.net` -- `{{ client_cert }}` — Filename of the client's certificate like `example.crt` -- `{{ client_key }}` — Filename of the client's private key like `example.key` +- `{{ client_cert }}` — Filename of the client's certificate like `client.crt` +- `{{ client_key }}` — Filename of the client's private key like `client.key` - `{{ ca_cert }}` — Filename of the root CA certificate like `ca.crt` Do not use markdown headlines. diff --git a/jest.config.js b/jest.config.js index b6f4e7d..0042959 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,3 +1,7 @@ module.exports = { - testPathIgnorePatterns: ['/.next/', '/node_modules/'], + testPathIgnorePatterns: [ + '/.next/', + '/node_modules/', + '/dist/', + ], }; diff --git a/pages/docs/[doc].jsx b/pages/docs/[doc].jsx index d225c39..ed0bcd4 100644 --- a/pages/docs/[doc].jsx +++ b/pages/docs/[doc].jsx @@ -41,10 +41,15 @@ const Page = () => { // parse all the languages from the markdown content and load their prism // language modules const contents = Object.values(doc.topics).map(topic => topic.content); - const languageImports = ContentBlock.parseLanguages(contents).map(lang => - import(`prismjs/components/prism-${lang}`) - .then(() => setHighlights(highlights.concat([lang]))) - .catch(() => console.log(`"${lang}" is not a valid Prism.js language.`)) + const languages = ContentBlock.parseLanguages(contents); + const languageImports = languages.map(lang => + import(`prismjs/components/prism-${lang}`).catch(() => + console.log(`"${lang}" is not a valid Prism.js language.`) + ) + ); + + Promise.all(languageImports).then(modules => + setHighlights(highlights.concat(languages)) ); } diff --git a/src/utils.js b/src/utils.js index f807bbc..dae371e 100644 --- a/src/utils.js +++ b/src/utils.js @@ -8,12 +8,12 @@ export const parseTemplate = (content, data = {}) => { // interpolate variables into markdown template return Mustache.render(content, { server_name: data.server_name || 'example.internal.net', - server_cert: data.server_cert || 'example.crt', - server_key: data.server_key || 'example.key', + server_cert: data.server_cert || 'server.crt', + server_key: data.server_key || 'server.key', server_port: data.server_port || 443, client_name: data.client_name || 'example.internal.net', - client_cert: data.client_cert || 'example.crt', - client_key: data.client_key || 'example.key', + client_cert: data.client_cert || 'client.crt', + client_key: data.client_key || 'client.key', ca_cert: data.ca_cert || 'ca.crt', }); };