...
This commit is contained in:
@@ -2,7 +2,6 @@ module docusaurus
|
||||
|
||||
import incubaid.herolib.core.pathlib
|
||||
import json
|
||||
import os
|
||||
import incubaid.herolib.osal.core as osal
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
|
||||
@@ -3,38 +3,38 @@ module docusaurus
|
||||
import incubaid.herolib.core.base
|
||||
import incubaid.herolib.core.texttools
|
||||
|
||||
// Store the Docusaurus site structure in Redis for link processing
|
||||
// This maps collection:page to their actual Docusaurus paths
|
||||
pub fn (mut docsite DocSite) store_site_structure() ! {
|
||||
mut context := base.context()!
|
||||
mut redis := context.redis()!
|
||||
// // Store the Docusaurus site structure in Redis for link processing
|
||||
// // This maps collection:page to their actual Docusaurus paths
|
||||
// pub fn (mut docsite DocSite) store_site_structure() ! {
|
||||
// mut context := base.context()!
|
||||
// mut redis := context.redis()!
|
||||
|
||||
// Store mapping of collection:page to docusaurus path (without .md extension)
|
||||
for page in docsite.website.pages {
|
||||
parts := page.src.split(':')
|
||||
if parts.len != 2 {
|
||||
continue
|
||||
}
|
||||
collection_name := texttools.name_fix(parts[0])
|
||||
page_name := texttools.name_fix(parts[1])
|
||||
// // Store mapping of collection:page to docusaurus path (without .md extension)
|
||||
// for page in docsite.website.pages {
|
||||
// parts := page.src.split(':')
|
||||
// if parts.len != 2 {
|
||||
// continue
|
||||
// }
|
||||
// collection_name := texttools.name_fix(parts[0])
|
||||
// page_name := texttools.name_fix(parts[1])
|
||||
|
||||
// Calculate the docusaurus path (without .md extension for URLs)
|
||||
mut doc_path := page.path
|
||||
// // Calculate the docusaurus path (without .md extension for URLs)
|
||||
// mut doc_path := page.path
|
||||
|
||||
// Handle empty or root path
|
||||
if doc_path.trim_space() == '' || doc_path == '/' {
|
||||
doc_path = page_name
|
||||
} else if doc_path.ends_with('/') {
|
||||
doc_path += page_name
|
||||
}
|
||||
// // Handle empty or root path
|
||||
// if doc_path.trim_space() == '' || doc_path == '/' {
|
||||
// doc_path = page_name
|
||||
// } else if doc_path.ends_with('/') {
|
||||
// doc_path += page_name
|
||||
// }
|
||||
|
||||
// Remove .md extension if present for URL paths
|
||||
if doc_path.ends_with('.md') {
|
||||
doc_path = doc_path[..doc_path.len - 3]
|
||||
}
|
||||
// // Remove .md extension if present for URL paths
|
||||
// if doc_path.ends_with('.md') {
|
||||
// doc_path = doc_path[..doc_path.len - 3]
|
||||
// }
|
||||
|
||||
// Store in Redis with key format: collection:page.md
|
||||
key := '${collection_name}:${page_name}.md'
|
||||
redis.hset('doctree_docusaurus_paths', key, doc_path)!
|
||||
}
|
||||
}
|
||||
// // Store in Redis with key format: collection:page.md
|
||||
// key := '${collection_name}:${page_name}.md'
|
||||
// redis.hset('doctree_docusaurus_paths', key, doc_path)!
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
module docusaurus
|
||||
|
||||
import incubaid.herolib.core.pathlib
|
||||
import incubaid.herolib.data.atlas.client as atlas_client
|
||||
import incubaid.herolib.web.site
|
||||
import incubaid.herolib.data.markdown.tools as markdowntools
|
||||
import incubaid.herolib.ui.console
|
||||
|
||||
pub interface IDocClient {
|
||||
mut:
|
||||
// Path methods - get absolute paths to resources
|
||||
Reference in New Issue
Block a user