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

Fix docs search#1078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
levkk merged 1 commit intomasterfromlevkk-fix-docs-search
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionspgml-dashboard/src/components/accordian/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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
Expand All@@ -10,7 +10,7 @@ use pgml_components::component;
pub struct Accordian {
html_contents: Vec<String>,
html_titles: Vec<String>,
selected: usize
selected: usize,
}

impl Accordian {
Expand Down
3 changes: 1 addition & 2 deletionspgml-dashboard/src/components/accordian/template.html
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
<% use std::iter::zip; %>

<div data-controller="accordian">
<div class="accordian">
<% for i in(0..html_contents.len()) { %>
<% for i in 0..html_contents.len() { %>
<div class="accordian-item">
<div class="accordian-header <% if i == selected { %> selected <% } %>" data-action="click->accordian#titleClick" data-value="accordian-body<%= i %>">
<%- html_titles[i] %>
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -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")]
Expand Down
6 changes: 1 addition & 5 deletionspgml-dashboard/src/lib.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
#[macro_use]
extern crate rocket;

userand::{distributions::Alphanumeric, Rng};
userocket::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;
Expand Down
2 changes: 1 addition & 1 deletionpgml-dashboard/src/utils/config.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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(),
}
Expand Down
7 changes: 5 additions & 2 deletionspgml-dashboard/src/utils/markdown.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1340,7 +1340,8 @@ impl SearchIndex {
}

pub fn documents() -> Vec<PathBuf> {
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)
Expand DownExpand Up@@ -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);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp