From e81919074554ec1e719f1431667299c9c84dc854 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Mon, 5 Aug 2019 16:58:06 -0400 Subject: [PATCH] bunch of updates For blogs, move to left justified, make code sections expand over the whole screen so they aren't cut off. And on mobile, make them scrollable because otherwise they overflow the body and i dunno how to fix that. Fix email error 500 error on comment submission, hidden form not being hidden. Change main content background to be darker so code sections stand out more so you notice you can scroll them. Change comment box to be more standard white with no text in it so its easier to use. --- .gitignore | 1 + README | 1 - _site/cgi/comment | 33 ++++++++++++--------------------- b.rb | 11 ++++++++--- blog/2014-09-29-say-on2.md | 3 +-- css/common.scss | 4 ++-- css/main.scss | 37 +++++++++++++++++++++++++++---------- set-comments | 1 - 8 files changed, 51 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index f7e2e83..ed9a601 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ /resume.md /_site/resume.html +/_site/tmp diff --git a/README b/README index 03e77b4..7957f6e 100644 --- a/README +++ b/README @@ -6,7 +6,6 @@ Requires a modern debian based OS, tested on debian 8 & 9. Some programs need to be in PATH: https://iankelling.org/git/?p=basic-https-conf;a=summary -https://iankelling.org/git/?p=acme-tiny-wrapper;a=summary chost from https://iankelling.org/git/?p=fai;a=summary diff --git a/_site/cgi/comment b/_site/cgi/comment index b84c45e..1497994 100755 --- a/_site/cgi/comment +++ b/_site/cgi/comment @@ -26,7 +26,6 @@ require 'cgi' require 'fileutils' require 'time' require 'sqlite3' - Dir.chdir(File.join(File.dirname(__FILE__), '..')) require '../b' @@ -85,7 +84,7 @@ def do_captcha

#{captcha_q}

- + @@ -312,27 +311,19 @@ new_count = new_count[0][0] if new_count == 1 require 'net/smtp' - def send_email(opts={}) - opts[:to] ||= 'root' - opts[:server] ||= 'localhost' - opts[:from] ||= 'root' - opts[:from_alias] ||= 'root' - opts[:subject] ||= "test subject" - opts[:body] ||= "" - - msg = < -To: <#{opts[:to]}> -Subject: #{opts[:subject]} - -#{opts[:body]} + to = 'root@' + FQDN + from = 'www-data@' + FQDN + server = 'localhost' + msg = < +To: <#{to}> +Subject: "new comment on #{FQDN}" + +empty body END_OF_MESSAGE - - Net::SMTP.start(opts[:server]) do |smtp| - smtp.send_message msg, opts[:from], opts[:to] - end + Net::SMTP.start(server) do |smtp| + smtp.send_message msg, from, to end - send_email :subject => "new comment on #{DN}" end post(md_file) diff --git a/b.rb b/b.rb index 391a0ed..4bd8f96 100644 --- a/b.rb +++ b/b.rb @@ -86,7 +86,7 @@ EOF

iankelling.org#{o[:header]}

-
+
#{content}
@@ -223,8 +223,8 @@ EOF - - + +
#{com_list} @@ -267,6 +267,11 @@ EOF fskel(rel_path, title, page_html, header: header_rel, footer: footer_extra, + # We call the main content prose because it can contain + # code, so we want to left justify it, so we dont have + # to cram all the code into the middle and can use + # a wider area. + prose: true, comments: com_section, description: description) url="#{DURL}#{rel_path}" diff --git a/blog/2014-09-29-say-on2.md b/blog/2014-09-29-say-on2.md index 10b2119..2853a79 100644 --- a/blog/2014-09-29-say-on2.md +++ b/blog/2014-09-29-say-on2.md @@ -163,8 +163,7 @@ def bnf_expand(*args): asymtotic = ['asymtotic', ''] asymtotic_modified = ['bound', 'run time', 'growth', 'growth rate'] commonly_modified = ['complexity', 'efficiency', 'growth rate'] -common_modifiers = ['computational', 'big oh', 'algorithmic', 'time', - 'asymtotic', ''] +common_modifiers = ['computational', 'big oh', 'algorithmic', 'time', 'asymtotic', ''] unmodified = ['big oh', 'order', 'order of complexity', 'time'] O = bnf_expand([asymtotic, asymtotic_modified], [common_modifiers, commonly_modified], [unmodified]) diff --git a/css/common.scss b/css/common.scss index 8854f6d..f9370b2 100644 --- a/css/common.scss +++ b/css/common.scss @@ -1,9 +1,9 @@ // a few minor things are in main.css and gitweb.css -$comment-background-color: #ebeae4; +$comment-background-color: #d9d8d1; $comment-br-color: #c4c3bc; // a darkish color, black is too striking $comment-date-color: #555; // a bit lighter for less emphasis -$content-color: #f6f6f0; // from gitweb. +$content-color: #ebeae4; $inline-code-background-color: #fff; $link-color: #0645ad; $link-visited-color: #0b0080; diff --git a/css/main.scss b/css/main.scss index e79d352..5e8876a 100644 --- a/css/main.scss +++ b/css/main.scss @@ -33,13 +33,9 @@ padding-bottom: 30px; padding-top: 30px; - textarea { - background-color: $content-color; // go with theme, avoid bright white. - } input:hover, - textarea:active, - textarea:focus { + textarea { // color textarea when selected, and for submit button, // without 3d effect, we need a different color. background: $text-input-color; @@ -71,7 +67,7 @@ ul { li { // to compensate for no bullet points, we need extra space between list items // in the case of small screens where they wrap. - margin-top: 12px; + margin-top: 10px; } .site-nav-list { @@ -137,18 +133,35 @@ footer { .comment-section, .content, +.prose, .page_header, footer { // auto does the centering magic margin-bottom: 0; - margin-left: auto; margin-right: auto; margin-top: 0; + padding-left: 16px; + padding-right: 16px; +} + +.content, +.prose, +.page_header, +footer { + // auto on left +right does the centering magic + margin-left: auto; +} + + +.comment-section, +.content, +.prose :not(.highlight), +.page_header, +footer { max-width: $main-column-max-width; // default too wide - padding-left: 30px; - padding-right: 30px; } + code { background-color: $inline-code-background-color; // defaults are squished next to the borders of the color change @@ -161,6 +174,11 @@ pre { font-size: 15px; } +// for code, scroll right instead of overflowing the body +.highlight { + overflow: auto; +} + pre { // defaults are squished next to the borders of the color change padding: 6px 8px; @@ -180,4 +198,3 @@ a:hover { a:visited { color: $link-visited-color; } - diff --git a/set-comments b/set-comments index b87f211..c503aec 100755 --- a/set-comments +++ b/set-comments @@ -23,7 +23,6 @@ cd "${BASH_SOURCE%/*}/proposed-comments" shell="ssh -oStrictHostKeyChecking=no $(chost iankelling.org)" while [[ $1 ]]; do case $1 in - -a) all=true; shift ;; -l) shell= ; shift ;; # -l for local esac done -- 2.30.2