Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Mahi: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Whakamātautau

Hangaia ngā kōnae mō tētahi sub-theme Drupal e utaina ana ngā tohu Instructure.

Ngā Tawhā

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Whakahokia

DrupalFile[]

Ngā kōnae kaupapa, me ngā ara e hono ana ki te kōpaki kaupapa.

Ngā tauira

Hangaia, tuhia he sub-theme tū motuhake

ts
import { writeFileSync, mkdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { toDrupalTheme } from "@pantoken/drupal";

const files = toDrupalTheme({ name: "Instructure" });
// [ instructure.info.yml, instructure.libraries.yml, css/tokens.css, css/pantoken-prose.css ]
for (const { path, content } of files) {
  const dest = join("./themes/custom/instructure", path);
  mkdirSync(dirname(dest), { recursive: true });
  writeFileSync(dest, content);
}

Hangaia he sub-theme i runga i tētahi kaupapa tūāpapa

ts
import { toDrupalTheme } from "@pantoken/drupal";

const files = toDrupalTheme({ name: "Instructure", baseTheme: "olivero" });