Rework rehype plugin and clean up changes

This commit is contained in:
Priere 2023-12-05 20:52:21 -05:00
parent 2c43fb2512
commit 018a45e2d4
8 changed files with 36 additions and 33 deletions

View file

@ -3,8 +3,7 @@ import { pwaInfo } from 'virtual:pwa-info';
import '../styles/index.css';
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
---
<!-- Global Metadata -->
@ -22,7 +21,7 @@ const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
<link rel="apple-touch-icon" href={`${baseNoTrailing}/icons/apple-icon-180.png`} sizes="180x180" />
<meta name="theme-color" content="#222222" />
<base href={base} />
<base href={BASE_URL} />
<!-- Scrollable a11y code helper -->
<script src{`${baseNoTrailing}/make-scrollable-code-focusable.js`} is:inline></script>

View file

@ -18,8 +18,7 @@ const langCode = 'en'; // getLanguageFromURL(currentPage);
const sidebar = SIDEBAR[langCode];
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
---
<nav
@ -27,7 +26,7 @@ const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
title="Top Navigation"
>
<div class="flex overflow-visible items-center grow" style="overflow:visible">
<a href="/" class="flex items-center text-2xl space-x-2">
<a href={`${baseNoTrailing}/`} class="flex items-center text-2xl space-x-2">
<h1 class="font-bold flex space-x-2 items-baseline text-xl">
<span>🌀</span>
<div class="flex space-x-1 items-baseline">

View file

@ -7,8 +7,8 @@ import HeadCommon from '../../components/HeadCommon.astro';
const myPatterns = await getMyPatterns();
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;---
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
---
<head>
<HeadCommon />
@ -31,7 +31,7 @@ const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;---
<div class="absolute w-full h-full flex justify-center items-center">
<span class="bg-slate-800 p-2 rounded-md text-white">{name}</span>
</div>
<img src={`${baseNoTrailing}/swatch/${name}.png`} />
<img src={`${baseNoTrailing}/swatch/${name}.png/`} />
</a>
))
}

View file

@ -7,7 +7,9 @@ import { MiniRepl } from '../../docs/MiniRepl';
# Welcome
<img src="/icons/strudel_icon.png" className="w-32 animate-pulse md:float-right ml-8" />
<div className="w-32 animate-pulse md:float-right ml-8">
![Strudel Icon](/icons/strudel_icon.png)
</div>
Welcome to the Strudel documentation pages!
You've come to the right place if you want to learn how to make music with code.

View file

@ -14,8 +14,7 @@ import { FilesTab } from './FilesTab';
const TAURI = window.__TAURI__;
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
export function Footer({ context }) {
const footerContent = useRef();
@ -158,7 +157,7 @@ function WelcomeTab() {
</p>
<p>
To learn more about what this all means, check out the{' '}
<a href={`${baseNoTrailing}/workshop/getting-started`} target="_blank">
<a href={`${baseNoTrailing}/workshop/getting-started/`} target="_blank">
interactive tutorial
</a>
. Also feel free to join the{' '}

View file

@ -12,10 +12,6 @@ import './Repl.css';
const { BASE_URL } = import.meta.env;
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
export function Header({ context }) {
const {
embedded,

View file

@ -4,8 +4,7 @@ import './piano.mjs';
import './files.mjs';
const { BASE_URL } = import.meta.env;
const base = BASE_URL;
const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base;
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
export async function prebake() {
// https://archive.org/details/SalamanderGrandPianoV3