Add BrowserOnly component to avoid SSG errors
Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
parent
b401cdafd9
commit
70c49495aa
@ -31,7 +31,10 @@ You can use a local socket in an action:
|
|||||||
|
|
||||||
import Tabs from '@theme/Tabs';
|
import Tabs from '@theme/Tabs';
|
||||||
import TabItem from '@theme/TabItem';
|
import TabItem from '@theme/TabItem';
|
||||||
|
import BrowserOnly from '@docusaurus/BrowserOnly';
|
||||||
|
|
||||||
|
<BrowserOnly>
|
||||||
|
{() =>
|
||||||
<Tabs defaultValue={ window.navigator.userAgent.indexOf('Win') != -1 ? 'windows': 'unix'} groupId="client-env">
|
<Tabs defaultValue={ window.navigator.userAgent.indexOf('Win') != -1 ? 'windows': 'unix'} groupId="client-env">
|
||||||
|
|
||||||
<TabItem value="unix" label="Linux/macOS">
|
<TabItem value="unix" label="Linux/macOS">
|
||||||
@ -48,6 +51,8 @@ import TabItem from '@theme/TabItem';
|
|||||||
|
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
}
|
||||||
|
</BrowserOnly>
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
|
|
||||||
|
@ -11,7 +11,10 @@ This guide shows you the Dagger way.
|
|||||||
Within 5 minutes, you will have a local CI/CD loop and run your first test & build pipeline.
|
Within 5 minutes, you will have a local CI/CD loop and run your first test & build pipeline.
|
||||||
|
|
||||||
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
|
import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';
|
||||||
|
import BrowserOnly from '@docusaurus/BrowserOnly';
|
||||||
|
|
||||||
|
<BrowserOnly>
|
||||||
|
{() =>
|
||||||
<Tabs defaultValue={
|
<Tabs defaultValue={
|
||||||
window.navigator.userAgent.indexOf('Linux') != -1 ? 'linux':
|
window.navigator.userAgent.indexOf('Linux') != -1 ? 'linux':
|
||||||
window.navigator.userAgent.indexOf('Win') != -1 ? 'windows':
|
window.navigator.userAgent.indexOf('Win') != -1 ? 'windows':
|
||||||
@ -275,6 +278,9 @@ It becomes even more obvious when the change is not as straightforward as knowin
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
}
|
||||||
|
|
||||||
|
</BrowserOnly>
|
||||||
|
|
||||||
:::tip
|
:::tip
|
||||||
Now that we are comfortable with our local CI/CD loop, let us configure a remote CI environment in the second part.
|
Now that we are comfortable with our local CI/CD loop, let us configure a remote CI environment in the second part.
|
||||||
|
Reference in New Issue
Block a user