kirby3 fontselector
v1.2.0
Kirby 플러그인은 두 개의 동기화 된 필드로 글꼴 패밀리 및 글꼴 무게를 선택합니다.
site/plugins/kirby3-fontselector 또는 unzip master.zipgit submodule add https://github.com/bnomei/kirby3-fontselector.git site/plugins/kirby3-fontselector 또는composer require bnomei/kirby3-fontselector 구성 값으로 사용하려는 글꼴을 설정하십시오. 사용자 정의 JSON 파일을 사용하거나 PHP 배열을 반환 할 수 있습니다.
자산/fonts.json
{
"fonts" : [
{
"font" : " Merriweather " ,
"weight" : [
600 ,
700
]
},
{
"font" : " Montserrat " ,
"weight" : [
300 ,
400 ,
500
]
}
]
} <?php
return [
' bnomei.fontselector.fonts ' => function () {
return Json:: read ( kirby ()-> roots ()-> assets () . ' /fonts.json ' );
// return ['fonts' => [...]];
},
// other options
];페이지 청사진에 필드를 추가하십시오.
사이트/Blueprints/default.yml
fields :
headlinefont :
type : fontfamily
default : Merriweather
required : true
# reload: true # optional reload on save
headlineh1weight :
type : fontweight
watchField : headlinefont
default : 700
required : true
headlineh2weight :
type : fontweight
watchField : headlinefont
default : 600
required : true
copytextfont :
type : fontfamily
default : Montserrat
required : true
copytextweight :
type : fontweight
watchField : copytextfont
default : 400
required : true 경고
이 플러그인에는 기본적으로 1 분 캐시가 있습니다.
| bnomei. 폰테이터. | 기본 | 설명 |
|---|---|---|
| 글꼴 | function(){...} | 콜백 글꼴 배열을 반환합니다 |
| 내쉬다 | 1 | 캐시는 N 분만 만료됩니다 |
이 플러그인은 보증없이 "있는 그대로"제공됩니다. 자신의 위험에 따라 사용하고 생산 환경에서 사용하기 전에 항상 직접 테스트하십시오. 문제가있는 경우 새 문제를 만드십시오.
MIT
인종 차별주의, 성 차별, 동성애 공포증, 동물 학대, 폭력 또는 기타 증오심 표현을 촉진하는 프로젝트 에서이 플러그인을 사용하지 않아도됩니다.