@chassis-ui/docs 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chassis-ui/docs",
3
3
  "description": "Shared Astro components and layouts for Chassis documentation sites.",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -104,8 +104,8 @@
104
104
  container.setAttribute('aria-hidden', 'true')
105
105
  container.innerHTML = spriteContent
106
106
 
107
- // Insert at the beginning of body
108
- document.body.insertBefore(container, document.body.firstChild)
107
+ // Insert at the end of body
108
+ document.body.appendChild(container)
109
109
  }
110
110
 
111
111
  /**
@@ -41,8 +41,8 @@ const description = frontmatter?.description
41
41
  ? stripMarkdown(frontmatter.description)
42
42
  : getConfig().description
43
43
  const thumbnail = frontmatter?.thumbnail
44
- ? `img/${frontmatter.thumbnail}`
45
- : 'images/logo/chassis-logo-brand.svg'
44
+ ? `${frontmatter.thumbnail}`
45
+ : 'static/images/social-image.png'
46
46
 
47
47
  const bodyProps = overrides?.body ?? {}
48
48
  const mainProps = overrides?.main ?? {}
@@ -48,47 +48,51 @@ if (frontmatter.toc) {
48
48
  </div>
49
49
 
50
50
  <div class="offcanvas-body">
51
- <DocsSidebar />
51
+ <slot name="sidebar">
52
+ <DocsSidebar />
53
+ </slot>
52
54
  </div>
53
55
  </div>
54
56
  </aside>
55
57
 
56
58
  <main class="cxd-main">
57
59
  <div class="cxd-intro">
58
- <div
59
- class="d-medium-flex flex-medium-row-reverse justify-content-between align-items-start"
60
- >
61
- <div class="mb-medium mb-medium-0 d-flex text-nowrap">
60
+ <slot name="intro">
61
+ <div
62
+ class="d-medium-flex flex-medium-row-reverse justify-content-between align-items-start"
63
+ >
64
+ <div class="mb-medium mb-medium-0 d-flex text-nowrap">
65
+ {
66
+ // This is needed because we want to show the badge if show_badge isn't present or is set to false
67
+ frontmatter.added &&
68
+ ((frontmatter.added.show_badge !== undefined &&
69
+ frontmatter.added.show_badge === true) ||
70
+ frontmatter.added.show_badge === undefined) && (
71
+ <span class="badge success smooth rounded-medium me-xsmall">
72
+ Added in v{frontmatter.added.version}
73
+ </span>
74
+ )
75
+ }
76
+ <a
77
+ class="button default small"
78
+ href={`${getConfig().repo}/blob/${id}.mdx`}
79
+ title="View and edit this file on GitHub"
80
+ target="_blank"
81
+ rel="noopener"
82
+ >
83
+ View on GitHub
84
+ </a>
85
+ </div>
86
+ <h1 class="cxd-title mb-small" id="content">{frontmatter.title}</h1>
87
+ </div>
88
+ <div class="cxd-subtitle">
62
89
  {
63
- // This is needed because we want to show the badge if show_badge isn't present or is set to false
64
- frontmatter.added &&
65
- ((frontmatter.added.show_badge !== undefined &&
66
- frontmatter.added.show_badge === true) ||
67
- frontmatter.added.show_badge === undefined) && (
68
- <span class="badge success smooth rounded-medium me-xsmall">
69
- Added in v{frontmatter.added.version}
70
- </span>
71
- )
90
+ frontmatter.description && (
91
+ <Fragment set:html={processMarkdownToHtml(frontmatter.description)} />
92
+ )
72
93
  }
73
- <a
74
- class="button default small"
75
- href={`${getConfig().repo}/blob/${id}.mdx`}
76
- title="View and edit this file on GitHub"
77
- target="_blank"
78
- rel="noopener"
79
- >
80
- View on GitHub
81
- </a>
82
94
  </div>
83
- <h1 class="cxd-title mb-small" id="content">{frontmatter.title}</h1>
84
- </div>
85
- <div class="cxd-subtitle">
86
- {
87
- frontmatter.description && (
88
- <Fragment set:html={processMarkdownToHtml(frontmatter.description)} />
89
- )
90
- }
91
- </div>
95
+ </slot>
92
96
  </div>
93
97
 
94
98
  {
@@ -111,7 +115,9 @@ if (frontmatter.toc) {
111
115
  <hr class="d-none d-medium-block my-xsmall" />
112
116
  <div class="collapse cxd-toc-collapse" id="tocContents">
113
117
  <nav id="TableOfContents">
114
- <TableOfContents headings={headings} config={getConfig()} />
118
+ <slot name="toc">
119
+ <TableOfContents headings={headings} config={getConfig()} />
120
+ </slot>
115
121
  </nav>
116
122
  </div>
117
123
  </div>
@@ -127,7 +133,7 @@ if (frontmatter.toc) {
127
133
  <a
128
134
  class="d-block text-decoration-none"
129
135
  href={getChassisDocsPath(
130
- `${parentDirectory ? parentDirectory + '/' : ''}${section.slug ? section.slug :getSlug(section.title)}/`
136
+ `${parentDirectory ? parentDirectory + '/' : ''}${section.slug ? section.slug : getSlug(section.title)}/`
131
137
  )}
132
138
  >
133
139
  <strong class="d-block h5 mb-2xsmall">{section.title}</strong>
@@ -11,12 +11,7 @@
11
11
  href="/"
12
12
  aria-label="Chassis"
13
13
  >
14
- <img
15
- src="/static/images/logo/chassis-logo-brand.svg"
16
- alt="Chassis UI Logo"
17
- width="162"
18
- height="42"
19
- />
14
+ <img src="/static/images/site-logo.svg" alt="Chassis UI" height="32" />
20
15
  </a>
21
16
  <p>
22
17
  This project is licensed under the MIT License, which allows for free use, modification,
@@ -7,5 +7,5 @@
7
7
  <link rel="icon" href={'/static/images/favicon-16x16.png'} sizes="16x16" type="image/png" />
8
8
  <link rel="manifest" href={'/static/images/manifest.json'} />
9
9
  <link rel="mask-icon" href={'/static/images/safari-pinned-tab.svg'} color="#712cf9" />
10
- <link rel="icon" href={'/static/images/favicon.ico'} />
10
+ <link rel="icon" href={'/static/images/favicon.png'} />
11
11
  <meta name="theme-color" content="#00A4CC" />
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  import { getConfig } from '@libs/config'
3
- import { getChassisDocsPath } from '@libs/path'
4
3
  import type { Layout } from '../../libs/layout'
5
4
  import Stylesheet from './Stylesheet.astro'
6
5
  import Favicons from './Favicons.astro'
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  import path from 'node:path'
3
3
  import { getConfig } from '@libs/config'
4
- import { getChassisDocsPath, getDocsPublicFsPath } from '@libs/path'
4
+ import { getDocsPublicFsPath } from '@libs/path'
5
5
  import { getStaticImageSize } from '../../libs/image'
6
6
  import type { Layout } from '../../libs/layout'
7
7
 
@@ -14,11 +14,8 @@ interface Props {
14
14
 
15
15
  const { description, layout, thumbnail, title } = Astro.props
16
16
 
17
- const socialImageUrl = new URL(getChassisDocsPath(`logo/${thumbnail}`), Astro.site)
18
- // const socialImageSize = await getStaticImageSize(`/${thumbnail}`)
19
- const socialImageSize = await getStaticImageSize(
20
- path.join(getDocsPublicFsPath(), 'static', thumbnail)
21
- )
17
+ const socialImageUrl = new URL(thumbnail, Astro.site)
18
+ const socialImageSize = await getStaticImageSize(path.join(getDocsPublicFsPath(), thumbnail))
22
19
  ---
23
20
 
24
21
  <meta name="twitter:card" content="summary_large_image" />
@@ -38,7 +38,7 @@ const { pathname } = Astro.url
38
38
  {layout !== 'docs' && <div class="d-large-none" style="width: 4.25rem;" />}
39
39
 
40
40
  <a class="navbar-brand me-large-medium" href="/" aria-label="Chassis">
41
- <img src="/static/images/logo/chassis-logo-brand.svg" alt="Chassis UI" width="123" height="32" />
41
+ <img src="/static/images/site-logo.svg" alt="Chassis UI" width="123" height="32" />
42
42
  </a>
43
43
 
44
44
  <div class="d-flex">