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

Add gm specific sections to secrets #71

Merged
merged 1 commit into from
Jul 29, 2023
Merged
Changes from all commits
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
12 changes: 8 additions & 4 deletions module/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,14 @@ export function getArticleContent(article) {
});

// Determine whether there are secrets inside this article
const secretSectionIds = ["seeded"];

const isSectionSecret = (section) => {
const secretSectionIds = ["seeded"];
return secretSectionIds.includes(section) || section.startsWith("ggm");
}
waFlags.hasSecrets = sectionEntries.some(s => {
const [id, section] = s;
return secretSectionIds.includes(id);
return isSectionSecret(id);
});

// Filter sections, removing ignored ones.
Expand All @@ -304,7 +308,7 @@ export function getArticleContent(article) {
// Each section data are stored inside a separated div
const cssClass = [
ARTICLE_CSS_CLASSES.ALL_PARTS,
secretSectionIds.includes(id) ? ARTICLE_CSS_CLASSES.SECRET_SECTION : ARTICLE_CSS_CLASSES.PUBLIC_SECTION
isSectionSecret(id) ? ARTICLE_CSS_CLASSES.SECRET_SECTION : ARTICLE_CSS_CLASSES.PUBLIC_SECTION
].join(" ");

let sectionInPages = `<section data-section-id="${id}" class="${cssClass}">`;
Expand All @@ -327,7 +331,7 @@ export function getArticleContent(article) {
// End main section div
sectionInPages += "</section>";

const pageName = secretSectionIds.includes(id) ? pageNames.secrets : pageNames.sideContent;
const pageName = isSectionSecret(id) ? pageNames.secrets : pageNames.sideContent;
pages.html[pageName] = pages.html[pageName] ?? "";
pages.html[pageName] += sectionInPages;
}
Expand Down