pacebin/index.h
2021-09-18 18:50:57 -04:00

56 lines
1.8 KiB
C

const char *INDEX_HTML =
"<!DOCTYPE html>\r\n"
"<html lang=en>\r\n"
" <head>\r\n"
" <title>A Minimal, Filesystem-Backed Pastebin</title>\r\n"
" <meta charset='utf-8'>\r\n"
" <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>\r\n"
" <meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\r\n"
" <meta name='viewport' content='width=device-width, initial-scale=1'>\r\n"
" <meta content='A super simple, minimal, and filesystem-backed pastebin.' name='description'>\r\n"
" </head>\r\n"
" <body style='font-family: monospace; max-width: 80ch;'>\r\n"
"\r\n"
"<header>\r\n"
"A Minimal, Filesystem-Backed Pastebin\r\n"
"</header>\r\n"
"\r\n"
"<style>\r\n"
"@media (max-width: 1000px) {\r\n"
" pre code {\r\n"
" display: block;\r\n"
" max-width: 100%%;\r\n"
" overflow-x: auto;\r\n"
" -webkit-overflow-scrolling: touch;\r\n"
" padding: 0 5px 5px 0;\r\n"
" }\r\n"
"}\r\n"
"</style>\r\n"
"\r\n"
"<pre><code>Examples:\r\n"
" 1. Create a paste\r\n"
" $ curl -d \"some content\" %s\r\n"
" %s/502fb5543c36014f\r\n"
"\r\n"
" 2. Create a paste with a custom path\r\n"
" $ curl -d \"some content\" %s/some-content\r\n"
" %s/some-content\r\n"
"\r\n"
" 3. Deleting a paste\r\n"
" $ TMP=$(mktemp)\r\n"
" $ LINK=$(curl -sS %s -d \"some content\" -D $TMP)\r\n"
" $ # Paste created, headers stored in temp file\r\n"
" $ DEL=$(cat $TMP | grep -i delete-with | awk '{print$2}'| tr -d '\\r')\r\n"
" $ # Gets the deletion key, in the 'X-Delete-With' header\r\n"
" $ curl $LINK\r\n"
" some content\r\n"
" $ curl $LINK -X DELETE -d $DEL\r\n"
" $ curl $LINK\r\n"
" Not found\r\n"
" $ # Paste has been deleted</code></pre>\r\n"
"\r\n"
"<footer style='white-space: pre;'>Source code: <a href='https://short.swurl.xyz/pacebin'>short.swurl.xyz/pacebin</a></a>\r\n"
"</footer>\r\n"
"</html>\r\n";