Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite790980

Browse files
authored
Fix docs search (#1078)
1 parent481d623 commite790980

File tree

6 files changed

+11
-13
lines changed

6 files changed

+11
-13
lines changed

‎pgml-dashboard/src/components/accordian/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use sailfish::TemplateOnce;
21
use pgml_components::component;
2+
use sailfish::TemplateOnce;
33

44
// This component will probably not work very well if two are on the same page at once. We can get
55
// 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;
1010
pubstructAccordian{
1111
html_contents:Vec<String>,
1212
html_titles:Vec<String>,
13-
selected:usize
13+
selected:usize,
1414
}
1515

1616
implAccordian{

‎pgml-dashboard/src/components/accordian/template.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
<% use std::iter::zip; %>
21

32
<divdata-controller="accordian">
43
<divclass="accordian">
5-
<% for i in(0..html_contents.len()) { %>
4+
<% for i in 0..html_contents.len() { %>
65
<divclass="accordian-item">
76
<divclass="accordian-header <% if i == selected { %> selected <% } %>"data-action="click->accordian#titleClick"data-value="accordian-body<%= i %>">
87
<%- html_titles[i] %>

‎pgml-dashboard/src/components/inputs/range_group/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
usecrate::components::stimulus::stimulus_target::StimulusTarget;
12
use pgml_components::component;
23
use sailfish::TemplateOnce;
3-
usecrate::components::stimulus::stimulus_target::StimulusTarget;
44

55
#[derive(TemplateOnce,Default)]
66
#[template(path ="inputs/range_group/template.html")]

‎pgml-dashboard/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
#[macro_use]
22
externcrate rocket;
33

4-
userand::{distributions::Alphanumeric,Rng};
4+
userocket::form::Form;
55
use rocket::response::Redirect;
66
use rocket::route::Route;
77
use rocket::serde::json::Json;
8-
use rocket::{
9-
form::Form,
10-
http::{Cookie,CookieJar},
11-
};
128
use sailfish::TemplateOnce;
139
use sqlx::PgPool;
1410
use std::collections::HashMap;

‎pgml-dashboard/src/utils/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn blogs_dir() -> String {
4242
}
4343

4444
pubfndocs_dir() ->String{
45-
matchvar("DASHBOARD_DOCS_DIRECTORY"){
45+
matchvar("DASHBOARD_CONTENT_DIRECTORY"){
4646
Ok(dir) => dir,
4747
Err(_) =>"../pgml-docs/".to_string(),
4848
}

‎pgml-dashboard/src/utils/markdown.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,8 @@ impl SearchIndex {
13401340
}
13411341

13421342
pubfndocuments() ->Vec<PathBuf>{
1343-
let guides = glob::glob(&(config::docs_dir() +"/guides/**/*.md")).expect("glob failed");
1343+
let guides =
1344+
glob::glob(&(config::docs_dir() +"/docs/guides/**/*.md")).expect("glob failed");
13441345
let blogs = glob::glob(&(config::blogs_dir() +"/blog/**/*.md")).expect("glob failed");
13451346
guides
13461347
.chain(blogs)
@@ -1406,7 +1407,9 @@ impl SearchIndex {
14061407
.split("content")
14071408
.last()
14081409
.unwrap()
1409-
.to_string();
1410+
.to_string()
1411+
.replace("README","")
1412+
.replace(&config::docs_dir(),"/");
14101413
letmut doc =Document::default();
14111414
doc.add_text(title_field,&title_text);
14121415
doc.add_text(body_field,&body_text);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp