mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 00:38:27 +00:00
Replace use_pack, layouts/theme and @theme by new helpers
Packs are now loaded from views, just like upstream, and are identified by their filenames. The definition of `theme.yml` has changed as such: - `pack_directory` is now required - `pack` is now unused - `signed_in_preload` has been introduced
This commit is contained in:
@@ -14,18 +14,15 @@ const skinFiles = glob.sync('app/javascript/skins/*/*');
|
||||
const flavours = {};
|
||||
|
||||
flavourFiles.forEach((flavourFile) => {
|
||||
const data = load(readFileSync(flavourFile), 'utf8');
|
||||
data.name = basename(dirname(flavourFile));
|
||||
data.skin = {};
|
||||
if (!data.pack_directory) {
|
||||
data.pack_directory = dirname(flavourFile);
|
||||
}
|
||||
if (data.locales) {
|
||||
data.locales = join(dirname(flavourFile), data.locales);
|
||||
}
|
||||
if (data.pack && typeof data.pack === 'object') {
|
||||
flavours[data.name] = data;
|
||||
}
|
||||
const { locales, inherit_locales, pack_directory } = load(readFileSync(flavourFile), 'utf8');
|
||||
|
||||
flavours[basename(dirname(flavourFile))] = {
|
||||
name: basename(dirname(flavourFile)),
|
||||
locales: locales ? join(dirname(flavourFile), locales) : null,
|
||||
inherit_locales,
|
||||
pack_directory: pack_directory,
|
||||
skin: {},
|
||||
};
|
||||
});
|
||||
|
||||
skinFiles.forEach((skinFile) => {
|
||||
|
||||
Reference in New Issue
Block a user