Notes from this week 3

Netlify CMS on self-hosted GitLab #

I started playing with Netlify CMS more and wanted to get it to work with a self-hosted gitlab setup.

This stack overflow post gives a good answer on how to set it up.

The config.yml has something like this:

backend:
name: gitlab
repo: owner-name/repo-name # Path to your GitLab repository
auth_type: implicit # Required for implicit grant
app_id: your-app-id # Application ID from your GitLab settings
api_root: https://my-hosted-gitlab-instance.com/api/v4
base_url: https://my-hosted-gitlab-instance.com
auth_endpoint: oauth/authorize

On Gitlab: Setup an application on Gitlab to get the app_id and to set the Redirect URI, enter the address where you access Netlify CMS, for example, https://www.example.com/admin/. For scope, select api

I found it easiest to use Netlify CLI to init the project with Netlify rather than trying to reconfigure one of my current projects.

I did run into a few issues attempting to get the Netlify Identity running so that users wouldn't need to use Gitlab to log in but this is still a work in progress. Let me know on twitter if you have some ideas.

Lazyloading with lozad.js #

I sped up this website with some lazy loading. I played with a few third-party scripts and found I liked Lozad.js because it has no other dependencies like jQuery and it supports <img>, <picture>, iframes, videos, audios, responsive images, background images etc.

Some of the loading transitions I was using were waiting until the page loaded which meant on pages with images on iframed Spotify embeds it would not be as seamless as I wanted.

The spotify playlist below should load only when scrolled to.

Coding music #