Skip to content

Commit

Permalink
Merge pull request mermaid-js#337 from mermaid-js/netlify
Browse files Browse the repository at this point in the history
Netlify
  • Loading branch information
sidharthv96 authored Sep 5, 2021
2 parents bcd6bb5 + f9b92d6 commit 7641b2e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/lib/components/actions.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { browser } from '$app/env';
import Card from '$lib/components/card/card.svelte';
import type { State } from '$lib/types';
import { codeStore } from '$lib/util/state';
Expand Down Expand Up @@ -131,6 +133,10 @@
let imagemodeselected = 'auto';
let userimagesize = 1080;
let isNetlify = false;
if (browser && ['mermaid.live', 'netlify'].some((path) => window.location.host.includes(path))) {
isNetlify = true;
}
codeStore.subscribe((state: State) => {
const stateCopy = JSON.parse(JSON.stringify(state));
if (typeof stateCopy.mermaid === 'string') {
Expand Down Expand Up @@ -194,8 +200,12 @@
<button class="btn text-white flex-auto" on:click={loadGist}> Load Gist </button>
</label>
</div>
<div class="w-full flex items-center">
<a class="link" href="https://netlify.com">This site is powered by Netlify</a>
</div>
{#if isNetlify}
<div class="w-full flex items-center justify-center">
<a class="link underline text-gray-500 text-sm" href="https://netlify.com">
This site is powered by Netlify
</a>
</div>
{/if}
</div>
</Card>

0 comments on commit 7641b2e

Please sign in to comment.