Added robots.txt
This commit is contained in:
parent
d48ab20b5b
commit
9ef63a7de1
4 changed files with 2976 additions and 65 deletions
2974
Cargo.lock
generated
2974
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -9,6 +9,8 @@ edition = "2021"
|
||||||
anyhow = "1.0.75"
|
anyhow = "1.0.75"
|
||||||
askama = "0.12.1"
|
askama = "0.12.1"
|
||||||
axum = "0.6"
|
axum = "0.6"
|
||||||
|
serde = { version = "1.0.197", features = ["derive"] }
|
||||||
|
surrealdb = "1.3.1"
|
||||||
tokio = { version = "1.35.0", features = ["full"] }
|
tokio = { version = "1.35.0", features = ["full"] }
|
||||||
tower = "0.4.13"
|
tower = "0.4.13"
|
||||||
tower-http = { version = "0.4.4", features = ["fs"] }
|
tower-http = { version = "0.4.4", features = ["fs"] }
|
||||||
|
|
|
||||||
31
assets/robots.txt
Normal file
31
assets/robots.txt
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
|
|
||||||
|
User-agent: AdsBot-Google
|
||||||
|
User-agent: Amazonbot
|
||||||
|
User-agent: anthropic-ai
|
||||||
|
User-agent: Applebot
|
||||||
|
User-agent: AwarioRssBot
|
||||||
|
User-agent: AwarioSmartBot
|
||||||
|
User-agent: Bytespider
|
||||||
|
User-agent: CCBot
|
||||||
|
User-agent: ChatGPT-User
|
||||||
|
User-agent: ClaudeBot
|
||||||
|
User-agent: Claude-Web
|
||||||
|
User-agent: cohere-ai
|
||||||
|
User-agent: DataForSeoBot
|
||||||
|
User-agent: FacebookBot
|
||||||
|
User-agent: Google-Extended
|
||||||
|
User-agent: GoogleOther
|
||||||
|
User-agent: GPTBot
|
||||||
|
User-agent: ImagesiftBot
|
||||||
|
User-agent: magpie-crawler
|
||||||
|
User-agent: Meltwater
|
||||||
|
User-agent: omgili
|
||||||
|
User-agent: omgilibot
|
||||||
|
User-agent: peer39_crawler
|
||||||
|
User-agent: peer39_crawler/1.0
|
||||||
|
User-agent: PerplexityBot
|
||||||
|
User-agent: Seekr
|
||||||
|
User-agent: YouBot
|
||||||
|
Disallow: /
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
use crate::html;
|
use crate::html;
|
||||||
use askama::Template;
|
use askama::Template;
|
||||||
use axum::response::IntoResponse;
|
use axum::{
|
||||||
use axum::{routing::get, Router};
|
response::{IntoResponse, Redirect},
|
||||||
|
routing::{get, Router},
|
||||||
|
};
|
||||||
use tower_http::services::ServeDir;
|
use tower_http::services::ServeDir;
|
||||||
|
|
||||||
pub fn get_router() -> Router {
|
pub fn get_router() -> Router {
|
||||||
|
|
@ -14,6 +16,10 @@ pub fn get_router() -> Router {
|
||||||
.route("/now", get(now))
|
.route("/now", get(now))
|
||||||
.route("/about", get(about))
|
.route("/about", get(about))
|
||||||
.route("/contact", get(contact))
|
.route("/contact", get(contact))
|
||||||
|
.route(
|
||||||
|
"/robots.txt",
|
||||||
|
get(|| async { Redirect::permanent("/assets/robots.txt") }),
|
||||||
|
)
|
||||||
.nest_service(
|
.nest_service(
|
||||||
"/assets",
|
"/assets",
|
||||||
ServeDir::new(format!("{}/assets", assets_path.to_str().unwrap())),
|
ServeDir::new(format!("{}/assets", assets_path.to_str().unwrap())),
|
||||||
|
|
@ -35,7 +41,7 @@ struct HomeTemplate {
|
||||||
|
|
||||||
pub async fn blog() -> impl IntoResponse {
|
pub async fn blog() -> impl IntoResponse {
|
||||||
let template = BlogTemplate {
|
let template = BlogTemplate {
|
||||||
active_navbar: html::NavBar::BLOG
|
active_navbar: html::NavBar::BLOG,
|
||||||
};
|
};
|
||||||
html::HtmlTemplate(template)
|
html::HtmlTemplate(template)
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +93,7 @@ struct AboutTemplate {
|
||||||
|
|
||||||
async fn contact() -> impl IntoResponse {
|
async fn contact() -> impl IntoResponse {
|
||||||
let template = ContactTemplate {
|
let template = ContactTemplate {
|
||||||
active_navbar: html::NavBar::CONTACT
|
active_navbar: html::NavBar::CONTACT,
|
||||||
};
|
};
|
||||||
html::HtmlTemplate(template)
|
html::HtmlTemplate(template)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue