Skip to content

Commit

Permalink
update asset URLs to use GitHub raw content links and improve asset p…
Browse files Browse the repository at this point in the history
…ath handling (#42)
  • Loading branch information
pauldotyu authored Nov 12, 2024
1 parent 2e904d2 commit 49fa895
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
9 changes: 7 additions & 2 deletions packages/website/src/app/shared/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export async function loadFile<E = {}>(
}

export function updateAssetsBasePath(markdown: string, baseUrl: string): string {
// If the markdown is from a GitHub raw URL, don't update the assets path
if (baseUrl.startsWith('https://raw.githubusercontent.com')) {
return markdown;
}

if (baseUrl.endsWith('/')) {
baseUrl = baseUrl.substring(0, baseUrl.length - 1);
}
Expand Down Expand Up @@ -94,7 +99,7 @@ export async function loadScripts(scripts: string[]): Promise<void> {
})
);
}
return Promise.all(promises).then(() => {});
return Promise.all(promises).then(() => { });
}

export async function loadStyles(styles: string[]): Promise<void> {
Expand All @@ -111,7 +116,7 @@ export async function loadStyles(styles: string[]): Promise<void> {
})
);
}
return Promise.all(promises).then(() => {});
return Promise.all(promises).then(() => { });
}

export function injectCode(code: string): void {
Expand Down
16 changes: 8 additions & 8 deletions workshops/advanced-aks/workshop.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ az group create \
Run the following command to download the Bicep template file to deploy the lab resources.

```bash
curl -o main.bicep https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/main.bicep
curl -o main.bicep https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/main.bicep
```

Verify the contents of the **main.bicep** file by running the following command.
Expand Down Expand Up @@ -437,7 +437,7 @@ Now, let's deploy some network policy to allow only the required ports in the pe
Run the following command to download the network policy manifest file.

```bash
curl -o acns-network-policy.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acns-network-policy.yaml
curl -o acns-network-policy.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acns-network-policy.yaml
```

Take a look at the network policy manifest file by running the following command.
Expand Down Expand Up @@ -529,7 +529,7 @@ To limit egress to certain domains, apply an FQDN policy. This policy permits ac
Run the following command to download the FQDN policy manifest file.

```bash
curl -o acns-network-policy-fqdn.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acns-network-policy-fqdn.yaml
curl -o acns-network-policy-fqdn.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acns-network-policy-fqdn.yaml
```

Take a look at the FQDN policy manifest file by running the following command.
Expand Down Expand Up @@ -576,7 +576,7 @@ Let's start by applying a new network policy to cause some chaos in the network.
Run the following command to download the chaos policy manifest file.

```bash
curl -o acns-network-policy-chaos.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acns-network-policy-chaos.yaml
curl -o acns-network-policy-chaos.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acns-network-policy-chaos.yaml
```

Run the following command to examine the chaos policy manifest file.
Expand Down Expand Up @@ -719,7 +719,7 @@ Now to solve the problem we will apply the original policy.
Run the following command to apply the original network policy to the pets namespace.

```bash
curl -o acns-network-policy-allow-store-front-traffic.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acns-network-policy-allow-store-front-traffic.yaml
curl -o acns-network-policy-allow-store-front-traffic.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acns-network-policy-allow-store-front-traffic.yaml
```

View the contents of the network policy manifest file.
Expand All @@ -743,7 +743,7 @@ You should now see the traffic flowing again and you are able to access the pets
Run the following command to download the Hubble UI manifest file.

```bash
curl -o acns-hubble-ui.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acns-hubble-ui.yaml
curl -o acns-hubble-ui.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acns-hubble-ui.yaml
```

Optionally, run the following command to take a look at the Hubble UI manifest file.
Expand Down Expand Up @@ -1268,7 +1268,7 @@ This setup is a modified version of [this guide](https://kubernetes.io/docs/task
Run the following command to download the MySQL manifest file.

```bash
curl -o acstor-mysql-config-services.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acstor-mysql-config-services.yaml
curl -o acstor-mysql-config-services.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acstor-mysql-config-services.yaml
```

Optionally, run the following command to take a look at the MySQL manifest file.
Expand All @@ -1288,7 +1288,7 @@ Next, we'll deploy the MySQL server using the new storage class.
Run the following command to download the MySQL statefulset manifest file.

```bash
curl -o acstor-mysql-statefulset.yaml https://azure-samples.github.io/aks-labs/workshops/advanced-aks/assets/acstor-mysql-statefulset.yaml
curl -o acstor-mysql-statefulset.yaml https://raw.githubusercontent.com/Azure-Samples/aks-labs/refs/heads/main/workshops/advanced-aks/assets/acstor-mysql-statefulset.yaml
```

Optionally, run the following command to take a look at the MySQL statefulset manifest file.
Expand Down

0 comments on commit 49fa895

Please sign in to comment.