chore: update gatsby to v3 (#5057)
This commit is contained in:
@ -29,7 +29,7 @@ If your generator isn't listed here, you can check its documentation, or as a sh
|
||||
|
||||
Inside the `admin` folder, you'll create two files:
|
||||
|
||||
```x
|
||||
```bash
|
||||
admin
|
||||
├ index.html
|
||||
└ config.yml
|
||||
@ -277,4 +277,4 @@ If you left your site registration open, or for return visits after confirming a
|
||||
|
||||
**Note:** No matter where you access Netlify CMS — whether running locally, in a staging environment, or in your published site — it always fetches and commits files in your hosted repository (for example, on GitHub), on the branch you configured in your Netlify CMS config.yml file. This means that content fetched in the admin UI matches the content in the repository, which may be different from your locally running site. It also means that content saved using the admin UI saves directly to the hosted repository, even if you're running the UI locally or in staging.
|
||||
|
||||
Happy posting!
|
||||
Happy posting!
|
||||
|
@ -634,7 +634,7 @@ collections:
|
||||
```
|
||||
|
||||
Nested collections expect the following directory structure:
|
||||
```
|
||||
```bash
|
||||
content
|
||||
└── pages
|
||||
├── authors
|
||||
@ -646,4 +646,4 @@ content
|
||||
├── hello-world
|
||||
│ └── index.md
|
||||
└── index.md
|
||||
```
|
||||
```
|
||||
|
@ -8,14 +8,14 @@ This guide will help you get started using Netlify CMS and Middleman.
|
||||
## Installation
|
||||
To get up and running with Middleman, you need both the Ruby language runtime and RubyGems installed on your computer. Check out the [Middleman installation docs](https://middlemanapp.com/basics/install/) for more details. If you already have your environment set up, use the following command to install Middleman:
|
||||
|
||||
```
|
||||
```bash
|
||||
gem install middleman
|
||||
```
|
||||
|
||||
## Create a new Middleman site
|
||||
Let's create a new site from scratch. Run the following commands in the terminal, in the folder where you'd like to create the blog:
|
||||
|
||||
```
|
||||
```bash
|
||||
middleman init blog
|
||||
cd blog
|
||||
```
|
||||
@ -23,12 +23,12 @@ cd blog
|
||||
### Add the Middleman blog extension
|
||||
Middleman has an official extension to support blogging, articles and tagging. `middleman-blog` ships as an extension and must be installed to use. Simply specify the gem in your Gemfile:
|
||||
|
||||
```
|
||||
```bash
|
||||
gem "middleman-blog"
|
||||
```
|
||||
Install the dependencies and run Middleman with the following commands:
|
||||
|
||||
```
|
||||
```bash
|
||||
bundle install
|
||||
middleman server
|
||||
```
|
||||
@ -50,7 +50,7 @@ This is an example article. You probably want to delete it and write your own ar
|
||||
### Activate the blog extension
|
||||
We can then activate the blog in `config.rb`. Be sure to check out the [Middleman blogging docs](https://middlemanapp.com/basics/blogging/) for all the configuration options.
|
||||
|
||||
```
|
||||
```bash
|
||||
activate :blog do | blog |
|
||||
blog.permalink = "blog/{title}.html"
|
||||
blog.sources = "posts/{year}-{month}-{day}-{title}.html"
|
||||
@ -61,7 +61,7 @@ end
|
||||
### Load the articles
|
||||
Time to load our articles in `index.html.erb`.
|
||||
|
||||
```
|
||||
```ruby
|
||||
<h1>Recent articles</h1>
|
||||
|
||||
<% blog.articles.each do | article | %>
|
||||
@ -78,7 +78,7 @@ Time to load our articles in `index.html.erb`.
|
||||
|
||||
### Add an article layout
|
||||
In the last step before we add Netlify CMS, we add a layout for the article page. Create a new layout `source/layouts/blog-layout.html.erb`. For now we will get the title and the content:
|
||||
```
|
||||
```ruby
|
||||
<h1>
|
||||
<%= current_page.data.title %>
|
||||
</h1>
|
||||
@ -91,7 +91,7 @@ Now that we have a functioning blog, let's get started with Netlify CMS!
|
||||
## Add Netlify CMS to your site
|
||||
|
||||
Create two files in a new folder called `admin`, `index.html` and `config.yml`. Also add an `upload` folder in the images directory that will function as our `media_folder`.
|
||||
```
|
||||
```bash
|
||||
├── source
|
||||
│ ├── admin
|
||||
│ │ ├── index.html
|
||||
@ -104,7 +104,7 @@ Create two files in a new folder called `admin`, `index.html` and `config.yml`.
|
||||
|
||||
In the newly created `index.html` we add scripts for Netlify CMS and the Netlify Identity Widget:
|
||||
|
||||
```
|
||||
```html
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
@ -125,7 +125,7 @@ In the newly created `index.html` we add scripts for Netlify CMS and the Netlify
|
||||
|
||||
For the purpose of this guide we will deploy to Netlify from a GitHub repository which requires the minimum configuration. In `config.yml` file paste the following code:
|
||||
|
||||
```
|
||||
```yml
|
||||
backend:
|
||||
name: git-gateway
|
||||
|
||||
@ -149,7 +149,7 @@ collections:
|
||||
### Push to GitHub
|
||||
It's now time to commit your changes and push to GitHub.
|
||||
|
||||
```
|
||||
```bash
|
||||
git init
|
||||
git add .
|
||||
git commit -m "Initial Commit"
|
||||
@ -176,4 +176,4 @@ It's time to create your first blog post. Login to your site's `/admin/` page an
|
||||
|
||||
Then Netlify will detect that there was a commit in your repo, and will start rebuilding your project. When your project is deployed you'll be able to see the post you created.
|
||||
|
||||
Be sure to checkout the official [Middleman Starter](https://github.com/tomrutgers/middleman-starter-netlify-cms) for more examples.
|
||||
Be sure to checkout the official [Middleman Starter](https://github.com/tomrutgers/middleman-starter-netlify-cms) for more examples.
|
||||
|
@ -32,7 +32,7 @@ In repositories enabled with Netlify Large Media, Netlify CMS will use the image
|
||||
|
||||
You can disable the automatic image transformations with the `use_large_media_transforms_in_media_library` configuration setting, nested under `backend` in the CMS `config.yml` file:
|
||||
|
||||
```
|
||||
```yaml
|
||||
backend:
|
||||
name: git-gateway
|
||||
## Set to false to prevent transforming images in media gallery view
|
||||
|
@ -196,7 +196,7 @@ Create a new repository at GitHub (or one of the other supported git services) a
|
||||
|
||||
Now is probably also a good time to add a `.gitignore` file:
|
||||
|
||||
```
|
||||
```bash
|
||||
.next/
|
||||
node_modules/
|
||||
/npm-debug.log
|
||||
|
@ -70,7 +70,7 @@ You can build whatever collections and content modeling you want. The important
|
||||
|
||||
In your root directory, you can create a new directory `content/`. As you might guess, this is where our content will live. Your filesystem should look about like this, so far:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
root/
|
||||
├ content/
|
||||
├ components/
|
||||
@ -266,4 +266,4 @@ export default {
|
||||
};
|
||||
```
|
||||
|
||||
To see the generated site, navigate to name-of-your-website.netlify.app/blog
|
||||
To see the generated site, navigate to name-of-your-website.netlify.app/blog
|
||||
|
@ -52,17 +52,17 @@ Users who _do_ have write access to the original repository continue to use the
|
||||
## Linking to specific entries in the CMS
|
||||
Open authoring often includes some sort of "Edit this page" link on the live site. Netlify CMS supports this via the **edit** path:
|
||||
|
||||
```
|
||||
```js
|
||||
/#/edit/{collectionName}/{entryName}
|
||||
```
|
||||
|
||||
For the entry named "general" in the "settings" file collection
|
||||
```
|
||||
```html
|
||||
https://www.example.com/path-to-cms/#/edit/settings/general
|
||||
```
|
||||
|
||||
For blog post "test.md" in the "posts" folder collection
|
||||
```
|
||||
```html
|
||||
https://www.example.com/path-to-cms/#/edit/posts/test
|
||||
```
|
||||
|
||||
|
@ -15,7 +15,7 @@ Use angle brackets for placeholders. Tell the reader what a placeholder represen
|
||||
|
||||
1. Display information about a cli command:
|
||||
|
||||
```
|
||||
```bash
|
||||
npm install <package-name>
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user