Magazi is a content distribution platform that gates access to files using ATProtocol (Bluesky) identity and cryptographic proofs. download.ngerakines.me/
atprotocol appview atprotocol-attestations
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

feature: Adding robots.txt handler

+41 -5
+17
src/handlers/handler_robots.rs
··· 1 + use axum::http::header; 2 + use axum::response::{IntoResponse, Response}; 3 + 4 + const ROBOTS_TXT: &str = "\ 5 + User-agent: * 6 + Allow: / 7 + Disallow: /login 8 + Disallow: /login/callback 9 + Disallow: /download/ 10 + Disallow: /logout 11 + Disallow: /xrpc/ 12 + Disallow: /oauth-client-metadata.json 13 + "; 14 + 15 + pub async fn robots_txt() -> Response { 16 + ([(header::CONTENT_TYPE, "text/plain; charset=utf-8")], ROBOTS_TXT).into_response() 17 + }
+1
src/handlers/mod.rs
··· 3 3 pub mod handler_getblob; 4 4 pub mod handler_home; 5 5 pub mod handler_oauth; 6 + pub mod handler_robots; 6 7 7 8 pub mod util_entitlements; 8 9 pub mod util_errors;
+1
src/main.rs
··· 57 57 58 58 let app = Router::new() 59 59 .route("/", get(handlers::handler_home::home)) 60 + .route("/robots.txt", get(handlers::handler_robots::robots_txt)) 60 61 .route( 61 62 "/oauth-client-metadata.json", 62 63 get(handlers::handler_oauth::client_metadata),
+21 -4
templates/base.html
··· 5 5 <meta charset="UTF-8"> 6 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 7 <title>{% block title %}Magazi{% endblock %}</title> 8 + 9 + <!-- Standard meta tags --> 10 + <meta name="description" content="{% block description %}Digital content catalog for @{{ creator_handle }}. Access exclusive content by becoming a supporter.{% endblock %}"> 11 + <meta name="author" content="@{{ creator_handle }}"> 12 + <meta name="robots" content="index, follow"> 13 + 14 + <!-- Open Graph meta tags --> 15 + <meta property="og:type" content="website"> 16 + <meta property="og:site_name" content="Magazi"> 17 + <meta property="og:title" content="{% block og_title %}Digital Catalog for @{{ creator_handle }}{% endblock %}"> 18 + <meta property="og:description" content="{% block og_description %}Access exclusive digital content from @{{ creator_handle }}. Become a supporter to unlock downloads.{% endblock %}"> 19 + 20 + <!-- Twitter Card meta tags --> 21 + <meta name="twitter:card" content="summary"> 22 + <meta name="twitter:title" content="{% block twitter_title %}Digital Catalog for @{{ creator_handle }}{% endblock %}"> 23 + <meta name="twitter:description" content="{% block twitter_description %}Access exclusive digital content from @{{ creator_handle }}.{% endblock %}"> 24 + 8 25 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" 9 26 integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" 10 27 crossorigin="anonymous" referrerpolicy="no-referrer" /> ··· 197 214 <nav> 198 215 <a href="/">Home</a> 199 216 {% if logged_in %} 200 - <a href="/logout">Logout</a> 217 + <a href="/logout" rel="nofollow">Logout</a> 201 218 {% else %} 202 - <a href="/login">Login</a> 219 + <a href="/login" rel="nofollow">Login</a> 203 220 {% endif %} 204 221 </nav> 205 222 </header> ··· 207 224 {% block content %}{% endblock %} 208 225 </main> 209 226 <footer> 210 - Powered by <a href="https://tangled.org/ngerakines.me/magazi">Magazi</a> made by <a 211 - href="https://bsky.app/profile/ngerakines.me">@ngerakines.me</a> 227 + Powered by <a href="https://tangled.org/ngerakines.me/magazi" target="_blank" rel="external">Magazi</a> made by <a 228 + href="https://bsky.app/profile/ngerakines.me" target="_blank" rel="author external">@ngerakines.me</a> 212 229 </footer> 213 230 </body> 214 231
+1 -1
templates/home.html
··· 44 44 <h3>{{ item.name }}</h3> 45 45 <p>{{ item.description }}</p> 46 46 {% if item.entitled %} 47 - <a href="{{ item.download_url }}">Download</a> 47 + <a href="{{ item.download_url }}" rel="nofollow">Download</a> 48 48 {% endif %} 49 49 </div> 50 50 </div>