wildlifetrusts / nextdoornature

https://team-wilder-proto.pages.dev/
1 stars 1 forks source link

Set up Decap/Netlify CMS #7

Closed r-ferrier closed 1 year ago

r-ferrier commented 1 year ago

Tasks:

Initial research into l18n within the CMS, enabling non tech staff to manage translated copy:

Netlify CMS is now Decap CMS & includes localisation options.

More info on these here: https://www.npmjs.com/package/netlify-cms-locales https://www.netlifycms.org/docs/configuration-options/#locale

Can be added to the config.yml like so:

locale: 'cym'

And in js like so:

import CMS from 'netlify-cms-app';
import { de } from '
netlify-cms-locales';

CMS.registerLocale('cym', cym);

Defaults to english when translation is missing - would we need to do something at this point to force google translate to kick in? More info on this here:

https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites https://developers.google.com/search/docs/specialty/international/localized-versions

katjam commented 1 year ago

Wildlife Trusts IT people would prefer us to use:

Team SAML single sign-on | Netlify Docs

To circle back on one of the points related to authentication. During the call we discussed using Github as the authentication mechanism for the Netlify CMS. However on reviewing their documentation it appears they support Azure AD authentication which would be our preference as it would enable us to manage access via our existing infrastructure.

  • Tim
katjam commented 1 year ago

@r-ferrier Have you looked into the Azure integration? Do you need me to get account creds from them to test it?

r-ferrier commented 1 year ago

Self hosting netlify:

Once all the config stuff is added to our repo you need to authenticate the cms to get access to the repo using an oauth app, which needs to be hosted elsewhere.

Here's the walkthrough I found of someone else doing this

And here's the approach I was thinking of for our repo + cloudflare

katjam commented 1 year ago

@r-ferrier This is my admin/index.html

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <!-- We might eventually want to add to the project - but this is quick -->
  <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
</body>
</html>
katjam commented 1 year ago

And this is the head of the config.yml


backend:
  name: github
  repo: TheLabCollective/vector
  branch: main
media_folder: "/src/assets/images/uploads" # Media files will be stored in the repo under assets/images/uploads
public_folder: "/uploads" # The src attribute for uploaded media will begin with /uploads
collections:
r-ferrier commented 1 year ago

I tried this but was still getting some grumbling - will have another quick look tomorrow at the netlify settings though when my mind is a bit fresher

Screenshot 2023-04-18 at 15 29 47

katjam commented 1 year ago

Verified: image

image