Skip to content
This repository has been archived by the owner on Aug 10, 2022. It is now read-only.

chore: Apply format and fixes from eslint-config-liferay #180

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
public
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: {
browser: true,
es6: true,
jest: true,
node: true,
},
extends: ['liferay/react'],
globals: {
__PATH_PREFIX__: true,
},
};
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.cache
build
public
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"bracketSpacing": false,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "es5",
"useTabs": true
}
21 changes: 14 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
stages:
- smoke
- lint

language: node_js
node_js: '9'
node_js: '8'

before_install:
- nvm install 9
- nvm install 8
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.1
- export PATH=$HOME/.yarn/bin:$PATH

cache:
yarn: true
cache: yarn

install:
- yarn

script:
- rm -rf public/ .cache/
- yarn build
jobs:
include:
- stage: smoke
install: rm -rf public/ .cache/ && yarn
script: yarn build
- stage: lint
script: yarn format:check && yarn lint
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
[![Build Status](https://img.shields.io/travis/diegonvs/gatsby-boilerplate/master.svg?style=flat)](https://travis-ci.org/diegonvs/gatsby-boilerplate)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)


Gatsby Boilerplate is a [Gatsby](https://github.com/gatsbyjs/gatsby) starter with a better development experience and the same content creation experience than [Electric.js](https://github.com/electricjs/electric).

Feel free to contribute with issues and PRs!

# Documentation

If you want to check the documentation 📚 click on this [link](https://github.com/diegonvs/gatsby-boilerplate/wiki).

# Setup

0. Clone this repo or use Gatsby command line interface using `gatsby new [your_site] https://github.com/diegonvs/gatsby-boilerplate` or `git clone https://github.com/diegonvs/gatsby-boilerplate.git`
1. Make sure that you have [yarn](https://yarnpkg.com/en/) installed
2. Navigate to project folder and run `yarn`
3. Run `npm run develop` or `yarn develop` for development mode or run `npm run build` or `yarn build` for production mode
4. If you want serve your production build just run `npm run serve` or `yarn serve`
1. Navigate to project folder and run `yarn`
1. Run `npm run develop` or `yarn develop` for development mode or run `npm run build` or `yarn build` for production mode
1. If you want serve your production build just run `npm run serve` or `yarn serve`

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ While this is going to be a big change for professional coffee tasters, it means

The Specialty Coffee Association of America (SCAA), founded in 1982, is a non-profit trade organization for the specialty coffee industry. With members located in more than 40 countries, SCAA represents every segment of the specialty coffee industry, including:

* producers
* roasters
* importers/exporters
* retailers
* manufacturers
* baristas
- producers
- roasters
- importers/exporters
- retailers
- manufacturers
- baristas

For over 30 years, SCAA has been dedicated to creating a vibrant specialty coffee community by recognizing, developing and promoting specialty coffee. SCAA sets and maintains quality standards for the industry, conducts market research, and provides education, training, resources, and business services for its members.

Coffee cupping, or coffee tasting, is the practice of observing the tastes and aromas of brewed coffee. It is a professional practice but can be done informally by anyone or by professionals known as "Q Graders". A standard coffee cupping procedure involves deeply sniffing the coffee, then loudly slurping the coffee so it spreads to the back of the tongue.

The coffee taster attempts to measure aspects of the coffee's taste, specifically the body (the texture or mouthfeel, such as oiliness), sweetness, acidity (a sharp and tangy feeling, like when biting into an orange), flavour (the characters in the cup), and aftertaste. Since coffee beans embody telltale flavours from the region where they were grown, cuppers may attempt to identify the coffee's origin.
The coffee taster attempts to measure aspects of the coffee's taste, specifically the body (the texture or mouthfeel, such as oiliness), sweetness, acidity (a sharp and tangy feeling, like when biting into an orange), flavour (the characters in the cup), and aftertaste. Since coffee beans embody telltale flavours from the region where they were grown, cuppers may attempt to identify the coffee's origin.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ The Chemex Coffeemaker consists of an hourglass-shaped glass flask with a conica

The most visually distinctive feature of the Chemex is the heatproof wooden collar around the neck, allowing it to be handled and poured when full of hot water. This is turned, then split in two to allow it to fit around the glass neck. The two pieces are held loosely in place by a tied leather thong. The pieces are not tied tightly and can still move slightly, retained by the shape of the conical glass.

For a design piece that became popular post-war at a time of Modernism and precision manufacture, this juxtaposition of natural wood and the organic nature of a hand-tied knot with the laboratory nature of glassware was a distinctive feature of its appearance.
For a design piece that became popular post-war at a time of Modernism and precision manufacture, this juxtaposition of natural wood and the organic nature of a hand-tied knot with the laboratory nature of glassware was a distinctive feature of its appearance.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ author: Matuzalém Teles
banner: images/jamaicanbluemountain.jpg
date: 2017-01-04T15:04:10.000Z
description: >-
We’re proud to announce that we’ll be offering a small batch of Jamaica Blue
Mountain coffee beans in our store next week.
We’re proud to announce that we’ll be offering a small batch of Jamaica Blue
Mountain coffee beans in our store next week.
title: 'Just in: small batch of Jamaican Blue Mountain in store next week'
---

Expand All @@ -16,7 +16,7 @@ Blue Mountain Peak is the highest mountain in Jamaica and one of the highest pea

The Blue Mountains are considered by many to be a hiker's and camper's paradise. The traditional Blue Mountain trek is a 7-mile hike to the peak and consists of a 3,000-foot increase in elevation. Jamaicans prefer to reach the peak at sunrise, thus the 3–4 hour hike is usually undertaken in darkness. Since the sky is usually very clear in the mornings, Cuba can be seen in the distance.

>Some of the plants found on the Blue Mountain cannot be found anywhere else in the world and they are often of a dwarfed sort.
> Some of the plants found on the Blue Mountain cannot be found anywhere else in the world and they are often of a dwarfed sort.

This is mainly due to the cold climate which inhibits growth. The small coffee farming communities of Claverty Cottage and Hagley Gap are located near the peak.

Expand All @@ -28,4 +28,4 @@ Jamaican Blue Mountain Coffee or Jamaica Blue Mountain Coffee is a classificatio

Jamaican Blue Mountain Coffee is a globally protected certification mark, meaning only coffee certified by the Coffee Industry Board of Jamaica can be labeled as such. It comes from a recognized growing region in the Blue Mountain region of Jamaica, and its cultivation is monitored by the Coffee Industry Board of Jamaica.

The Blue Mountains are generally located between Kingston to the south and Port Antonio to the north. Rising 7,402 ft, they are some of the highest mountains in the Caribbean. The climate of the region is cool and misty with high rainfall. The soil is rich, with excellent drainage. This combination of climate and soil is considered ideal for coffee.
The Blue Mountains are generally located between Kingston to the south and Port Antonio to the north. Rising 7,402 ft, they are some of the highest mountains in the Caribbean. The climate of the region is cool and misty with high rainfall. The soil is rich, with excellent drainage. This combination of climate and soil is considered ideal for coffee.
2 changes: 1 addition & 1 deletion content/blog/2018-11-07-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ needsAuth: false

![doge](/gatsby-boilerplate/images/hoohay.jpg)

Check it out at https://gatsby-boilerplate.wedeploy.io
Check it out at https://gatsby-boilerplate.wedeploy.io
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ author: Bryan H Cheung
banner: https://community.liferay.com/o/osb-community-theme/images/header-bg.jpg
date: 2018-12-11T12:00:00.000Z
description: I’m happy to announce we will be returning out of the box support for clustering with the release of Liferay Portal 7.1 CE GA3.
title: Liferay Portal CE Clustering Returns
title: Liferay Portal CE Clustering Returns
needsAuth: false
url: https://community.liferay.com/blogs/-/blogs/liferay-portal-ce-clustering-returns
---
---
18 changes: 11 additions & 7 deletions content/docs/additional-features.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
---
title: "Additional Features"
title: 'Additional Features'
order: 3
---

## Auth

If you want to restrict a page, you can use `needsAuth` frontmatter on the top of any markdown file. When you set to true, this page will be restricted for private users only.

This authentication is provided by a [WeDeploy Auth](https://wedeploy.com/docs/auth/getting-started/) service that can be set on a `.env.production` or `.env.development` file. These files configuration will be explained in the next section.

## Progressive Web App support
Gatsby Boilerplate is a Progressive Web App, if you aren't familiar with this term, check this [link](https://developers.google.com/web/progressive-web-apps/).

During the development, this boilerplate was battle tested to turns it into a real PWA covering all [PWA checklist](https://developers.google.com/web/progressive-web-apps/checklist).
Gatsby Boilerplate is a Progressive Web App, if you aren't familiar with this term, check this [link](https://developers.google.com/web/progressive-web-apps/).

During the development, this boilerplate was battle tested to turns it into a real PWA covering all [PWA checklist](https://developers.google.com/web/progressive-web-apps/checklist).

We could personalize our [progressive web app manifest file](https://developers.google.com/web/fundamentals/web-app-manifest/?hl=en) changing the values on `Gatsby-config.js` file.
We could personalize our [progressive web app manifest file](https://developers.google.com/web/fundamentals/web-app-manifest/?hl=en) changing the values on `Gatsby-config.js` file.

>PS: this files will be created only in build time when you perform a `gatsby build`.
> PS: this files will be created only in build time when you perform a `gatsby build`.

## Offline Support
We could personalize what type of files we can cache on `Gatsby-config.js` file on `gatsby-plugin-offline` options.

We could personalize what type of files we can cache on `Gatsby-config.js` file on `gatsby-plugin-offline` options.
Default extensions are: `js,jpg,png,gif,html,css,svg`

## GZIP compression
If you want to disable the default zopfli plugin to compress our files just remove `gatsby-plugin-zopfli` on `Gatsby-config.js`.

If you want to disable the default zopfli plugin to compress our files just remove `gatsby-plugin-zopfli` on `Gatsby-config.js`.

## Config and enviroment(.env) files

Gatsby uses a standard to define [enviroment variables](https://en.wikipedia.org/wiki/Environment_variable) on his code.

You can provide environment variables to your site to customize its behavior in different environments. Gatsby Boilerplate offers two possible files: `.env.production` which is used to set environment variables on production and `.env.development` that can be used to set environment variables on development.
17 changes: 9 additions & 8 deletions content/docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Deployment"
title: 'Deployment'
order: 4
---

Expand All @@ -10,6 +10,7 @@ Hey, it's great to see you here! 💖
Here, in this article, I'll teach you how to deploy your website started from Gatsby Boilerplate on [WeDeploy](https://wedeploy.com).

> # TL;DR
>
> This guide teach you how to deploy using WeDeploy, but you can use the same strategy of deployment exposing `public` folder to your favorite host folder.

### WeDeploy
Expand Down Expand Up @@ -37,12 +38,12 @@ Here, in this article, I'll teach you how to deploy your website started from Ga

```json
{
"id": "<your-auth-service-id>",
"image": "wedeploy/auth:2.8.0",
"env": {
"WEDEPLOY_AUTH_SECURE_FIELDS": "providers, email, password, resetKey, supportedScopes",
"WEDEPLOY_AUTH_PASSWORD": "true"
}
"id": "<your-auth-service-id>",
"image": "wedeploy/auth:2.8.0",
"env": {
"WEDEPLOY_AUTH_SECURE_FIELDS": "providers, email, password, resetKey, supportedScopes",
"WEDEPLOY_AUTH_PASSWORD": "true"
}
}
```

Expand All @@ -52,6 +53,6 @@ For more information configuring this `wedeploy.json` for auth service, check th

_Considering that you have installed `wedeploy` command line interface, if not, check this [link](https://wedeploy.com/docs/intro/using-the-command-line/)_

Just fire 'we deploy' on `public/` and on `public/auth` folder to deploy your Gatsby Boilerplate instance to the cloud and see magic happening
Just fire 'we deploy' on `public/` and on `public/auth` folder to deploy your Gatsby Boilerplate instance to the cloud and see magic happening

🔥 🔥 🔥 🔥 🔥 🌈 🌈 🌈 🌈 🌈
19 changes: 10 additions & 9 deletions content/docs/environment-variables.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
title: "Enviroment Variables"
title: 'Enviroment Variables'
order: 5
---

## Config and enviroment(.env) files

Gatsby uses a standard to define [enviroment variables](https://en.wikipedia.org/wiki/Environment_variable) on his code.

You can provide environment variables to your site to customize its behavior in different environments. Gatsby Boilerplate offers two possible files: `.env.production` which is used to set environment variables on production and `.env.development` that can be used to set environment variables on development.

Gatsby Boilerplate uses the following environment variables:

- `ALGOLIA_API_KEY` is used to set the API Key for [Algolia search](https://www.algolia.com/doc/guides/security/api-keys/) service.
- `ALGOLIA_INDEX_NAME` is used to set another one necessary Algolia credential to use the service.
- `GA_TRACKING_ID` is used to set the tracking ID for Google Analytics track your app using `gatsby-google-analytics` plugin.
- `GITHUB_REPO` is used to make references of a repo that have been passed to some components like Footer, Navigation...
- `PROJECT_NAME` is used to define some titles on the page. Default value: `Gatsby Boilerplate`.
- `WEDEPLOY_AUTH_SERVICE_URL` is used to set your WeDeploy auth service URL. More info on this [link](https://wedeploy.com/tutorials/auth-web/get-started/)
- `WEDEPLOY_MASTER_TOKEN` is used to set your WeDeploy project's master token.
- `ALGOLIA_API_KEY` is used to set the API Key for [Algolia search](https://www.algolia.com/doc/guides/security/api-keys/) service.
- `ALGOLIA_INDEX_NAME` is used to set another one necessary Algolia credential to use the service.
- `GA_TRACKING_ID` is used to set the tracking ID for Google Analytics track your app using `gatsby-google-analytics` plugin.
- `GITHUB_REPO` is used to make references of a repo that have been passed to some components like Footer, Navigation...
- `PROJECT_NAME` is used to define some titles on the page. Default value: `Gatsby Boilerplate`.
- `WEDEPLOY_AUTH_SERVICE_URL` is used to set your WeDeploy auth service URL. More info on this [link](https://wedeploy.com/tutorials/auth-web/get-started/)
- `WEDEPLOY_MASTER_TOKEN` is used to set your WeDeploy project's master token.

For more information to improve this file, check this [guide](https://www.gatsbyjs.org/docs/environment-variables/).
For more information to improve this file, check this [guide](https://www.gatsbyjs.org/docs/environment-variables/).
6 changes: 3 additions & 3 deletions content/docs/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
redirect: "/docs/migration-from-electric/first-considerations/what-is.html"
title: "Documentation"
---
redirect: '/docs/migration-from-electric/first-considerations/what-is.html'
title: 'Documentation'
---
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
redirect: "/docs/migration-from-electric/first-considerations/what-is.html"
title: "First Considerations"
redirect: '/docs/migration-from-electric/first-considerations/what-is.html'
title: 'First Considerations'
order: 1
alwaysActive: true
---
---
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
---
title: "Structure"
title: 'Structure'
order: 3
---

## `Content` folder

For changes on content, you could use the `content` folder located on the root of the generated project. Note that markdown receives some variables(called `frontmatter`) on top of the file, we will use a lot of them to personalize content, rules of visualization and website integration with services like Auth for example.
Note that we have a folder for each template and each template has his particularities.

>Note that this page is exactly the same as `pages` folder on Electric.
> Note that this page is exactly the same as `pages` folder on Electric.

## `Pages` folder

We could create static OOTB(out of the box, without a template) pages using this folder. Check this [link](https://www.gatsbyjs.org/docs/creating-and-modifying-pages/).

## `Static` folder

Here, we can host our static assets, like images, videos, JSON to our application consume. Note that during build process all folders and files will be served on the root of the output build folder, called `public`.

## GraphQL

Gatsby uses GraphQL to load data into project's React components during Server-Side Rendering, check this [link](https://www.gatsbyjs.org/docs/querying-with-graphql/), thereby, you must be familiar with this tool to provide better customizations(like new frontmatter fields, API changes) for your web app.

## Markdown Rendering

On Gatsby Boilerplate all content that will be inserted on each page it's inserted using Markdown, the same content template language of Electric. Check [this](https://guides.github.com/features/mastering-markdown/) 3 minutes tutorial to be familiar with Markdown if you aren't familiar.

Gatsby Boilerplate uses [Gatsby MDX](https://github.com/ChristopherBiscardi/gatsby-mdx) for render Markdown.

## Last but not least important
- We don't use `layout` frontmatter variable as a variable to define what template can be used because Gatsby Boilerplate resolves it for us using the folder name. This variable is called internally `templateKey` if you want to check how it's implemented.

- Note that, like Electric, our page URL is the same as the name of the correspondent Markdown file.
- We don't use `layout` frontmatter variable as a variable to define what template can be used because Gatsby Boilerplate resolves it for us using the folder name. This variable is called internally `templateKey` if you want to check how it's implemented.

- Note that, like Electric, our page URL is the same as the name of the correspondent Markdown file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Styling"
title: 'Styling'
order: 2
---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
---
title: "What is?"
title: 'What is?'
order: 1
---

## What is Electric and Gatsby?

These platforms have been created to build static pages and help developers to create amazing websites using an established Front End architecture.

## So, what the status of this platforms?

Gatsby is maintained by a powerful community and it's made by super community-backed tools like React and GraphQL. Actually(November 2018) a lot of websites were built using this tool, check this [link](https://www.gatsbyjs.org/showcase/) for Gatsby's showcase.

Electric was maintained by Liferay using some internal tools like Metal.js and Senna.js to be a sandbox for this tools. However, Liferay had discontinued this project due to internal decisions.
Expand Down
6 changes: 3 additions & 3 deletions content/docs/migration-from-electric/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
redirect: "/docs/migration-from-electric/first-considerations/what-is.html"
title: "Migration From Electric"
redirect: '/docs/migration-from-electric/first-considerations/what-is.html'
title: 'Migration From Electric'
alwaysActive: true
order: 1
---
---
Loading