Skip to content

Commit 057adc4

Browse files
committed
Upgrade VitePress docs
1 parent 83a1fb5 commit 057adc4

File tree

6 files changed

+238
-69
lines changed

6 files changed

+238
-69
lines changed

docs/.vitepress/config.ts

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,34 @@
11
import { defineConfig } from 'vitepress';
22

33
export default defineConfig({
4-
lang: 'en-US',
5-
title: 'Documentation',
4+
title: 'Prettier Plugin Pug',
65
description: '@prettier/plugin-pug documentation',
7-
base: process.env.NODE_ENV === 'production' ? '/plugin-pug/' : '/',
6+
87
head: [['link', { rel: 'icon', href: `/icon.png` }]],
98

9+
base: process.env.NODE_ENV === 'production' ? '/plugin-pug/' : '/',
10+
1011
themeConfig: {
11-
repo: 'prettier/plugin-pug',
12-
docsDir: 'docs',
13-
docsBranch: 'main',
1412
logo: 'https://camo.githubusercontent.com/f89d53e813140369c509e67424833cdfc3f76dcf997d4b3b0a1174ec12304600/68747470733a2f2f63646e2e7261776769742e636f6d2f70726574746965722f70726574746965722d6c6f676f2f6d61737465722f696d616765732f70726574746965722d69636f6e2d6c696768742e737667',
15-
editLinks: true,
13+
14+
editLink: {
15+
repo: 'prettier/plugin-pug',
16+
branch: 'main',
17+
dir: 'docs',
18+
text: 'Suggest changes to this page',
19+
},
20+
21+
socialLinks: [
22+
{ icon: 'github', link: 'https://github.com/prettier/plugin-pug' },
23+
],
24+
25+
footer: {
26+
message: 'Released under the MIT License.',
27+
copyright: 'Copyright © 2019-2022 Christopher Quadflieg',
28+
},
29+
1630
nav: [
17-
{
18-
text: 'Guide',
19-
link: '/guide/',
20-
},
31+
{ text: 'Guide', link: '/guide/' },
2132
{
2233
text: 'Configuration',
2334
items: [
@@ -32,17 +43,16 @@ export default defineConfig({
3243
],
3344
},
3445
],
46+
3547
sidebar: {
3648
'/guide/': [
3749
{
3850
text: 'Guide',
39-
collapsable: false,
40-
children: [{ text: 'Getting Started', link: '/guide/' }],
51+
items: [{ text: 'Getting Started', link: '/guide/' }],
4152
},
4253
{
4354
text: 'Configuration',
44-
collapsable: false,
45-
children: [
55+
items: [
4656
{
4757
text: 'Standard Prettier overrides',
4858
link: '/guide/standard-prettier-overrides',

docs/.vitepress/theme/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Theme from 'vitepress/theme';
2+
import { h } from 'vue';
3+
import './styles/vars.css';
4+
5+
export default {
6+
...Theme,
7+
Layout() {
8+
return h(Theme.Layout, null, {});
9+
},
10+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/**
2+
* Colors
3+
* -------------------------------------------------------------------------- */
4+
5+
/* pug light #ccac8d */
6+
/* pug lighter #efcca3 */
7+
/* pug dark #56332b */
8+
/* pug darker #442823 */
9+
10+
:root {
11+
--vp-c-brand: #56332b;
12+
--vp-c-brand-light: #ccac8d;
13+
--vp-c-brand-lighter: #efcca3;
14+
--vp-c-brand-dark: #56332b;
15+
--vp-c-brand-darker: #442823;
16+
--vp-c-brand-dimm: rgba(100, 108, 255, 0.08);
17+
}
18+
19+
/**
20+
* Component: Button
21+
* -------------------------------------------------------------------------- */
22+
23+
:root {
24+
--vp-button-brand-border: var(--vp-c-brand);
25+
--vp-button-brand-text: var(--vp-c-text-dark-1);
26+
--vp-button-brand-bg: var(--vp-c-brand-darker);
27+
--vp-button-brand-hover-border: var(--vp-c-brand-dark);
28+
--vp-button-brand-hover-text: var(--vp-c-text-dark-1);
29+
--vp-button-brand-hover-bg: var(--vp-c-brand-dark);
30+
--vp-button-brand-active-border: var(--vp-c-brand-light);
31+
--vp-button-brand-active-text: var(--vp-c-text-dark-1);
32+
--vp-button-brand-active-bg: var(--vp-button-brand-bg);
33+
}
34+
35+
/**
36+
* Component: Home
37+
* -------------------------------------------------------------------------- */
38+
39+
:root {
40+
--vp-home-hero-name-color: transparent;
41+
--vp-home-hero-name-background: -webkit-linear-gradient(
42+
94deg,
43+
#56332b 20%,
44+
#efcca3
45+
);
46+
47+
--vp-home-hero-image-background-image: linear-gradient(
48+
-10deg,
49+
#56332b 50%,
50+
#efcca3 50%
51+
);
52+
--vp-home-hero-image-filter: blur(40px);
53+
}
54+
55+
@media (min-width: 640px) {
56+
:root {
57+
--vp-home-hero-image-filter: blur(56px);
58+
}
59+
}
60+
61+
@media (min-width: 960px) {
62+
:root {
63+
--vp-home-hero-image-filter: blur(72px);
64+
}
65+
}
66+
67+
/**
68+
* Component: Custom Block
69+
* -------------------------------------------------------------------------- */
70+
71+
:root {
72+
--vp-custom-block-tip-border: var(--vp-c-brand);
73+
--vp-custom-block-tip-text: var(--vp-c-brand-darker);
74+
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
75+
}
76+
77+
.dark {
78+
--vp-custom-block-tip-border: var(--vp-c-brand);
79+
--vp-custom-block-tip-text: var(--vp-c-brand-lighter);
80+
--vp-custom-block-tip-bg: var(--vp-c-brand-dimm);
81+
}
82+
83+
.dark .vp-doc a,
84+
.dark .edit-link-button,
85+
.dark .title,
86+
.dark .link.active,
87+
.dark .link.active .link-text,
88+
.dark .VPNavBarMenuLink.active {
89+
color: var(--vp-c-brand-light);
90+
}
91+
92+
.dark .link:hover,
93+
.dark .VPNavBarMenuLink:hover {
94+
color: var(--vp-c-brand-lighter);
95+
}

docs/index.md

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,27 @@
11
---
2-
home: true
3-
actionText: Get Started →
4-
actionLink: /guide/
5-
footer: MIT Licensed | Copyright © 2019-2022 Christopher Quadflieg
6-
---
7-
8-
<!-- TODO christopher 2021-03-29: Move this to heroImage -->
9-
<p align="center">
10-
&nbsp;&nbsp;&nbsp;&nbsp;
11-
<a href="https://prettier.io" target="_blank">
12-
<img alt="Prettier" src="https://cdn.rawgit.com/prettier/prettier-logo/master/images/prettier-icon-light.svg">
13-
</a>
14-
&nbsp;&nbsp;&nbsp;&nbsp;
15-
&nbsp;&nbsp;&nbsp;&nbsp;
16-
<a href="https://pugjs.org" target="_blank">
17-
<img alt="Pug" src="https://cdn.rawgit.com/pugjs/pug-logo/eec436cee8fd9d1726d7839cbe99d1f694692c0c/SVG/pug-final-logo-_-colour-128.svg" height="210">
18-
</a>
19-
&nbsp;&nbsp;&nbsp;&nbsp;
20-
</p>
2+
layout: home
213

22-
<p align="center">
23-
<a href="https://github.com/prettier/plugin-pug/blob/main/LICENSE">
24-
<img alt="license: MIT" src="https://img.shields.io/github/license/prettier/plugin-pug.svg?style=flat-square">
25-
</a>
26-
<a href="https://www.npmjs.com/package/@prettier/plugin-pug" target="_blank">
27-
<img alt="NPM package" src="https://img.shields.io/npm/v/@prettier/plugin-pug.svg?style=flat-square">
28-
</a>
29-
<a href="https://www.npmjs.com/package/@prettier/plugin-pug" target="_blank">
30-
<img alt="downloads" src="https://img.shields.io/npm/dt/@prettier/plugin-pug.svg?style=flat-square">
31-
</a>
32-
<a href="https://prettier.io" target="_blank">
33-
<img alt="Code Style: Prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square">
34-
</a>
35-
<a href="https://github.com/prettier/plugin-pug/actions/workflows/ci.yml">
36-
<img alt="Build Status" src="https://github.com/prettier/plugin-pug/actions/workflows/ci.yml/badge.svg?branch=main">
37-
</a>
38-
</p>
4+
title: Prettier Plugin Pug
5+
titleTemplate: Format your pug code with Prettier
396

40-
<p align="center">
41-
Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
42-
</p>
7+
hero:
8+
name: Prettier Plugin Pug
9+
text: Format your pug code with Prettier
10+
tagline: 'npm install --save-dev @prettier/plugin-pug'
11+
image:
12+
src: https://cdn.rawgit.com/pugjs/pug-logo/eec436cee8fd9d1726d7839cbe99d1f694692c0c/SVG/pug-final-logo-_-colour-128.svg
13+
alt: Prettier Plugin Pug
14+
actions:
15+
- theme: brand
16+
text: Get Started
17+
link: /guide/
18+
- theme: alt
19+
text: View on GitHub
20+
link: https://github.com/prettier/plugin-pug
4321

44-
<p align="center">
45-
This plugin adds support for the Pug language to Prettier.
46-
</p>
22+
features:
23+
- title: Prettier
24+
details: Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
25+
- title: Plugin
26+
details: This plugin adds support for the Pug language to Prettier.
27+
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"prettier-plugin-organize-imports": "~2.3.4",
6868
"typescript": "~4.7.3",
6969
"vite": "~2.9.9",
70-
"vitepress": "~0.22.4",
70+
"vitepress": "1.0.0-alpha.1",
7171
"vitest": "~0.13.1"
7272
},
7373
"peerDependencies": {

0 commit comments

Comments
 (0)