diff --git a/pgml-dashboard/src/components/accordian/mod.rs b/pgml-dashboard/src/components/accordian/mod.rs index eb52a791a..4c17cb1a9 100644 --- a/pgml-dashboard/src/components/accordian/mod.rs +++ b/pgml-dashboard/src/components/accordian/mod.rs @@ -1,5 +1,5 @@ -use sailfish::TemplateOnce; use pgml_components::component; +use sailfish::TemplateOnce; // This component will probably not work very well if two are on the same page at once. We can get // around it if we include some randomness with the data values in the template.html but that @@ -10,7 +10,7 @@ use pgml_components::component; pub struct Accordian { html_contents: Vec, html_titles: Vec, - selected: usize + selected: usize, } impl Accordian { diff --git a/pgml-dashboard/src/components/accordian/template.html b/pgml-dashboard/src/components/accordian/template.html index 366a8b564..914bac411 100644 --- a/pgml-dashboard/src/components/accordian/template.html +++ b/pgml-dashboard/src/components/accordian/template.html @@ -1,8 +1,7 @@ -<% use std::iter::zip; %>
- <% for i in (0..html_contents.len()) { %> + <% for i in 0..html_contents.len() { %>
<%- html_titles[i] %> diff --git a/pgml-dashboard/src/components/inputs/range_group/mod.rs b/pgml-dashboard/src/components/inputs/range_group/mod.rs index 3164c89f2..4953856ff 100644 --- a/pgml-dashboard/src/components/inputs/range_group/mod.rs +++ b/pgml-dashboard/src/components/inputs/range_group/mod.rs @@ -1,6 +1,6 @@ +use crate::components::stimulus::stimulus_target::StimulusTarget; use pgml_components::component; use sailfish::TemplateOnce; -use crate::components::stimulus::stimulus_target::StimulusTarget; #[derive(TemplateOnce, Default)] #[template(path = "inputs/range_group/template.html")] diff --git a/pgml-dashboard/src/lib.rs b/pgml-dashboard/src/lib.rs index 5e329501d..6d20c1f68 100644 --- a/pgml-dashboard/src/lib.rs +++ b/pgml-dashboard/src/lib.rs @@ -1,14 +1,10 @@ #[macro_use] extern crate rocket; -use rand::{distributions::Alphanumeric, Rng}; +use rocket::form::Form; use rocket::response::Redirect; use rocket::route::Route; use rocket::serde::json::Json; -use rocket::{ - form::Form, - http::{Cookie, CookieJar}, -}; use sailfish::TemplateOnce; use sqlx::PgPool; use std::collections::HashMap; diff --git a/pgml-dashboard/src/utils/config.rs b/pgml-dashboard/src/utils/config.rs index f943dd3b8..11d856b3c 100644 --- a/pgml-dashboard/src/utils/config.rs +++ b/pgml-dashboard/src/utils/config.rs @@ -42,7 +42,7 @@ pub fn blogs_dir() -> String { } pub fn docs_dir() -> String { - match var("DASHBOARD_DOCS_DIRECTORY") { + match var("DASHBOARD_CONTENT_DIRECTORY") { Ok(dir) => dir, Err(_) => "../pgml-docs/".to_string(), } diff --git a/pgml-dashboard/src/utils/markdown.rs b/pgml-dashboard/src/utils/markdown.rs index 138d85067..7ad9a912a 100644 --- a/pgml-dashboard/src/utils/markdown.rs +++ b/pgml-dashboard/src/utils/markdown.rs @@ -1340,7 +1340,8 @@ impl SearchIndex { } pub fn documents() -> Vec { - let guides = glob::glob(&(config::docs_dir() + "/guides/**/*.md")).expect("glob failed"); + let guides = + glob::glob(&(config::docs_dir() + "/docs/guides/**/*.md")).expect("glob failed"); let blogs = glob::glob(&(config::blogs_dir() + "/blog/**/*.md")).expect("glob failed"); guides .chain(blogs) @@ -1406,7 +1407,9 @@ impl SearchIndex { .split("content") .last() .unwrap() - .to_string(); + .to_string() + .replace("README", "") + .replace(&config::docs_dir(), "/"); let mut doc = Document::default(); doc.add_text(title_field, &title_text); doc.add_text(body_field, &body_text); 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