Skip to content

Commit

Permalink
add prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
hipstersmoothie committed Jul 8, 2020
1 parent 368ee77 commit 2bcdda5
Show file tree
Hide file tree
Showing 27 changed files with 158 additions and 135 deletions.
22 changes: 11 additions & 11 deletions bin/ignite.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node
require('dotenv').config()
require("dotenv").config();

const path = require("path");
const { app } = require("command-line-application");
Expand All @@ -9,8 +9,8 @@ const { execSync } = require("child_process");
const next = require("next");
const copy = require("copy-template-dir");
const ignite = require("../next");
const { getConfig } = require('../dist/cjs/utils/get-config')
const { buildSitemap } = require('../dist/cjs/utils/sitemap')
const { getConfig } = require("../dist/cjs/utils/get-config");
const { buildSitemap } = require("../dist/cjs/utils/sitemap");

const buildNext = require("next/dist/build").default;
const exportNext = require("next/dist/export").default;
Expand All @@ -22,21 +22,21 @@ const args = app({
commands: [
{
name: "init",
description: "Initialize an ignite-cli based docs site."
description: "Initialize an ignite-cli based docs site.",
},
{
name: "dev",
description: "Develop your documentation."
description: "Develop your documentation.",
},
{
name: "build",
description: "Build your documentation."
description: "Build your documentation.",
},
{
name: "deploy",
description: "Deploy your documentation to GitHub Pages."
}
]
description: "Deploy your documentation to GitHub Pages.",
},
],
});

