-
Notifications
You must be signed in to change notification settings - Fork 39
Editing with Netlify CMS
Probably the most common regular operation on the site will be to write new newsletter posts, and modify the site's pages to be up to date.
To facilitate this very common operation, the site uses Netlify CMS at cssbham.com/admin. Essentially, it provides a fancy web user interface to the repository. All of the information that's presented on the admin portal is only gathered from the GitHub repository, which is effectively the source of all truth.
To access the CMS, go to cssbham.com/admin, where you'll be presented with a login screen. Note that you shouldn't need to be a member of the CSS GitHub organization to login, though you might need to be to actually save your edits.
Click the login button, and you'll be asked to authorize the CSS admin portal application, if you haven't already. If at any point you want to revoke permissions for the app, you can do so in your Github Application Settings.
Once you've logged in, you'll have access to the admin portal. There are 3 main views; Contents, Workflow, and Media.
The contents tab is where you'll have access to modify all of the site collections. There are a number of collection types, however, under the hood they are all represented as markdown files with some additional fields.
Inside a collection, you'll have the ability to view and edit all existing items in the collection as well as create a new item.
The editing interface for individual items can be slightly confusing. On the left, you can edit the actual page content, while on the right, you can see a live preview of what it should look like. These are not accurate of what they will actually look like (there may be a way to make them actually accurate, but I'm not sure how, and haven't looked hard into it).
Each type of content in a collection is different - for example, clubs are different from posts, which are different from pages. However, all of them should have a title and a block of markdown content. Try and fill in all of the available fields if you can.
Side note: sometimes when adding content, it can be difficult to work out which type of content is most appropriate. To get an idea, look at the types of content in each category and work out which it's most similar to. As a general rule, pages linked to a specific date and time should be a Newsletter, general information should be a Page, and any workshops/clubs should be a Club.
When you make changes on the Netlify CMS, and you click save, they're not immediately put onto the live site. Under the hood, they're made in to a GitHub Pull Request. This is so that other members of the committee have a chance to weigh in and review your changes before they go live.
The Workflow tab gives you the ability to see an overview of all of the waiting changes that haven't been fully approved. This is a super handy way to see what other people have been working on, as well as allowing different committee members to make different changes across the site without walking all over each other.
You can change the status of the PR and move it between the Draft, In Review, and Ready states (though they don't really have any influence, and are just useful labels).
Once you're ready, you can publish your changes by clicking the Publish button. Note that you won't be able to do this unless someone has approved your Pull Request (this is enforced by branch protection in the GitHub repository settings).
The Media tab lets you upload images, videos, etc to the site that you can
use them in your site content. To reference an asset from markdown, prefix
the filename with /assets/images/
. So if your image name is "abc.png",
reference it using the URL "/assets/images/abc.png".