Changed meta filenames to correct casing

- purely for cleanliness!
- we use kebabcase by default
- tests should be kebab-case-file_spec.js (one day we want this to be .test.js)
This commit is contained in:
Hannah Wolfe 2021-07-01 12:30:23 +01:00
parent 1785611db9
commit af4bfb8862
No known key found for this signature in database
GPG Key ID: 9F8C7532D0A6BA55
38 changed files with 47 additions and 47 deletions

View File

@ -1,4 +1,4 @@
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const _ = require('lodash');
function getAuthorFacebookUrl(data) {

View File

@ -1,5 +1,5 @@
const urlUtils = require('../../shared/url-utils');
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const _ = require('lodash');
function getAuthorImage(data, absolute) {

View File

@ -1,5 +1,5 @@
const urlService = require('../services/url');
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
function getAuthorUrl(data, absolute) {
let context = data.context ? data.context[0] : null;

View File

@ -1,5 +1,5 @@
const urlUtils = require('../../shared/url-utils');
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const _ = require('lodash');
function getCoverImage(data) {

View File

@ -1,4 +1,4 @@
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const _ = require('lodash');
function getCreatorTwitterUrl(data) {

View File

@ -4,28 +4,28 @@ const urlUtils = require('../../shared/url-utils');
const logging = require('@tryghost/logging');
// These are in filename order
const getAmpUrl = require('./amp_url');
const getAuthorFacebook = require('./author_fb_url');
const getAuthorImage = require('./author_image');
const getAuthorUrl = require('./author_url');
const getBlogLogo = require('./blog_logo');
const getCanonicalUrl = require('./canonical_url');
const getCoverImage = require('./cover_image');
const getCreatorTwitter = require('./creator_url');
const getAmpUrl = require('./amp-url');
const getAuthorFacebook = require('./author-fb-url');
const getAuthorImage = require('./author-image');
const getAuthorUrl = require('./author-url');
const getBlogLogo = require('./blog-logo');
const getCanonicalUrl = require('./canonical-url');
const getCoverImage = require('./cover-image');
const getCreatorTwitter = require('./creator-url');
const getDescription = require('./description');
const getExcerpt = require('./excerpt');
const getImageDimensions = require('./image-dimensions');
const getKeywords = require('./keywords');
const getModifiedDate = require('./modified_date');
const getOgType = require('./og_type');
const getOgImage = require('./og_image');
const getPaginatedUrl = require('./paginated_url');
const getPublishedDate = require('./published_date');
const getRssUrl = require('./rss_url');
const getModifiedDate = require('./modified-date');
const getOgType = require('./og-type');
const getOgImage = require('./og-image');
const getPaginatedUrl = require('./paginated-url');
const getPublishedDate = require('./published-date');
const getRssUrl = require('./rss-url');
const getSchema = require('./schema');
const getStructuredData = require('./structured_data');
const getStructuredData = require('./structured-data');
const getTitle = require('./title');
const getTwitterImage = require('./twitter_image');
const getTwitterImage = require('./twitter-image');
const getUrl = require('./url');
function getMetaData(data, root) {

View File

@ -1,10 +1,10 @@
// Public API (only used in proxy.js)
module.exports = {
get: require('./get-meta'), // ghost_head
getAssetUrl: require('./asset_url'), // asset
getAssetUrl: require('./asset-url'), // asset
getMetaDataExcerpt: require('./generate-excerpt'), // excerpt
getMetaDataDescription: require('./description'), // meta_desc
getMetaDataTitle: require('./title'), // meta_title
getPaginatedUrl: require('./paginated_url'), // page_url
getPaginatedUrl: require('./paginated-url'), // page_url
getMetaDataUrl: require('./url') // url
};

View File

@ -1,4 +1,4 @@
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
function getModifiedDate(data) {
let context = data.context ? data.context : null;

View File

@ -1,5 +1,5 @@
const _ = require('lodash');
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const urlUtils = require('../../shared/url-utils');
const settingsCache = require('../../shared/settings-cache');

View File

@ -1,4 +1,4 @@
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
function getPublishedDate(data) {
let context = data.context ? data.context[0] : null;

View File

@ -1,6 +1,6 @@
const _ = require('lodash');
const urlUtils = require('../../shared/url-utils');
const getContextObject = require('./context_object.js');
const getContextObject = require('./context-object.js');
const settingsCache = require('../../shared/settings-cache');
function getTwitterImage(data) {

View File

@ -4,7 +4,7 @@ const rewire = require('rewire');
const urlUtils = require('../../../core/shared/url-utils');
const testUtils = require('../../utils');
let getAmpUrl = rewire('../../../core/frontend/meta/amp_url');
let getAmpUrl = rewire('../../../core/frontend/meta/amp-url');
describe('getAmpUrl', function () {
let getUrlStub;
@ -12,7 +12,7 @@ describe('getAmpUrl', function () {
beforeEach(function () {
getUrlStub = sinon.stub();
getAmpUrl = rewire('../../../core/frontend/meta/amp_url');
getAmpUrl = rewire('../../../core/frontend/meta/amp-url');
getAmpUrl.__set__('getUrl', getUrlStub);
sinon.stub(urlUtils, 'urlJoin');

View File

@ -6,7 +6,7 @@ const settingsCache = require('../../../core/shared/settings-cache');
const configUtils = require('../../utils/configUtils');
const config = configUtils.config;
const getAssetUrl = rewire('../../../core/frontend/meta/asset_url');
const getAssetUrl = rewire('../../../core/frontend/meta/asset-url');
describe('getAssetUrl', function () {
afterEach(function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getAuthorFacebookUrl = require('../../../core/frontend/meta/author_fb_url');
const getAuthorFacebookUrl = require('../../../core/frontend/meta/author-fb-url');
describe('getAuthorFacebookUrl', function () {
it('should return author facebook url if post and has url',

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const getAuthorImage = require('../../../core/frontend/meta/author_image');
const getAuthorImage = require('../../../core/frontend/meta/author-image');
describe('getAuthorImage', function () {
afterEach(function () {

View File

@ -2,7 +2,7 @@ const should = require('should');
const sinon = require('sinon');
const ObjectId = require('bson-objectid');
const urlService = require('../../../core/frontend/services/url');
const getAuthorUrl = require('../../../core/frontend/meta/author_url');
const getAuthorUrl = require('../../../core/frontend/meta/author-url');
describe('getAuthorUrl', function () {
beforeEach(function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getBlogLogo = require('../../../core/frontend/meta/blog_logo');
const getBlogLogo = require('../../../core/frontend/meta/blog-logo');
const sinon = require('sinon');
const settingsCache = require('../../../core/shared/settings-cache');

View File

@ -4,7 +4,7 @@ const rewire = require('rewire');
const urlUtils = require('../../../core/shared/url-utils');
const testUtils = require('../../utils');
let getCanonicalUrl = rewire('../../../core/frontend/meta/canonical_url');
let getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url');
describe('getCanonicalUrl', function () {
let getUrlStub;
@ -12,7 +12,7 @@ describe('getCanonicalUrl', function () {
beforeEach(function () {
getUrlStub = sinon.stub();
getCanonicalUrl = rewire('../../../core/frontend/meta/canonical_url');
getCanonicalUrl = rewire('../../../core/frontend/meta/canonical-url');
getCanonicalUrl.__set__('getUrl', getUrlStub);
sinon.stub(urlUtils, 'urlJoin');

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const getContextObject = require('../../../core/frontend/meta/context_object.js');
const getContextObject = require('../../../core/frontend/meta/context-object.js');
const settingsCache = require('../../../core/shared/settings-cache');
describe('getContextObject', function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getCoverImage = require('../../../core/frontend/meta/cover_image');
const getCoverImage = require('../../../core/frontend/meta/cover-image');
describe('getCoverImage', function () {
it('should return absolute cover image url for home', function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getCreatorTwitterUrl = require('../../../core/frontend/meta/creator_url');
const getCreatorTwitterUrl = require('../../../core/frontend/meta/creator-url');
describe('getCreatorTwitterUrl', function () {
it('should return author twitter url if post and has url',

View File

@ -1,5 +1,5 @@
const should = require('should');
const getModifiedDate = require('../../../core/frontend/meta/modified_date');
const getModifiedDate = require('../../../core/frontend/meta/modified-date');
describe('getModifiedDate', function () {
it('should return updated at date as ISO 8601 from context if exists', function () {

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const getOgImage = require('../../../core/frontend/meta/og_image');
const getOgImage = require('../../../core/frontend/meta/og-image');
const settingsCache = require('../../../core/shared/settings-cache');
describe('getOgImage', function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getOgType = require('../../../core/frontend/meta/og_type');
const getOgType = require('../../../core/frontend/meta/og-type');
describe('getOgType', function () {
it('should return og type profile if context is type author', function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getPaginatedUrl = require('../../../core/frontend/meta/paginated_url');
const getPaginatedUrl = require('../../../core/frontend/meta/paginated-url');
const configUtils = require('../../utils/configUtils');
describe('getPaginatedUrl', function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getPublishedDate = require('../../../core/frontend/meta/published_date');
const getPublishedDate = require('../../../core/frontend/meta/published-date');
describe('getPublishedDate', function () {
it('should return published at date as ISO 8601 from context if exists', function () {

View File

@ -1,7 +1,7 @@
const should = require('should');
const sinon = require('sinon');
const routing = require('../../../core/frontend/services/routing');
const getRssUrl = require('../../../core/frontend/meta/rss_url');
const getRssUrl = require('../../../core/frontend/meta/rss-url');
describe('getRssUrl', function () {
beforeEach(function () {

View File

@ -1,5 +1,5 @@
const should = require('should');
const getStructuredData = require('../../../core/frontend/meta/structured_data');
const getStructuredData = require('../../../core/frontend/meta/structured-data');
describe('getStructuredData', function () {
it('should return structured data from metadata per post', function (done) {

View File

@ -1,6 +1,6 @@
const should = require('should');
const sinon = require('sinon');
const getTwitterImage = require('../../../core/frontend/meta/twitter_image');
const getTwitterImage = require('../../../core/frontend/meta/twitter-image');
const settingsCache = require('../../../core/shared/settings-cache');
describe('getTwitterImage', function () {