Skip to content

Commit

Permalink
feat: padded config
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <zhangtianli2006@163.com>
  • Loading branch information
ZTL-UwU committed Jul 11, 2024
1 parent 39b8d89 commit f3596d2
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 14 deletions.
4 changes: 2 additions & 2 deletions components/layout/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
:class="{ 'lg:border-b': config.header.border }"
>
<div
class="container px-4 md:px-8 flex h-14 max-w-screen-2xl items-center gap-2 justify-between"
:class="{ 'border-b lg:border-none': config.header.border }"
class="px-4 md:px-8 flex h-14 items-center gap-2 justify-between"
:class="{ 'border-b lg:border-none': config.header.border, 'max-w-screen-2xl container': config.main.padded }"
>
<LayoutHeaderLogo class="hidden md:flex flex-1" />
<LayoutMobileNav />
Expand Down
1 change: 1 addition & 0 deletions composables/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const defaultConfig: DefaultConfig = {
breadCrumb: true,
showTitle: true,
codeCopyToast: true,
padded: true,
codeIcon: {
'package.json': 'vscode-icons:file-type-node',
'tsconfig.json': 'vscode-icons:file-type-tsconfig',
Expand Down
8 changes: 7 additions & 1 deletion content/1.getting-started/4.changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ title: Changelog
description: Changes made to shadcn-docs.
---

### `v0.4.0`
## `v0.4.1`

#### :icon{name="lucide:settings"} Config

- [`main.padded`](/api/configuration#main)

## `v0.4.0`

#### :icon{name="lucide:box"} Components

Expand Down
19 changes: 11 additions & 8 deletions content/2.api/1.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface INav {
}
```

### `site`
## `site`

::field-group
::field{name="name" type="string"}
Expand All @@ -57,7 +57,7 @@ interface INav {
::
::

### `theme`
## `theme`

::field-group
::field{name="customizable" type="boolean" defaultValue="true"}
Expand All @@ -71,7 +71,7 @@ interface INav {
::
::

### `header`
## `header`

::field-group
::field{name="title" type="string"}
Expand All @@ -97,7 +97,7 @@ interface INav {
::
::

### `aside`
## `aside`

::field-group
::field{name="useLevel" type="boolean" defaultValue="true"}
Expand All @@ -108,9 +108,12 @@ interface INav {
::
::

### `main`
## `main`

::field-group
::field{name="padded" type="boolean" defaultValue="true"}
Whether the page is padded.
::
::field{name="breadCrumb" type="boolean" defaultValue="true"}
Whether to show the bread crumb.
::
Expand All @@ -125,7 +128,7 @@ interface INav {
::
::

### `footer`
## `footer`

::field-group
::field{name="credits" type="string" defaultValue="''"}
Expand All @@ -136,7 +139,7 @@ interface INav {
::
::

### `toc`
## `toc`

::field-group
::field{name="enable" type="boolean" defaultValue="true"}
Expand All @@ -153,7 +156,7 @@ interface INav {
::
::

### `search`
## `search`

::field-group
::field{name="enable" type="boolean" defaultValue="true"}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shadcn-docs-nuxt",
"type": "module",
"version": "0.4.0",
"version": "0.4.1",
"author": "Tony Zhang <zhangtianli2006@gmail.com>",
"license": "MIT",
"homepage": "https://shadcn-docs.nuxt.dev/",
Expand Down
5 changes: 4 additions & 1 deletion pages/[...slug].vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<template>
<LayoutHeader />
<div class="border-b min-h-screen">
<div class="container px-4 md:px-8 flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10">
<div
class="px-4 md:px-8 flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10"
:class="[config.main.padded && 'container']"
>
<aside class="fixed top-[102px] lg:top-[60px] z-30 -ml-2 hidden h-[calc(100vh-3.5rem)] w-full shrink-0 md:sticky md:block overflow-y-auto">
<LayoutAside :is-mobile="false" />
</aside>
Expand Down
5 changes: 4 additions & 1 deletion pages/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<LayoutHeader />
<div class="container px-4 md:px-8 py-6">
<div
class="px-4 md:px-8 py-6"
:class="[config.main.padded && 'container']"
>
<ContentRenderer
:key="page._id"
:value="page"
Expand Down
1 change: 1 addition & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ interface DefaultConfig {
codeIcon: {
[key: string]: string;
};
padded: boolean;
};
footer: {
credits: string;
Expand Down

0 comments on commit f3596d2

Please sign in to comment.