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