Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add meta for toc in head link #710

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

makamekm
Copy link
Contributor

No description provided.

@@ -46,13 +58,18 @@ export function generateStaticMarkup(
const html = staticContent ? render(props) : '';
const isRTL = RTL_LANGS.includes(props.lang);

const headMeta = generateTags('meta', tocHead?.meta);
const headLink = generateTags('link', tocHead?.link);

return `
<!DOCTYPE html>
<html lang="${props.lang}" dir="${isRTL ? 'rtl' : 'ltr'}">
<head>
<meta charset="utf-8">
${getMetadata(metadata, restYamlConfigMeta)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А вот это не дублирует headMeta чуть ниже?

Copy link
Contributor Author

@makamekm makamekm Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Там только <script /> и <link rel="stylesheet" type="text/css" />.
Те такой вариант дает менять стили в более гибком варианте. Хотя цель этого не дать добавлять стили, а дать добавить og теги и другие теги для треков и интеграций с непостоянным наполнением ([name]="value').

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Переделал решение под то что уже есть. Таким образом добавил опциональное поле tagName для возможности проставить <${tagName} {...args} />

@martyanovandrey
Copy link
Contributor

добавь, пожалуйста, тестов для добавления меты

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants