Skip to content

Latest commit

 

History

History
186 lines (117 loc) · 4.3 KB

README.md

File metadata and controls

186 lines (117 loc) · 4.3 KB

👨 Gustavo Now Starter

A quick prototype for building a Gustavo Blog with Now

Gustavo makes it easy to write posts in Github Gists using markdown and publish using now to a specific url.

This repository documents getting a Gustavo blog setup quickly.

Learn more about Gustavo.


To use Gustavo

  • You need a shell app like terminal or iterm.
  • Github and Gist access, Docker.
  • It is written by developers using macs. Please file an issue with other notes for other OSs.

Setup   Deploying   Further Configuration   Custom Now Url   Cites and Thanks


Setup

create a Gustavo folder

mkdir <new gustavo repo> && cd <new gustavo repo>

create a Github gist

Check out [gustavo](https://github.com/eggplanetio/gustavo)! 🚀

<meta name="title" content="This is the first Gustavo gist">
<meta name="date" content="00/00/0000"><!-- provide a date -->

create a Gustavo config

echo 'module.exports = {\n
  title: 'My gustavo blog',\n
  gistId: '<< gist id >>',\n
}' > gustavo.config.js  

create a Dockerfile

Make sure docker is installed

echo 'FROM eggplanet/gustavo:latest' > Dockerfile
docker build -t <gustavo blog> .

# i.e.
# ----
# docker build -t learn-gustavo .

docker run -p 3000:3000 <gustavo blog>

# i.e.
# ----
# docker run -p 3000:3000 learn-gustavo


Deployment

Deployment can be done with Now.

Install now

npm i now -g

Login to now

now login

# provide email

# confirm login via email

Supply now with deployment information

now secrets add gustavo-gist-id <ID>

# i.e.
# ----
# now secrets add gustavo-gist-id 8affba6b231ca41a0b12f1ca7b14308b

now -e GIST_ID=@gustavo-gist-id --docker

Further Configuration

provide a github access token

module.exports = {
  title: '<< title >>',
  gistId: '<< gist id >>',
  githubToken: '<< token >>', /* github access token */
}

provide a Google Analytics Id

module.exports = {
  title: '<< title >>',
  gistId: '<< gist id >>',
  googleAnalyticsId: 'UA-X-XXXXX' /* google analytics id */
}

Deploying via Now with a Github Access Token

# add github token 
now secrets add gustavo-github-token <TOKEN>

# add gist id 
now secrets add gustavo-gist-id=<ID>

# deploy with github token and gist id
now -e GITHUB_TOKEN=@gustavo-github-token -e GIST_ID=@gustavo-gist-id --docker

More gist writing insights

TODO

Deploying Gustavo via Now with a specific URL

Now will provide a different url everytime gustavo is deployed, to provide now with a specific url.

# provide alias

now alias now alias <gustavo blog><now special url>.sh <gustavo blog>.blog

# i.e.
# ----
# now alias now alias <gustavo blog><now special url>.sh <gustavo blog>.blog

Cites and Thanks

Thanks to Brian Gonzolaz for building this awesome project and allowing me to hack on it with him. Reach out to us on the Gustavo project.