File tree Expand file tree Collapse file tree 6 files changed +11
-13
lines changed Expand file tree Collapse file tree 6 files changed +11
-13
lines changed Original file line number Diff line number Diff line change 1
- use sailfish:: TemplateOnce ;
2
1
use pgml_components:: component;
2
+ use sailfish:: TemplateOnce ;
3
3
4
4
// This component will probably not work very well if two are on the same page at once. We can get
5
5
// 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;
10
10
pub struct Accordian {
11
11
html_contents : Vec < String > ,
12
12
html_titles : Vec < String > ,
13
- selected : usize
13
+ selected : usize ,
14
14
}
15
15
16
16
impl Accordian {
Original file line number Diff line number Diff line change 1
- < % use std::iter::zip; %>
2
1
3
2
< div data-controller ="accordian ">
4
3
< div class ="accordian ">
5
- < % for i in ( 0..html_contents.len() ) { %>
4
+ < % for i in 0..html_contents.len() { %>
6
5
< div class ="accordian-item ">
7
6
< div class ="accordian-header <% if i == selected { %> selected <% } %> " data-action ="click->accordian#titleClick " data-value ="accordian-body<%= i %> ">
8
7
< %- html_titles[i] %>
Original file line number Diff line number Diff line change
1
+ use crate :: components:: stimulus:: stimulus_target:: StimulusTarget ;
1
2
use pgml_components:: component;
2
3
use sailfish:: TemplateOnce ;
3
- use crate :: components:: stimulus:: stimulus_target:: StimulusTarget ;
4
4
5
5
#[ derive( TemplateOnce , Default ) ]
6
6
#[ template( path = "inputs/range_group/template.html" ) ]
Original file line number Diff line number Diff line change 1
1
#[ macro_use]
2
2
extern crate rocket;
3
3
4
- use rand :: { distributions :: Alphanumeric , Rng } ;
4
+ use rocket :: form :: Form ;
5
5
use rocket:: response:: Redirect ;
6
6
use rocket:: route:: Route ;
7
7
use rocket:: serde:: json:: Json ;
8
- use rocket:: {
9
- form:: Form ,
10
- http:: { Cookie , CookieJar } ,
11
- } ;
12
8
use sailfish:: TemplateOnce ;
13
9
use sqlx:: PgPool ;
14
10
use std:: collections:: HashMap ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ pub fn blogs_dir() -> String {
42
42
}
43
43
44
44
pub fn docs_dir ( ) -> String {
45
- match var ( "DASHBOARD_DOCS_DIRECTORY " ) {
45
+ match var ( "DASHBOARD_CONTENT_DIRECTORY " ) {
46
46
Ok ( dir) => dir,
47
47
Err ( _) => "../pgml-docs/" . to_string ( ) ,
48
48
}
Original file line number Diff line number Diff line change @@ -1340,7 +1340,8 @@ impl SearchIndex {
1340
1340
}
1341
1341
1342
1342
pub fn documents ( ) -> 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" ) ;
1344
1345
let blogs = glob:: glob ( & ( config:: blogs_dir ( ) + "/blog/**/*.md" ) ) . expect ( "glob failed" ) ;
1345
1346
guides
1346
1347
. chain ( blogs)
@@ -1406,7 +1407,9 @@ impl SearchIndex {
1406
1407
. split ( "content" )
1407
1408
. last ( )
1408
1409
. unwrap ( )
1409
- . to_string ( ) ;
1410
+ . to_string ( )
1411
+ . replace ( "README" , "" )
1412
+ . replace ( & config:: docs_dir ( ) , "/" ) ;
1410
1413
let mut doc = Document :: default ( ) ;
1411
1414
doc. add_text ( title_field, & title_text) ;
1412
1415
doc. add_text ( body_field, & body_text) ;
You can’t perform that action at this time.
0 commit comments