Skip to content

Commit

Permalink
Merge pull request #2 from tinacms/readme-tweaks
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
jamespohalloran authored Oct 26, 2022
2 parents 04d7313 + 22a2ad2 commit 87fb290
Show file tree
Hide file tree
Showing 7 changed files with 1,484 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are retrieved from your project at app.tina.io
TINA_CLIENT_ID=
TINA_TOKEN=
TINA_BRANCH=
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
.env
1,395 changes: 1,394 additions & 1 deletion .tina/__generated__/_graphql.json

Large diffs are not rendered by default.

50 changes: 49 additions & 1 deletion .tina/__generated__/_schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions .tina/config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@

import { defineStaticConfig } from "tinacms";

// Your hosting provider likely exposes this as an environment variable
const branch = process.env.HEAD || process.env.VERCEL_GIT_COMMIT_REF || "main";

export default defineStaticConfig({
branch,
clientId: null, // Get this from tina.io
token: null, // Get this from tina.io
clientId: process.env.TINA_CLIENT_ID!,
branch:
process.env.TINA_BRANCH! || // custom branch env override
process.env.VERCEL_GIT_COMMIT_REF! || // Vercel branch env
process.env.HEAD!, // Netlify branch env
token: process.env.TINA_TOKEN!,
build: {
outputFolder: "admin",
publicFolder: "static",
Expand Down
36 changes: 28 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
This is a [Tina CMS](https://tina.io/) project for Hugo.

## Local
This starter assume that you have Hugo installed on your local. If not, reference this [guide](https://gohugo.io/getting-started/installing/).
## Setup

- Fork this repo
- Clone the fork your local machine.
- This starter assumes that you have Hugo installed on your local machine. If not, reference [this guide](https://gohugo.io/getting-started/installing/).

## Local Development

Install the project's dependencies:

Expand All @@ -22,9 +27,9 @@ Open [http://localhost:1313](http://localhost:1313) with your browser to see the
Replace the `.env.example`, with `.env`

```
NEXT_PUBLIC_TINA_CLIENT_ID=<get this from the project you create at app.tina.io>
TINA_CLIENT_ID=<get this from the project you create at app.tina.io>
TINA_TOKEN=<get this from the project you create at app.tina.io>
NEXT_PUBLIC_TINA_BRANCH=<Specify the branch with Tina configured>
TINA_BRANCH=<Specify the branch with Tina configured>
```

Build the project:
Expand All @@ -33,13 +38,28 @@ Build the project:
yarn build
```

## Deploying the Site

This project can easily be deployed using services like [Netlify](https://www.netlify.com/) or [Vercel](https://vercel.com/).

### Build settings

In general, the build settings will look like so:

<img width="908" alt="hugo-build-settings" src="https://user-images.githubusercontent.com/3323181/198081223-c8830e49-2a77-4c7a-b1cf-bc9a44ca96cf.png">

### Environment variables

When setting up the Netlify/Vercel project, apply the `TINA_CLIENT_ID` & `TINA_TOKEN` environment variables from your [app.tina.io](https://app.tina.io) project.

The Hugo theme in this starter also depends on using a specific version of Hugo. Set the following environment variable as well:
`HUGO_VERSION`: `0.92.0`

## Learn More

To learn more about Tina, take a look at the following resources:

- [Tina Docs](https://tina.io/docs)
- [Getting starter guide](https://tina.io/guides/tina-cloud/starter/overview/)

You can check out [Tina Github repository](https://github.com/tinacms/tinacms) - your feedback and contributions are welcome!
- [Getting Started Guide](https://tina.io/guides/tinacms/non-react-based-ssg/guide/)

## [Deploy on Vercel](https://tina.io/guides/tina-cloud/add-tinacms-to-existing-site/deployment/)
You can check out the [Tina GitHub repository](https://github.com/tinacms/tinacms) - your feedback and contributions are welcome!
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"dev": "tinacms dev -c \"hugo server -D\"",
"build": "tinacms dev -c \"hugo\"",
"build": "tinacms build && hugo",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down

1 comment on commit 87fb290

@vercel
Copy link

@vercel vercel bot commented on 87fb290 Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tina-hugo-starter – ./

tina-hugo-starter.vercel.app
tina-hugo-starter-tinacms.vercel.app
tina-hugo-starter-git-main-tinacms.vercel.app

Please sign in to comment.