mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 14:26:37 -06:00
feat: add PGP public key page with multiple access endpoints
- Add dedicated /pgp page with key viewer and download options - Support CLI-friendly endpoints (/publickey.asc, /pgp.asc, /.well-known/pgpkey.asc) - Detect user-agent to serve raw key to curl/wget or HTML to browsers - Add modal component for quick key access from homepage - Embed static key file in Rust assets for efficient serving
This commit is contained in:
@@ -55,6 +55,20 @@ fn serve_asset_by_path(path: &str) -> Response {
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a static file from the embedded CLIENT_ASSETS.
|
||||
///
|
||||
/// Static files are served from web/static/ and embedded at compile time.
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `path` - Path to the file (e.g., "publickey.asc")
|
||||
///
|
||||
/// # Returns
|
||||
/// * `Some(&[u8])` - File content if file exists
|
||||
/// * `None` - If file not found
|
||||
pub fn get_static_file(path: &str) -> Option<&'static [u8]> {
|
||||
CLIENT_ASSETS.get_file(path).map(|f| f.contents())
|
||||
}
|
||||
|
||||
/// Get prerendered error page HTML for a given status code.
|
||||
///
|
||||
/// Error pages are prerendered by SvelteKit and embedded at compile time.
|
||||
|
||||
Reference in New Issue
Block a user