이 플러그인은 최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다. 워드프레스의 좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 있을 수 있습니다.

Theme YAML – Use YAML instead JSON for your theme.json settings and styles

설명

Theme Yaml converts your theme.yaml file into theme.json so that you can configure your theme with YAML. It has the benefit of being able to add comments and is more concise than JSON. The generated theme.json is left as a one liner by default, so that you can see it is generated. This however can be changed through the ‘theme_yaml_json_pretty_print’ filter.

The plugin automatically looks for a theme.yaml file in the active theme’s root folder when a page is loaded. If found, it will check its last modified time and store the value in the database. If there are new modifications, the plugin parses theme.yaml, converts it to JSON, and writes it to the theme.json file.

If the active theme is a child, it will also automatically run through this process for its parent.

Configuration

Add a theme.yaml file with your theme settings in your theme’s root directory. If you already have an existing theme.json file, you can convert it to the YAML format using an online tool. I personally use https://www.json2yaml.com/. The plugin will then convert the theme.yaml file into JSON and save it to the theme.json file.

설치

  1. Upload theme-yaml to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

FAQ

How does the plugin work?

The plugin automatically looks for a theme.yaml file in the active theme’s root folder when a page is loaded. If found, it will check its last modified time and store the value in the database. If there are new modifications, the plugin parses theme.yaml, converts it to JSON, and writes it to the theme.json file.

Does it work for child as well as for parent themes?

If the active theme is a child, it will also automatically run through this process for its parent and the child.

Is there a way to pretty print the JSON file?

I left the generated theme.json file intentionally a one liner, so everybody can see it is generated. But if you would like to change this you can use the following filter to make the JSON file more readable:
`
function pretty_print_json() {
return true;
}

add_filter(‘theme_yaml_json_pretty_print’, ‘pretty_print_json’);
`

후기

2022년 4월 6일 답글 1개
This plugin comes in pretty handy when developing block themes – since handling an ever-growing theme.json file really sucks and you can’t even use basic features like comments, etc. But no more, with “Theme YAML” i can finally write and maintain readable global styles and theme settings without a hassle 🙂 Very easy to use, there are no settings: Just install, activate and you’re basically good to go!
모든 2 평가 읽기

기여자 & 개발자

“Theme YAML – Use YAML instead JSON for your theme.json settings and styles”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이 플러그인에 기여하였습니다.

기여자

“Theme YAML – Use YAML instead JSON for your theme.json settings and styles”(이)가 1 개 언어로 번역되었습니다. 기여해 주셔서 번역자님께 감사드립니다.

자국어로 “Theme YAML – Use YAML instead JSON for your theme.json settings and styles”(을)를 번역하세요.

개발에 관심이 있으십니까?

코드 탐색하기는, SVN 저장소를 확인하시거나, 개발 기록RSS로 구독하세요.

변경이력

1.3.0

Updated composer packages

1.2.0

Added backup for theme.json

1.1.1

Fixed readme formatting

1.1.0

Changed settings to output the theme.json file in a more readable way. Also added a filter to change the JSON encoding flags. Kindly suggested by Justin Tadlock in his review of this plugin here: https://wptavern .com/new-plugin-for-writing-wordpress-theme-json-files-via-yaml

1.0.0

  • Initial Release of the plugin