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(macros): add GlossarySidebar macro #8997

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions kumascript/macros/GlossarySidebar.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%
var locale = env.locale;
var baseURL = '/' + locale + '/docs/Glossary';

var text = mdn.localStringMap({
'en-US': {
'Glossary_home_page' : 'MDN Web Docs Glossary',
},
'es': {
'Glossary_home_page' : 'Glosario de MDN Web Docs',
},
'fr': {
'Glossary_home_page' : "Glossaire MDN Web Docs",
},
'ja': {
'Glossary_home_page' : 'MDN Web Docs 用語集',
},
'ko': {
'Glossary_home_page' : 'MDN Web Docs 용어집',
},
'ru': {
'Glossary_home_page' : 'Глоссарий MDN Web Docs',
}
});

%>

<section id="Quick_links" data-macro="GlossarySidebar">
<ol>
<li><strong><a href="<%=baseURL%>"><%=text['Glossary_home_page']%></a></strong><%-await template("ListSubpagesForSidebar", ['/en-us/docs/Glossary', 1])%></li>
</ol>
</section>
2 changes: 1 addition & 1 deletion kumascript/macros/ListSubpagesForSidebar.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async function createLink(aPage) {
if (wrapInCode) {
linkContent = `<code>${linkContent}</code>`;
}

const pageBadges = (await page.badges(aPage)).join("");

const result = `<li><a href="${url}">${linkContent}</a>${pageBadges}</li>`;
Expand Down