Skip to content

Commit 7e213ee

Browse files
authored
handle nav sections, badly (#1212)
1 parent 88e0dc2 commit 7e213ee

File tree

3 files changed

+121
-4
lines changed

3 files changed

+121
-4
lines changed

pgml-dashboard/Cargo.lock

Lines changed: 116 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pgml-dashboard/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ log = "0.4"
2929
markdown = "1.0.0-alpha.14"
3030
num-traits = "0.2"
3131
once_cell = "1.18"
32-
pgml = { version = "0.9.6", path = "../pgml-sdks/pgml/" }
32+
pgml = { version = "0.10.0", path = "../pgml-sdks/pgml/" }
3333
pgml-components = { path = "../packages/pgml-components" }
3434
pgvector = { version = "0.2.2", features = [ "sqlx", "postgres" ] }
3535
rand = "0.8"

pgml-dashboard/src/api/cms.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,25 @@ impl Collection {
9292
let mdast = markdown::to_mdast(&summary_contents, &::markdown::ParseOptions::default())
9393
.unwrap_or_else(|_| panic!("Could not parse summary: {summary_path:?}"));
9494

95+
let mut index = Vec::new();
9596
for node in mdast
9697
.children()
9798
.unwrap_or_else(|| panic!("Summary has no content: {summary_path:?}"))
9899
.iter()
99100
{
100101
match node {
101102
Node::List(list) => {
102-
self.index = self.get_sub_links(list).unwrap_or_else(|_| {
103+
let mut links = self.get_sub_links(list).unwrap_or_else(|_| {
103104
panic!("Could not parse list of index links: {summary_path:?}")
104105
});
105-
break;
106+
index.append(&mut links);
106107
}
107108
_ => {
108109
warn!("Irrelevant content ignored in: {summary_path:?}")
109110
}
110111
}
111112
}
113+
self.index = index;
112114

113115
if self.index.is_empty() {
114116
error!("Index has no entries for Collection: {}", self.name);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy