Using common for socials definitions.
This commit is contained in:
@@ -19,7 +19,7 @@ import { curateStash } from './stashes.js';
|
||||
import escape from '../utils/escape-manticore.js';
|
||||
import slugify from '../utils/slugify.js';
|
||||
import { curateRevision } from './revisions.js';
|
||||
import { interpolateProfiles } from '../common/actors.mjs'; // eslint-disable-line import/namespace
|
||||
import { interpolateProfiles, platformsByHostname } from '../common/actors.mjs'; // eslint-disable-line import/namespace
|
||||
import { resolvePlace } from '../common/geo.mjs'; // eslint-disable-line import/namespace
|
||||
|
||||
const logger = initLogger();
|
||||
@@ -824,16 +824,6 @@ function convertWeight(weight, units) {
|
||||
return Number(weight) || null;
|
||||
}
|
||||
|
||||
const platformsByHostname = Object.fromEntries(Object.entries(config.socials.urls).map(([platform, url]) => {
|
||||
const { hostname, pathname } = new URL(url);
|
||||
|
||||
return [hostname, {
|
||||
platform,
|
||||
pathname: decodeURIComponent(pathname),
|
||||
url,
|
||||
}];
|
||||
}));
|
||||
|
||||
function curateSocials(socials) {
|
||||
return socials.map((social) => {
|
||||
if (!social.handle && !social.url) {
|
||||
|
||||
Reference in New Issue
Block a user