Skip to content

Commit

Permalink
Update default style merge to propagate from resource info > document…
Browse files Browse the repository at this point in the history
… info > segment info
  • Loading branch information
VitalikL committed Sep 25, 2024
1 parent b2980f0 commit 8724257
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion ops/deploy/deploy-documents.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ let processDocuments = async function (resourceType) {

for (let resource of resources) {
let resourcePathInfo = parseResourcePath(`${SOURCE_DIR}/${resource}`)
const resourceInfoYaml = yaml.load(fs.readFileSync(`${SOURCE_DIR}/${resource}`, "utf8"));

const documents = new fdir()
.withBasePath()
Expand Down Expand Up @@ -240,7 +241,9 @@ let processDocuments = async function (resourceType) {

// await database.collection(FIREBASE_DATABASE_DOCUMENTS).doc(documentInfo.id).set(documentInfo)

documentInfo.defaultStyles = deepMerge(SEGMENT_DEFAULT_BLOCK_STYLES, documentInfo.defaultStyles)
let defaultStyle = deepMerge(SEGMENT_DEFAULT_BLOCK_STYLES, resourceInfoYaml.defaultStyles)
documentInfo.defaultStyles = deepMerge(defaultStyle, documentInfo.defaultStyles)

fs.outputFileSync(`${API_DIST}/${documentPathInfo.language}/${resourceType}/${documentPathInfo.title}/${documentPathInfo.section ? documentPathInfo.section + "-" : ""}${documentPathInfo.document}/index.json`, JSON.stringify(documentInfo))
}
}
Expand Down
2 changes: 1 addition & 1 deletion ops/helpers/blocks/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const list = {
let blockData = { id: block.id, type: block.type, items: [], ordered: block.ordered, start: block.start || 0 }

for (let [index, listItem] of block.items.entries()) {
let documentIndex = `${resourcePath.language}/${resourcePath.type}/${resourcePath.name}/content/${resourcePath.section ? resourcePath.section + "/" : ""}${resourcePath.document}`
let documentIndex = `${resourcePath.language}/${resourcePath.type}/${resourcePath.name}/${resourcePath.section ? resourcePath.section + "/" : ""}${resourcePath.document}`

for (let token of listItem.tokens) {
if (token.type === "text") {
Expand Down

0 comments on commit 8724257

Please sign in to comment.