- Notifications
You must be signed in to change notification settings - Fork328
Dan test 1#1577
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
Uh oh!
There was an error while loading.Please reload this page.
Merged
Dan test 1#1577
Changes fromall commits
Commits
Show all changes
9 commits Select commitHold shift + click to select a range
5ee29db
test change
chillenberger2358a9b
fix docs left nav
chillenberger05404a9
this should not be here
chillenbergere36656b
should not be here
chillenberger2367f7e
redirects and make old links work
chillenberger510cd7f
remove unneeded endpoint
chillenbergerf3f6d0f
update links
chillenbergerfcb189e
update links
chillenberger168b201
Merge branch 'master' into dan-test-1
chillenbergerFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
56 changes: 55 additions & 1 deletionpgml-dashboard/src/api/cms.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3,6 +3,7 @@ use std::{ | ||
path::{Path,PathBuf}, | ||
}; | ||
use rocket::response::Redirect; | ||
use std::str::FromStr; | ||
use comrak::{format_html_with_plugins, parse_document,Arena,ComrakPlugins}; | ||
@@ -62,7 +63,10 @@ lazy_static! { | ||
("transformers/fine_tuning/","api/sql-extension/pgml.tune"), | ||
("guides/predictions/overview","api/sql-extension/pgml.predict/"), | ||
("machine-learning/supervised-learning/data-pre-processing","api/sql-extension/pgml.train/data-pre-processing"), | ||
("introduction/getting-started/import-your-data/","introduction/import-your-data/"), | ||
("introduction/getting-started/import-your-data/foreign-data-wrapper","introduction/import-your-data/foreign-data-wrappers"), | ||
("use-cases/embeddings/generating-llm-embeddings-with-open-source-models-in-postgresml","open-source/pgml/guides/embeddings/in-database-generation"), | ||
("use-cases/natural-language-processing","open-source/pgml/guides/natural-language-processing"), | ||
]) | ||
); | ||
} | ||
@@ -857,6 +861,50 @@ pub async fn careers_apply(title: PathBuf, cluster: &Cluster) -> Result<Response | ||
Ok(ResponseOk(layout.render(page))) | ||
} | ||
/// Redirect api to open-source | ||
#[get("/docs/api/<path..>")] | ||
pubasyncfnapi_redirect(path:PathBuf) ->Redirect{ | ||
match path.to_str().unwrap(){ | ||
"apis" =>Redirect::permanent("/docs/open-source/korvus/"), | ||
"client-sdk/search" =>{ | ||
chillenberger marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Redirect::permanent("/docs/open-source/korvus/guides/document-search") | ||
} | ||
"client-sdk/getting-started" =>Redirect::permanent("/docs/open-source/korvus/"), | ||
"sql-extensions/pgml.predict/" =>Redirect::permanent("/docs/open-source/pgml/api/pgml.predict/"), | ||
"sql-extensions/pgml.deploy" =>Redirect::permanent("/docs/open-source/pgml/api/pgml.deploy"), | ||
_ =>Redirect::permanent("/docs/open-source/".to_owned() + path.to_str().unwrap()), | ||
} | ||
} | ||
/// Redirect our old sql-extension path. | ||
#[get("/docs/open-source/sql-extension/<path..>")] | ||
pubasyncfnsql_extension_redirect(path:PathBuf) ->Redirect{ | ||
Redirect::permanent("/docs/open-source/pgml/api/".to_owned() + path.to_str().unwrap()) | ||
} | ||
/// Redirect our old pgcat path. | ||
#[get("/docs/product/pgcat/<path..>")] | ||
pubasyncfnpgcat_redirect(path:PathBuf) ->Redirect{ | ||
Redirect::permanent("/docs/open-source/pgcat/".to_owned() + path.to_str().unwrap()) | ||
} | ||
/// Redirect our old cloud-database path. | ||
#[get("/docs/product/cloud-database/<path..>")] | ||
pubasyncfncloud_database_redirect(path:PathBuf) ->Redirect{ | ||
let path = path.to_str().unwrap(); | ||
if path.is_empty(){ | ||
Redirect::permanent("/docs/cloud/overview") | ||
}else{ | ||
Redirect::permanent("/docs/cloud/".to_owned() + path) | ||
} | ||
} | ||
/// Redirect our old pgml docs. | ||
#[get("/docs/open-source/client-sdk/<path..>")] | ||
pubasyncfnpgml_redirect(path:PathBuf) ->Redirect{ | ||
Redirect::permanent("/docs/open-source/korvus/api/".to_owned() + path.to_str().unwrap()) | ||
} | ||
#[get("/docs/<path..>", rank =5)] | ||
asyncfnget_docs( | ||
path:PathBuf, | ||
@@ -936,6 +984,7 @@ async fn docs_landing_page(cluster: &Cluster) -> Result<ResponseOk, crate::respo | ||
Ok(ResponseOk(doc_layout.render(page))) | ||
} | ||
/// Redirect our old MkDocs paths to the new ones under `/docs`. | ||
#[get("/user_guides/<path..>", rank =5)] | ||
asyncfnget_user_guides(path:PathBuf) ->Result<Response,crate::responses::NotFound>{ | ||
Ok(Response::redirect(format!("/docs/{}", path.display().to_string()))) | ||
@@ -1003,6 +1052,11 @@ pub fn routes() -> Vec<Route> { | ||
search, | ||
search_blog, | ||
demo, | ||
sql_extension_redirect, | ||
api_redirect, | ||
pgcat_redirect, | ||
pgml_redirect, | ||
cloud_database_redirect | ||
] | ||
} | ||
4 changes: 4 additions & 0 deletionspgml-dashboard/src/components/cms/index_link/index_link.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletionspgml-dashboard/src/components/navigation/left_nav/docs/docs.scss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionpgml-dashboard/src/components/navigation/left_nav/docs/template.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
15 changes: 12 additions & 3 deletionspgml-dashboard/src/components/sections/footers/marketing_footer/mod.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.