decorateWidget를 사용해 헤더에 텍스트 링크 추가하기

예시에서 텍스트를 여기에 삽입해야 합니다:

helper.h('a.icon', {
    href:'/docs',
    title: 'Document'
}, ["test", iconNode("book")]),

링크의 CSS를 조정해야 합니다.

예를 들어:

padding-inline-end: 2em;
justify-content: space-between;
color: currentcolor;

chrome_Tk18DUhJQQ

오른쪽에 배치하는 것을 의미하신다면, 다음을 시도해 볼 수 있습니다:

api.decorateWidget('home-logo:after', helper => {
    return helper.h('div.d-header-icons', [
        helper.h('a.icon.btn-flat.doc', {
            href:'/docs',
            title: 'Document'
        }, [iconNode("book"), "Doc"]),
    ]);
});
.d-header-icons .icon.doc {
    width: auto;
    gap: 0.5em;
    margin-inline: 1em;
    
    & .d-icon {
        width: 1em;
    }
}

간단하게 테스트해 보았습니다. 몇 가지 이상한 동작이 있을 수 있지만, 일반적인 아이디어는 파악하실 수 있을 것입니다!