From b3390e762157a2ba12594e1d8f51143d648808c7 Mon Sep 17 00:00:00 2001 From: Alan Christopher Thomas Date: Fri, 20 Sep 2019 13:51:51 -0500 Subject: [PATCH 1/4] Fix import of multiple highlight languages --- pages/docs/[doc].jsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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)) ); } From 54e6567f2993efc5119b4cb856e8bb681830c692 Mon Sep 17 00:00:00 2001 From: Alan Christopher Thomas Date: Fri, 20 Sep 2019 13:52:55 -0500 Subject: [PATCH 2/4] Ignore dist directory in tests --- jest.config.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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/', + ], }; From b208e93a6eaa72243e035b7684330bb46b347262 Mon Sep 17 00:00:00 2001 From: Alan Christopher Thomas Date: Fri, 20 Sep 2019 13:53:31 -0500 Subject: [PATCH 3/4] Use client and server-specific filenames as defaults --- src/utils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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', }); }; From 99ff19d01ce922dc26bb9c806b8b85c9c1044761 Mon Sep 17 00:00:00 2001 From: Alan Christopher Thomas Date: Fri, 20 Sep 2019 21:45:56 -0500 Subject: [PATCH 4/4] Match readme to updated server and client filenames --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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.