getUrlByResourceId(id, options = {}) {
        const obj = this.urls.getByResourceId(id);

        if (obj) {
            if (options.absolute) {
                return this.utils.createUrl(obj.url, options.absolute);
            }

            if (options.withSubdirectory) {
                return this.utils.createUrl(obj.url, false, true);
            }

            return obj.url;
        }

        if (options.absolute) {
            return this.utils.createUrl('/404/', options.absolute);
        }

        if (options.withSubdirectory) {
            return this.utils.createUrl('/404/', false);
        }

        return '/404/';
    }
@description Get url by resource id.

If we can't find a url for an id, we have to return a url.
There are many components in Ghost which call `getUrlByResourceId` and
based on the return value, they set the resource url somewhere e.g. meta data.
Or if you define no collections in your yaml file and serve a page.
You will see a suggestion of posts, but they all don't belong to a collection.
They would show localhost:2368/null/.

@param {String} id
@param {Object} [options]
@param {Object} [options.absolute]
@param {Object} [options.withSubdirectory]
@returns {String}