Skip to content

Commit

Permalink
Add robots.txt and humans.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
randomairborne committed Jun 17, 2024
1 parent cdcf9c3 commit a4d0cfe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/humans.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This site was created by valkyrie_pilot. Thank you for checking it out.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ async fn main() {
any(raw).layer(ServiceBuilder::new().layer(noindex).layer(permissive_cors)),
)
.route("/robots.txt", get(robots))
.route("/humans.txt", get(humans))
.fallback(not_found)
.layer(ServiceBuilder::new().layer(no_cache).layer(sombrero))
.with_state(state);
Expand Down Expand Up @@ -141,7 +142,12 @@ async fn not_found(nonce: String) -> NotFoundPage {

#[allow(clippy::unused_async)]
async fn robots() -> &'static str {
concat!("User-Agent: *", "\n", "Allow: /")
include_str!("robots.txt")
}

#[allow(clippy::unused_async)]
async fn humans() -> &'static str {
include_str!("humans.txt")
}

#[derive(Clone)]
Expand Down
2 changes: 2 additions & 0 deletions src/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-Agent: *
Allow: /

0 comments on commit a4d0cfe

Please sign in to comment.