if (!args) {
Expand Down Expand Up @@ -66,7 +66,7 @@ if (args._command === "dev") {
// This tells it to parse the query portion of the URL.
const parsedUrl = parse(req.url, true);
handle(req, res, parsedUrl);
}).listen(3000, err => {
}).listen(3000, (err) => {
if (err) {
throw err;
}
Expand All @@ -91,7 +91,7 @@ if (args._command === "build") {
);
buildSitemap();
})
.catch(err => {
.catch((err) => {
console.error("");
console.error("> Build error occurred");
console.log(err);
Expand Down
2 changes: 1 addition & 1 deletion docs/css/syntax-highlighting-overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

* {
text-shadow: none !important;
}
}
6 changes: 3 additions & 3 deletions docs/pages/blog/first.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: 'My First Blog Post'
date: 'Thu, 12 Mar 2020 23:00:02 -0700'
title: "My First Blog Post"
date: "Thu, 12 Mar 2020 23:00:02 -0700"
---

Some killer content.
Some killer content.
22 changes: 14 additions & 8 deletions docs/pages/docs/advanced-features/layouts.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Using Layouts'
title: "Using Layouts"
---

`ignite` comes with a few default layouts.
Expand All @@ -8,9 +8,10 @@ If you wanted to you could use any layout for any page by specifying it in the f

```yaml
---
title: 'My Page'
layout: 'docs'
title: "My Page"
layout: "docs"
---

```

## Layouts
Expand All @@ -23,8 +24,9 @@ Renders the page with a NavBar above it.

```yaml
---
layout: 'nav-bar'
layout: "nav-bar"
---

```

### `docs`
Expand All @@ -33,8 +35,9 @@ Renders the page with a NavBar above it and the sidebar for the folder.

```yaml
---
layout: 'docs'
layout: "docs"
---

```

### `blog`
Expand All @@ -43,8 +46,9 @@ Renders the page with a NavBar and a special blog post header.

```yaml
---
layout: 'blog'
layout: "blog"
---

```

[Read about the options this layout supports](../features/blog#blog-post-format)
Expand All @@ -55,11 +59,13 @@ Renders the page with a NavBar and a special home page header.

```yaml
---
layout: 'blog'
layout: "blog"
---

```

[Read about the options this layout supports](../features/home-page#mdx-features)

### TODO Adding Your Own Layouts
### TODO Automatic Layout Matching

### TODO Automatic Layout Matching
8 changes: 3 additions & 5 deletions docs/pages/docs/advanced-features/next.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Using Ignite as a Next.js plugin'
title: "Using Ignite as a Next.js plugin"
---

Most of `ignite`s features can be used as a plain Next.js plugin! :tada:
Expand All @@ -9,7 +9,6 @@ What you loose:
- can no longer use the `ignite` CLI
- can no longer use `.igniterc` file


And not much else (we said it was a thin wrapper right :wink:)

**`next.config.js`:**
Expand All @@ -28,11 +27,10 @@ When using `ignite` as a Next.js plugin you config will not be loaded.

To see the available configuration options visit the [configuration documentation](../configuration).


```js
const withIgnite = require("next-ignite/next");

module.exports = withIgnite({
basePath: 'pages'
basePath: "pages",
});
```
```
13 changes: 8 additions & 5 deletions docs/pages/docs/advanced-features/theming.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ title: "Theming the Website"
`ignite` provides two ways to theme:

- Customize the colors => CSS variables
- Customize the component used to render arbitrary HTML elements => MDX
- Customize the component used to render arbitrary HTML elements => MDX

## Color Theming

`ignite` is uses [tailwind](https://tailwindcss.com/) so changing the colors for you website is super simple.
All you have to do is set some CSS variables and `ignite` will use those colors.

*Available Colors:*
_Available Colors:_

- primary (100-900) - The primary color for your app
- gray (100-1000) - A gray that compliments the primary color
Expand Down Expand Up @@ -79,7 +79,7 @@ const components = {
...igniteComponents,
// Easily override and base HTML component
h1: H1,
a: Anchor
a: Anchor,
};

class MyApp extends App {
Expand Down Expand Up @@ -114,7 +114,10 @@ import makeClass from "clsx";
const h1 = ({ className, ...props }) => (
<h1
// Use props.className if you are using it yourself
className={makeClass(className, "text-primary-900 mb-8 dark:text-primary-100")}
className={makeClass(
className,
"text-primary-900 mb-8 dark:text-primary-100"
)}
// Spread the rest of the props
{...props}
/>
Expand Down Expand Up @@ -145,4 +148,4 @@ Full list of themeable `ignite` components:
- `SidebarDivider`
- `SidebarList`

When overriding these components please refer to [base implementations]() for available props.
When overriding these components please refer to [base implementations]() for available props.
2 changes: 1 addition & 1 deletion docs/pages/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Any unordered sections will be put after your provided order in alphabetical ord
```json5
{
// The Default
"order": ["docs", "blog"]
order: ["docs", "blog"],
}
```

Expand Down
25 changes: 15 additions & 10 deletions docs/pages/docs/features/blog.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Creating a Blog'
title: "Creating a Blog"
---

Adding a blog with `ignite` is super easy.
Expand Down Expand Up @@ -40,7 +40,7 @@ export default () => {
<components.h1>Blog</components.h1>

<components.ul>
{posts.map(page => (
{posts.map((page) => (
<li key={page.__resourcePath}>
<Link passHref href={page.__resourcePath}>
<components.a>{page.title}</components.a>
Expand All @@ -63,8 +63,9 @@ You should always include a title.

```yaml
---
title: 'My First Blog Post'
title: "My First Blog Post"
---

```

### author
Expand All @@ -74,10 +75,11 @@ Include an email to display an avatar using gravatar.

```yaml
---
title: 'My First Blog Post'
author: 'Andrew Lisowski'
email: 'lisowski54@gmail.com'
title: "My First Blog Post"
author: "Andrew Lisowski"
email: "lisowski54@gmail.com"
---

```

### date
Expand All @@ -87,8 +89,9 @@ If not supplied this information is pulled from the commit date.

```yaml
---
date: 'Thu, 12 Mar 2020 23:00:02 -0700'
date: "Thu, 12 Mar 2020 23:00:02 -0700"
---

```

### color
Expand All @@ -97,8 +100,9 @@ A color to use as the backdrop for a post

```yaml
---
color: 'red'
color: "red"
---

```

### image
Expand All @@ -107,6 +111,7 @@ Instead of a color you can display an image as the backdrop.

```yaml
---
image: 'http://image.com/example.png'
image: "http://image.com/example.png"
---
```

```
11 changes: 6 additions & 5 deletions docs/pages/docs/features/custom-sidebar.mdx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
---
title: 'Customizing the Sidebar'
title: "Customizing the Sidebar"
---

While it's cool you don't *have to* configure a Sidebar, you'll probably quickly find that you want some order.
While it's cool you don't _have to_ configure a Sidebar, you'll probably quickly find that you want some order.
Luckily `ignite` makes this super easy.
All you have to do is create a file `_sidebar.md` inside `pages/docs` and start organizing you docs.

This can be as simple as a list of links:

```md
<!-- The following could link to "."", "./" or "./index" -->

- [Introduction](.)
- [Getting Started](./getting-started)
```
Expand All @@ -21,7 +22,7 @@ You can add a title between groups of links
```md
Welcome

- [Introduction](.)
- [Introduction](.)
- [Getting Started](./getting-started)

Features
Expand All @@ -39,9 +40,9 @@ Welcome
- [Introduction](.)
- [Getting Started](./getting-started)

---
---

Features

- [Custom Sidebar](./features/custom-sidebar)
```
```
9 changes: 6 additions & 3 deletions docs/pages/docs/features/home-page.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: 'Adding a Home Page'
title: "Adding a Home Page"
---

A home/cover page is useful to give a quick overview of the thing you're documenting.
Expand All @@ -25,6 +25,7 @@ To override this specify a different title in the front-matter.
---
title: "Some other title"
---

```

### Tagline
Expand All @@ -35,6 +36,7 @@ To display a tagline below the name of you project use the `tagline` property in
---
tagline: "The most flexible documenting website you've ever used"
---

```

### Color
Expand All @@ -43,6 +45,7 @@ Change the color of the main here and the `Getting Started` button

```yaml
---
color: 'red'
color: "red"
---
```

```
Loading

0 comments on commit 2bcdda5

Please sign in to comment.