mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
docs: prerender for gh pages
This commit is contained in:
parent
bcc7058ddf
commit
f0b270b9bc
6 changed files with 13 additions and 11 deletions
6
docs/_config.yml
Normal file
6
docs/_config.yml
Normal file
|
@ -0,0 +1,6 @@
|
|||
include:
|
||||
- _.js
|
||||
- _*.js
|
||||
- assets
|
||||
- assets/*_.js
|
||||
- assets/*.js
|
|
@ -6,7 +6,7 @@
|
|||
"dev:svite": "svite",
|
||||
"build": "run-s build:*",
|
||||
"build:routify": "routify run -b",
|
||||
"build:svite": "svite build --assetsDir=assets",
|
||||
"build:svite": "svite build --base=/carbon-components-svelte --assetsDir=assets",
|
||||
"postbuild": "node scripts/postbuild",
|
||||
"deploy": "npx gh-pages -d dist"
|
||||
},
|
||||
|
|
|
@ -19,12 +19,7 @@ async function scrape(page, url = "") {
|
|||
|
||||
function relativePaths(depth = 0) {
|
||||
const asset_extension = new RegExp(/.(js|css|ico)$/);
|
||||
let relative_path =
|
||||
depth > 0
|
||||
? Array.from({ length: depth }, (_, i) => "../")
|
||||
.join("")
|
||||
.slice(0, -1)
|
||||
: ".";
|
||||
let relative_path = "";
|
||||
|
||||
return (tree) => {
|
||||
tree.match(
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<script>
|
||||
import { Router } from "@sveltech/routify";
|
||||
import { Router, basepath } from "@sveltech/routify";
|
||||
import { routes } from "../.routify/routes";
|
||||
|
||||
$basepath = "/carbon-components-svelte";
|
||||
</script>
|
||||
|
||||
<style lang="scss" global>
|
||||
|
|
|
@ -143,7 +143,7 @@
|
|||
kind="ghost"
|
||||
target="_blank"
|
||||
size="field"
|
||||
href="{src}"
|
||||
href="{$url(src)}"
|
||||
icon="{Launch16}"
|
||||
>
|
||||
Open in new tab
|
||||
|
|
|
@ -164,7 +164,6 @@
|
|||
|
||||
<svelte:body
|
||||
on:mouseover="{async (e) => {
|
||||
return;
|
||||
if (process.env.NODE_ENV === 'development') return;
|
||||
if (!e.target.href || !e.target
|
||||
.getAttribute('class')
|
||||
|
@ -179,7 +178,7 @@
|
|||
<Theme persist>
|
||||
<Header
|
||||
aria-label="Navigation"
|
||||
href="/"
|
||||
href="{$url('/')}"
|
||||
expandedByDefault="{true}"
|
||||
bind:isSideNavOpen
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue