Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make description optional (and tweak prettier config) #16

Merged
merged 1 commit into from
Aug 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"printWidth": 120,
"jsxSingleQuote": true,
"printWidth": 100,
"quoteProps": "as-needed",
"semi": false,
"singleQuote": true,
Expand Down
4 changes: 2 additions & 2 deletions app/layouts/DefaultLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import React from 'react'
import { Helmet } from 'react-helmet'
import favicon from './favicon.png'

export default function DefaultLayout ({ meta, children }) {
export default function DefaultLayout({ meta, children }) {
return (
<div role='main'>
<Helmet>
<title>{meta.title}</title>
<meta name='description' content={meta.description} />
{meta.description ? <meta name='description' content={meta.description} /> : null}
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link rel='alternate' href='/feed.json' type='application/json' />
<link rel='icon' href={favicon} />
Expand Down
8 changes: 6 additions & 2 deletions app/pages/example-post.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!--
Example of a page written in Markdown (MDX) in a .mdx file.

Every page should export a `meta` object with at least a `title` and `description`.
This one also exports a `collection` and `date` to signify it's part of the "posts" collection.
Every page should export a `meta` object with at least a `title`.
This one also exports:

- `description` (used in the meta description tag)
- `collection` with a value of 'posts' (so its included in the built-in 'posts' collection. You can create other collections too!)
- `date` (used to order the 'posts' collection)
-->
export const meta = {
title: 'Example Post',
Expand Down
5 changes: 2 additions & 3 deletions app/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Example of a page written as a React component in a .js file.

// Every page should export a `meta` object with at least a title and description.
// Every page should export a `meta` object with at least a title.
export const meta = {
title: 'Your Tropical site',
description: ''
title: 'Your Tropical site'
}

import React from 'react'
Expand Down