Skip to content

Commit

Permalink
Merge pull request #27 from smallstep/misc-fixes
Browse files Browse the repository at this point in the history
Misc fixes
  • Loading branch information
alanchrt authored Sep 23, 2019
2 parents c28d182 + 99ff19d commit d39942a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module.exports = {
testPathIgnorePatterns: ['<rootDir>/.next/', '<rootDir>/node_modules/'],
testPathIgnorePatterns: [
'<rootDir>/.next/',
'<rootDir>/node_modules/',
'<rootDir>/dist/',
],
};
13 changes: 9 additions & 4 deletions pages/docs/[doc].jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
};

0 comments on commit d39942a

Please sign in to comment.