mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-02 21:03:00 +00:00
material: Material UI homepage (https://github.com/slint-ui/material-components/issues/27)
Use AstroWind template to improve the home page
Imported from 7cafd1db3b
This commit is contained in:
parent
7cd8194e1c
commit
9711a625e7
77 changed files with 7249 additions and 280 deletions
21
ui-libraries/material/docs/vendor/integration/utils/loadConfig.ts
vendored
Normal file
21
ui-libraries/material/docs/vendor/integration/utils/loadConfig.ts
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// Copyright © onWidget <https://github.com/onwidget>
|
||||
// SPDX-License-Identifier: MIT
|
||||
import fs from "node:fs";
|
||||
import yaml from "js-yaml";
|
||||
|
||||
const loadConfig = async (configPathOrData: string | object) => {
|
||||
if (typeof configPathOrData === "string") {
|
||||
const content = fs.readFileSync(configPathOrData, "utf8");
|
||||
if (
|
||||
configPathOrData.endsWith(".yaml") ||
|
||||
configPathOrData.endsWith(".yml")
|
||||
) {
|
||||
return yaml.load(content);
|
||||
}
|
||||
return content;
|
||||
}
|
||||
|
||||
return configPathOrData;
|
||||
};
|
||||
|
||||
export default loadConfig;
|
||||
Loading…
Add table
Add a link
Reference in a new issue