Skip to content

Instantly share code, notes, and snippets.

@mattrude
Created March 19, 2015 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattrude/cbd7417457a72533938b to your computer and use it in GitHub Desktop.
Save mattrude/cbd7417457a72533938b to your computer and use it in GitHub Desktop.
This patch will add a title and CSS to your sks-keyserver html pages.
---
htmlTemplates.ml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/htmlTemplates.ml b/htmlTemplates.ml
index e220d72..506b4b0 100644
--- a/htmlTemplates.ml
+++ b/htmlTemplates.ml
@@ -50,7 +50,7 @@ let html_quote string =
let br_regexp = Str.regexp_case_fold "<br />"
let page ~title ~body =
sprintf
- "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\" >\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>%s</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\r\n<style type=\"text/css\">\r\n/*<![CDATA[*/\r\n .uid { color: green; text-decoration: underline; }\r\n .warn { color: red; font-weight: bold; }\r\n/*]]>*/\r\n</style></head><body><h1>%s</h1>%s</body></html>"
+ "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\" >\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>%s</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />\r\n<link href='/assets/css/pks.min.css' rel='stylesheet' type='text/css'>\r\n<style type=\"text/css\">\r\n/*<![CDATA[*/\r\n .container { max-width: 800px; }\r\n .uid { color: green; text-decoration: underline; }\r\n .warn { color: red; font-weight: bold; }\r\n table.statistics td { padding: 5px; }\r\n/*]]>*/\r\n</style></head><body><div id='wrap'><div class='container'><h1 class='text-center'><strong>OpenPGP</strong>keyserver</h1><hr /><h2>%s</h2>%s</div></div></body></html>"
(Str.global_replace br_regexp "&nbsp;|&nbsp;" title) title body
let link ~op ~hash ~fingerprint ~keyid =
@@ -71,7 +71,7 @@ let keyinfo_pks pki revoked ~keyid ~link ~userids =
(1900 + tm.tm_year)
(tm.tm_mon + 1)
tm.tm_mday
- (if revoked then " *** KEY REVOKED *** [not verified]\r\n "
+ (if revoked then " *** KEY REVOKED *** \r\n "
else "")
in
let uidstr = String.concat ~sep:"\r\n " userids in
--
1.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment