%
function serializeForInlineScript(value) {
return JSON.stringify(value)
.replace(/&/g, '\\u0026')
.replace(//g, '\\u003e')
.replace(/\u2028/g, '\\u2028')
.replace(/\u2029/g, '\\u2029');
}
const clientI18n = {
backToTop: __('accessibility.back_to_top'),
copyCode: __('post.copy_code'),
copied: __('post.copied'),
copyFailed: __('post.copy_failed'),
toc: __('post.toc'),
expandToc: __('post.expand_toc'),
collapseToc: __('post.collapse_toc')
};
%>
<% if (obsidian_callout_enabled()) { %>
<% } %>
<% if (is_post() && photoswipe_enabled()) { %>
<% } %>
<% if (theme.search && theme.search.enable) { %>
<%
const currentLang = page_lang(page);
const searchLanguages = configured_languages();
const searchLanguageRoots = Object.fromEntries(
searchLanguages.map(lang => [lang, url_for(localized_path('/', lang))])
);
const searchConfig = {
path: url_for(theme.search.path || 'search.json'),
currentLang,
defaultLang: searchLanguages[0] || currentLang,
languages: searchLanguages,
languageRoots: searchLanguageRoots,
placeholder: __('search.placeholder'),
noResults: __('search.no_results'),
fallbackHint: __('search.fallback_hint'),
resultsCount: __('search.results_count'),
showAll: __('search.show_all'),
showLess: __('search.show_less'),
loadError: __('search.load_error'),
closeLabel: __('accessibility.close_search')
};
%>
<% } %>
<% if (is_post() && theme.highlight && theme.highlight.copy_button) { %>
<% } %>