Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Fonksiyon: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Deneysel

Instructure token'larını yükleyen bir Drupal alt-teması için dosyaları oluştur.

Parametreler

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Döndürür

DrupalFile[]

Tema dosyaları, tema dizinine göre göreceli yollar.

Örnekler

Bağımsız bir alt-tema oluştur ve yaz

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);
}

Bir temel tema üzerine alt-tema oluştur

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

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