Documentation Site - #208
Merged
Merged
Conversation
davidcheung
commented
Jul 6, 2021
Comment on lines
+1
to
+20
| /** @type {import('@docusaurus/types').DocusaurusConfig} */ | ||
| const child_process = require('child_process'); | ||
|
|
||
| const remoteCommonCssFile = 'https://raw.githubusercontent.com/commitdev/zero/doc-site/doc-site/src/css/custom.css'; | ||
| const cssDownloadPath = './src/css/zero-downloaded-global-custom.css'; | ||
|
|
||
| function downloadCss(url, saveTo) { | ||
| child_process.execFileSync('curl', ['--silent', '-f', '-L', url, '-o', saveTo], {encoding: 'utf8'}); | ||
| return require.resolve(saveTo); | ||
| } | ||
|
|
||
| // This is to download the CSS from commitdev/zero instead of using the local copy, this | ||
| // allows us to maintain only one set of global css throughout the modules and have | ||
| // consistent look and feel throughout the modules, this is synchronous but only runs during build time | ||
| let customCss; | ||
| try { | ||
| customCss = downloadCss(remoteCommonCssFile, cssDownloadPath) | ||
| } catch (e) { | ||
| customCss = require.resolve('./src/css/fallback.css'); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
The weird thing to note here is I'm downloading the global css file from zero repo then if it fails, it uses its original copy instead. Its a synchronous action but it only happens during build time in CI.
davidcheung
commented
Jul 6, 2021
| type: 'link', | ||
| label: 'Backend - Node.js', | ||
| href: `${config.url}/docs/modules/backend-nodejs`, | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I'm thinking of a way to consolidate all these repeated and should stay the same UI components, perhaps make a common npm package and use that.
bmonkman
approved these changes
Jul 6, 2021
bmonkman
approved these changes
Jul 7, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.