diff --git a/.gitignore b/.gitignore index d377ae6..c05d698 100644 --- a/.gitignore +++ b/.gitignore @@ -1,16 +1,2 @@ -*~ *#*# -*.#* -*.py[co] -.cache/ -/.old/ -/.local/ -/static/*.css -/static/*.js -/template.html -/extra/atom.xml -log.mege -.finallog.mege -.debug -/mege -.test.org +/.old diff --git a/extra/favicon.ico b/extra/favicon.ico deleted file mode 100644 index 74ea60e..0000000 Binary files a/extra/favicon.ico and /dev/null differ diff --git a/extra/favicon.png b/extra/favicon.png deleted file mode 100644 index 88d3807..0000000 Binary files a/extra/favicon.png and /dev/null differ diff --git a/extra/feedicon.png b/extra/feedicon.png deleted file mode 100644 index f02d414..0000000 Binary files a/extra/feedicon.png and /dev/null differ diff --git a/extra/feedicon.svg b/extra/feedicon.svg deleted file mode 100644 index 243cb03..0000000 --- a/extra/feedicon.svg +++ /dev/null @@ -1,206 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/extra/feedlogo.png b/extra/feedlogo.png deleted file mode 100644 index 922b1c8..0000000 Binary files a/extra/feedlogo.png and /dev/null differ diff --git a/extra/feedlogo.svg b/extra/feedlogo.svg deleted file mode 100644 index e372e3e..0000000 --- a/extra/feedlogo.svg +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/extra/robots.txt b/extra/robots.txt deleted file mode 100644 index 2f698a1..0000000 --- a/extra/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-agent: * -Disallow: /static diff --git a/macros/__init__.py b/macros/__init__.py deleted file mode 100755 index c4c64ff..0000000 --- a/macros/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .macros import * diff --git a/macros/macros.py b/macros/macros.py deleted file mode 100755 index eccfb05..0000000 --- a/macros/macros.py +++ /dev/null @@ -1,41 +0,0 @@ -# macros - -import sys -import os.path - -# Ugly hack for local installations -htmlgen = sys.modules['mege.htmlgen'] -htmlfunc = sys.modules['mege.htmlfunc'] -import mege.git as git -import mege.misc as misc - - -def list_pages(pathdir=None): - pathdir = misc.macrog('pathdir', pathdir) - dl = htmlfunc.DefList() - fs = [(p if os.path.isfile(p) else os.path.join( - p, 'index.org'), f, f[:-4] if os.path.isfile(p) else f + '/') for p, f in filter( - lambda pf: (os.path.isfile(pf[0]) and pf[0].endswith('.org') and - pf[1] != 'index.org') or ( - os.path.isdir(pf[0]) and os.path.isfile(os.path.join(pf[0], 'index.org'))), - ((os.path.join(pathdir, f), f) for f in os.listdir(pathdir)))] - fs.sort(key=lambda pf: git.rr.get_last_modified_date(pf[0])[0] or - misc.utcwhenmodified(pf[0])) - for p, f, l in fs[::-1]: - a = htmlgen.org_to_abstract(p, isfile=True, only_metadata=True) - dl.add_item(htmlfunc.link(l, a.title), a.summary if a.summary - else None) #'No summary.') - return dl.generate_html() - -def titlelink(path, pathdir=None): - if not path.startswith('/'): - pathdir = misc.macrog('pathdir', pathdir) - orgpath = misc.get_org_path(os.path.join(pathdir, path)) - else: - orgpath = misc.get_org_path(os.path.join('site', path[1:])) - if orgpath: - a = htmlgen.org_to_abstract(orgpath, isfile=True, only_metadata=True) - title = a.title - else: - title = path - return htmlfunc.link(path, title).generate_html() diff --git a/msgsite/listdir.org b/msgsite/listdir.org deleted file mode 100644 index 6f4be77..0000000 --- a/msgsite/listdir.org +++ /dev/null @@ -1,8 +0,0 @@ -#+title: Directory listing: <@eval page.core_url@> - -* Directory listing: <@eval page.core_url@> - -#++deval -#+BEGIN_SRC python3 - page.dirlist -#+END_SRC diff --git a/msgsite/notfound.org b/msgsite/notfound.org deleted file mode 100644 index 2e9cf20..0000000 --- a/msgsite/notfound.org +++ /dev/null @@ -1,5 +0,0 @@ -#+title: Error: Page not found - -* <@deval page.error@> - -The page <@deval repr(page.core_url)@> does not exist. diff --git a/msgsite/reverror.org b/msgsite/reverror.org deleted file mode 100644 index 4a5b06d..0000000 --- a/msgsite/reverror.org +++ /dev/null @@ -1,7 +0,0 @@ -#+title: Revision error - -* Revision error - -Error: <@deval page.error@> - -[[<@deval page.allrevs@>][View all revisions]] diff --git a/msgsite/servererror.org b/msgsite/servererror.org deleted file mode 100644 index 9b4af93..0000000 --- a/msgsite/servererror.org +++ /dev/null @@ -1,25 +0,0 @@ -#+title: Server error - -* Server error - -There was an error, most likely due to sloppy programming: - -#&block -#++deval -#+BEGIN_SRC python - page.error -#+END_SRC -#& - -#++deval -#+BEGIN_SRC python - page.errortraceback -#+END_SRC - -** Fixing it - -This error has been logged. However, it might get fixed more quickly if you send -an email to Niels at [[mailto:ngws@metanohi.name][ngws@metanohi.name]] explaining what you did to trigger this -tragedy. - -Thanks. diff --git a/msgsite/showrevs.org b/msgsite/showrevs.org deleted file mode 100644 index d7ae4f1..0000000 --- a/msgsite/showrevs.org +++ /dev/null @@ -1,8 +0,0 @@ -#+title: Revisions for <@deval repr(page.path_shown)@> - -* Revisions for <@deval repr(page.path_shown)@> - -#++deval -#+BEGIN_SRC python3 - page.revisions -#+END_SRC diff --git a/msgsite/sitemap.org b/msgsite/sitemap.org deleted file mode 100644 index 608852e..0000000 --- a/msgsite/sitemap.org +++ /dev/null @@ -1,8 +0,0 @@ -#+title: Sitemap - -* Sitemap - -#++eval -#+BEGIN_SRC python - page.sitemap -#+END_SRC diff --git a/nohi.wsgi b/nohi.wsgi deleted file mode 100644 index 3068321..0000000 --- a/nohi.wsgi +++ /dev/null @@ -1,14 +0,0 @@ -"""WSGI interface""" -import sys -import os.path - -_absfile = os.path.abspath(__file__) -_filedir = os.path.dirname(_absfile) - -sys.path.insert(0, _filedir) - -import mege.wsgi - -os.chdir(_filedir) - -application = mege.wsgi.create_application() diff --git a/prestatic/aesthetics.js b/prestatic/aesthetics.js deleted file mode 100644 index e06438a..0000000 --- a/prestatic/aesthetics.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - To the extent possible under law, Niels Serup has waived all copyright and - related or neighboring rights to this file. This file is available under the - Creative Commons Zero 1.0 license, see - http://creativecommons.org/publicdomain/zero/1.0/ - - This JavaScript file contains trivial code. It is required for aesthetic - reasons only. Not loading it will not make a website depending on it less - functional. - */ - -get_window_size = function() { - if (window.innerHeight) - return [window.innerHeight, window.innerWidth]; - else if (self.innerHeight) - return [self.innerHeight, self.innerWidth]; - else if (document.documentElement && document.documentElement.clientHeight) - return [document.documentElement.clientHeight, - document.documentElement.clientWidth]; - else if (document.body) - return [document.body.clientHeight, document.body.clientWidth]; -}; - -is_screen_media = function() { - return (document.getElementsByTagName('link')[1].getAttribute('media').indexOf( - 'screen') != -1 || (document.styleSheets && - (document.styleSheets[0].media.mediaText.indexOf( - 'screen') != -1 || document.styleSheets[0].media.indexOf( - 'screen') != -1))); -}; - -set_min_height = function() { - var ws, wh, ww, h; - ws = get_window_size(); - wh = ws[0]; - ww = ws[1]; - - if (metadiv.offsetTop > wh) - return; - - h = metadiv.offsetHeight + 25; - metadiv.style.position = 'absolute'; - metadiv.style.bottom = '5px'; - metadiv.style.width = (contentdiv.offsetWidth - 42) + 'px'; - contentdiv.style.paddingBottom = h + 'px'; - - h = wh - h - menudiv.offsetHeight - 146; - contentdiv.style.minHeight = h + 'px'; -}; - -adjust_sizes = function() { - set_min_height(); -}; - -window.addEventListener('load', function(event){ - if (!is_screen_media()) - return; - menudiv = document.getElementById('menu'); - contentdiv = document.getElementById('content'); - metadiv = document.getElementById('metadata'); - window.addEventListener('resize', function(event){ - adjust_sizes(); - }, false); - adjust_sizes(); - }, false); - diff --git a/prestatic/extra.js b/prestatic/extra.js deleted file mode 100644 index 0a4d9d1..0000000 --- a/prestatic/extra.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - To the extent possible under law, Niels Serup has waived all copyright and - related or neighboring rights to this file. This file is available under the - Creative Commons Zero 1.0 license, see - http://creativecommons.org/publicdomain/zero/1.0/ - - This JavaScript file contains misc. code snippets designed to add extra - features to a website. Not loading it will not make a website depending on it - stop working. -*/ - -add_external_document_writing_script = function(url, elem) { - var orig_write, content, done, ns; - orig_write = document.write; - content = '' - document.write = function(msg) { - content += msg + '\n'; - }; - - done = function() { - document.write = orig_write; - elem.innerHTML = content; - }; - - ns = document.createElement('script'); - ns.type = 'text/javascript'; - ns.src = url; - ns.onload = function() { - done(); - }; - ns.onreadystatechange = function() { - if (this.readyState == 'complete') - done(); - }; - document.body.appendChild(ns); -}; - -add_fsf_widget = function(associate_id) { - fsf_widget_size = 'normal'; - fsf_associate_id = associate_id + ''; - add_external_document_writing_script( - 'http://www.fsf.org/graphics/widget/global/widget.js', - document.getElementById('fsfextern')); -}; diff --git a/prestatic/general.css b/prestatic/general.css deleted file mode 100644 index 03f6231..0000000 --- a/prestatic/general.css +++ /dev/null @@ -1,513 +0,0 @@ -/* BASICS */ -* { - margin: 0; - padding: 0; -} - -body { - font-family: 'Dejavu Sans', 'Nimbus Sans', Helvetica, Arial, Verdana, sans-serif; - font-size: 0.875em; - color: #000; -} - -#bodyend { - clear: both; -} - -#metadata { - margin: 10px 0; - border-style: dashed; - border-color: #ccc; - border-width: 4px 0 0 0; - background: #aaa url('/static/metadata.png') no-repeat right bottom; - padding: 2px 5px; - color: #fff; -} - -#metadata table, #metadata td, #metadata th { - border: None; - margin: 0; -} - -#toc { - background-color: #ddd; - border: 2px dotted #aaa; - display: inline-block; - padding: 4px 9px; - margin: 2px 0 10px 4px; -} - -#toc li.level1 { - margin-left: 0; -} - -#toc li.level2 { - margin-left: 10px; -} - -#toc li.level3 { - margin-left: 19px; -} - -#toc li.level4 { - margin-left: 27px; -} - -#toc li.level5 { - margin-left: 34px; -} - -#toc li.level6 { - margin-left: 40px; -} - - -/* LINKS */ - -a { - text-decoration: none; -} - -a:link, a:visited { - color: #004a7f; -} - -a:hover { - color: #200cff; -} - -/* HEADINGS */ - -h1, h2, h3, h4, h5, h6 { - font-family: 'Dejavu Serif', FreeSerif, 'Nimbus Roman', Georgia, serif; - font-weight: normal; -} - -h1 { - margin: 16px 0 5px 0; - font-size: 2em; -} - -h1:first-child { - margin-top: 0; -} - -h2 { - margin: 14px 0 5px 0 ; - font-size: 1.8em; - background-color: #ddd; -} - -h3 { - margin: 9px 0 3px 0; - font-size: 1.6em; -} - -h4 { - margin: 7px 0 2px 0; - font-size: 1.4em; - font-weight: bold; -} - -h5 { - margin: 5px 0 1px 0; - font-size: 1.2em; - font-weight: bold; -} - -h6 { - margin: 3px 0 1px 0; - font-size: 1.1em; - font-weight: bold; -} - - -/* Misc. elements */ - -p { - text-align: justify; - margin-top: 10px; -} - -p:first-child { - margin-top: 0; -} - -div.caption { - clear: both; - margin-bottom: 10px; -} - -caption, div.caption > p { - background-color: #ddd; - padding: 3px; - text-align: center; - font-style: italic; -} - -div.caption.center-float img { - margin: 0 auto; -} - -div.caption.left-float img { - margin: 0; -} - -div.caption.center-float { - text-align: center; -} - -div.caption.center-float p { - display: inline-block; -} - -tt, code, samp, pre, var { - font-family: 'Dejavu Sans Mono', monospace; - font-size: 95%; -} - -pre { - margin-top: 10px; - word-wrap: break-word; -} - -img { - border: none; - clear: both; - margin-bottom: 10px; -} - -cite, quote { - border-bottom: 1px dashed yellow; -} - -blockquote { - margin: 5px 0 5px 20px; - font-size: 1.08em; -} - -acronym, abbreviation { - border-bottom: 1px dashed green; -} - -kbd { - background-color: #fff; - padding: 1px 2px; -} - -dfn { - font-style: italic; -} - -dfn { - font-style: italic; -} - -ins { - text-decoration: underline; -} - -del { - text-decoration: line-through; -} - -hr { - margin: 5px 0; -} - - -/* Lists */ - -ul, ol { - margin-top: 5px; - list-style-position: inside; -} - -ul > ul, ul > ol, ol > ul, ol > ol { - margin-left: 17px; - margin-bottom: 0; - padding-left: 5px; -} - -ul { - list-style-type: disc; -} - -ul > ul, ol > ul { - list-style-type: square; -} - -ul > * > ul, ol > * > ul { - list-style-type: circle; -} - -ul > * * > ul, ol > * * > ul { - list-style-type: disc !important; -} - -ol { - list-style-type: decimal; -} - -ol > ol, ul > ol { - list-style-type: upper-alpha; -} - -ol > * > ol, ul > * > ol { - list-style-type: lower-alpha; -} - -ol > * * > ol, ul > * * > ol { - list-style-type: decimal !important; -} - - -/* Definition lists */ - -dd { - margin-left: 20px; -} - -dl dl { - margin-left: 21px; - padding-left: 5px; - border-left: 4px solid #000; -} - - -/* Tables */ - -table { - margin: 5px auto; - border-collapse: collapse; -} - -table, thead, tbody, tfoot, td, th { - border-style: inset; - border-color: black; -} - -td, th { - margin: 0 5px; - padding: 1px 3px; - border-width: 0 2px 0 0; -} - -td:last-child, th:last-child { - border-width: 0; -} - -table, tbody { - border-width: 0; -} - -thead { - border-width: 0 0 2px 0; -} - -tfoot { - border-width: 2px 0 0 0; -} - -thead, tfoot { - font-weight: bold; -} - - -/* Math */ - -.math { - position: relative; - top: 14px; -} - -.block.math { - position: static; - top: 0; - margin: 10px auto 0 auto; -} - -caption { - caption-side: bottom; -} - - -/* Formatting-related classes */ - -.strong { - font-weight: bold; -} - -.emph { - font-style: italic; -} - -.underline { - text-decoration: underline; -} - -.center-align, .center-align > * { - text-align: center !important; -} - -.right-align, .right-align > * { - text-align: right !important; -} - -.left-align, .left-align > * { - text-align: left !important; -} - -.center-float { - margin-right: auto; - margin-left: auto; -} - -.right-float { - float: right; -} - -.left-float { - float: left; -} - -div.right-float, img.right-float, video.right-float, audio.right-float { - margin-left: 10px; -} - -div.left-float, img.left-float, video.left-float, audio.left-float { - margin-right: 10px; -} - -.block { - display: block; -} - -.inline { - display: inline; -} - -.clear { - clear: both; -} - -.noclear, div.caption.noclear { - clear: none !important; -} - -.huge, .huge * { - font-size: 1.8em !important; -} - -.large, .large * { - font-size: 1.5em !important; -} - -.medium, .medium * { - font-size: 1em !important; -} - -.small, .small * { - font-size: 0.8em !important; -} - -.tiny, .tiny * { - font-size: 0.65em !important; -} - - -/* Code highlighting */ - -.highlight { - padding: 2px 4px; -} - -.highlight span { - white-space: pre; -} - -.highlighttable { - margin: 5px 0 5px 0; -} - -.highlighttable pre { - margin-top: 0; -} - -.highlighttable, .highlighttable .code { - border-width: 0; -} - -.linenos { - border-width: 0 1px 0 0; - border-style: solid; - border-color: black; - vertical-align: top; -} - -/* Projects boxes */ - -.projectboxes li { - display: block; - float: left; - margin: 0 10px 10px 0; - width: 230px; - overflow: hidden; - background-color: #000; -} - -.projectboxes li a { - display: block; - padding: 2px 3px; - height: 115px; - overflow: hidden; - background-position: 0 20px; - background-repeat: no-repeat; - white-space: nowrap; - text-align: right; -} - -.projectboxes li a:link, .projectboxes li a:visited { - color: #ffff00; - font-weight: bold; -} - -.projectboxes li a:hover { - background-color: #ffff00; - color: #000; -} - -.projectboxes li dfn { - display: block; - padding: 2px 3px; - height: 35px; - overflow: hidden; - font-style: normal; - color: #fff; - background-color: #444; -} - -/* Misc. classes */ - -.warning { - background-color: #ffa400; - font-weight: bold; - padding: 5px 5px 0 5px; - border: 1px outset black; -} - -.note { - background-color: #c3cfcf; - font-weight: bold; - padding: 5px 5px 0 5px; - border: 1px outset black; -} - -.notice { - background-color: yellow; -} - -.notice p, .note p, .warning p { - margin-bottom: 5px; -} - diff --git a/prestatic/handheld.css b/prestatic/handheld.css deleted file mode 100644 index e69de29..0000000 diff --git a/prestatic/print.css b/prestatic/print.css deleted file mode 100644 index 8501d60..0000000 --- a/prestatic/print.css +++ /dev/null @@ -1,15 +0,0 @@ -#minilogo { - display: none; -} - -#menu { - display: none; -} - -.highlighttable .code { - width: 100%; -} - -.viewsource { - display: none; -} diff --git a/prestatic/screen.css b/prestatic/screen.css deleted file mode 100644 index 2174d23..0000000 --- a/prestatic/screen.css +++ /dev/null @@ -1,116 +0,0 @@ -/*@prexec -page_bg = '#e8efef' -@*/ - -/* BASICS */ -* { - margin: 0; - padding: 0; -} - -body { - /*@preval 'background-color: ' + page_bg + ';\n'@*/ -} - -#minilogo { - color: #008000; - position: fixed; - top: 0; - right: 0; - width: 20px; - height: 126px; - background: url('/static/metanohi-minilogo.png') no-repeat center; -} - -#menu { - background-color: #191919; - text-align: center; - margin-bottom: 10px; -} - -#menulinks { - /*@preval 'background-color: ' + page_bg + ';\n'@*/ - display: inline-block; - padding: 2px 0 2px 16px; - font-size: 1.3em; -} - -ul#menulinks { - margin: 0; -} - -#menulinks li { - display: inline; - list-style: none; - margin-right: 16px; -} - -#menulinks a, #menulinks span { - white-space: nowrap; -} - -#menulinks li a:link, #menulinks li a:visited { - color: #243300; -} - -#menulinks li a:hover { - color: #425dff; -} - -#menulinks li.current span { - color: #2433ff; -} - -#content { - width: 700px; - margin: 0 auto; - padding: 15px; - background-color: #e9e9e9; - border-color: #ddd; - border-style: solid; - border-width: 3px 1px; - position: relative; -} - -#body.full { - position: absolute; - right: 20px; - left: 0px; -} - -#body.full #content { - margin: 0 7px; - width: auto; -} - -#logo { - margin-top: 10px; - background: #111111; - height: 90px; -} - -#logo a { - display: block; - margin: 0 auto; - padding-top: 14px; - width: 750px; - height: 91px; - /*@preval 'background: ' + page_bg + \ - " url('/static/metanohi-logo.png') no-repeat center;\n"@*/ -} - -#body.full #logo { - position: relative; - left: 10px; - margin-left: -10px; - margin-right: -10px; -} - -.highlighttable .code { - width: 600px; -} - -pre { - max-width: 660px; - overflow: auto; -} diff --git a/prestatic/template.html b/prestatic/template.html deleted file mode 100644 index 03de712..0000000 --- a/prestatic/template.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - metanohi: <!--@eval page.title@--> - - - - - - - - - - - - - /> - - - - /> - - /> - - - - - - - - - - - - - -
- -
> -
- - - -
- -
- -
- - diff --git a/prestatic/tty.css b/prestatic/tty.css deleted file mode 100644 index 2174af6..0000000 --- a/prestatic/tty.css +++ /dev/null @@ -1,11 +0,0 @@ -#minilogo { - display: none; -} - -#menu { - display: none; -} - -.highlighttable .code { - width: 100%; -} diff --git a/rules.mege b/redirects similarity index 79% rename from rules.mege rename to redirects index ffb2554..537c9d2 100644 --- a/rules.mege +++ b/redirects @@ -1,20 +1,3 @@ -wsgi nohi.wsgi - -title metanohi -url http://metanohi.name/ -description 'This feed contains the newest pages on metanohi' -author Niels\ G.\ W.\ Serup -email ns@metanohi.name -aboutauthorurl http://metanohi.name/about/niels -feeditems 40 - -template template.html - -# Convert the static parts of HTML, CSS, and JS files -convert prestatic/*.{css,js} static/ -convert prestatic/template.html . - -# Redirects (in site/) ## temp redirect projects/{showandkill,sak} https://gitorious.org/nqpz-config/nqpz-config/blobs/raw/master/home/.emacs.d/site-lisp/showandkill.el diff --git a/scripts/commit.sh b/scripts/commit.sh deleted file mode 100755 index e7f2682..0000000 --- a/scripts/commit.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -cd ~/www/meta/nohi - -git commit -a -git push -ssh webserverhost 'cd www/meta/nohi/scripts; ./hook_new.sh' diff --git a/scripts/hook_new.sh b/scripts/hook_new.sh deleted file mode 100755 index b184cbc..0000000 --- a/scripts/hook_new.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -cd ~/www/meta/nohi - -git pull - -mege feed restart diff --git a/static/metadata.png b/static/metadata.png deleted file mode 100644 index 08d482c..0000000 Binary files a/static/metadata.png and /dev/null differ diff --git a/static/metanohi-logo.png b/static/metanohi-logo.png deleted file mode 100644 index e011a8b..0000000 Binary files a/static/metanohi-logo.png and /dev/null differ diff --git a/static/metanohi-logo.svg b/static/metanohi-logo.svg deleted file mode 100644 index e2c10b2..0000000 --- a/static/metanohi-logo.svg +++ /dev/null @@ -1,319 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/static/metanohi-minilogo.png b/static/metanohi-minilogo.png deleted file mode 100644 index 51a41d6..0000000 Binary files a/static/metanohi-minilogo.png and /dev/null differ diff --git a/static/metanohi-minilogo.svg b/static/metanohi-minilogo.svg deleted file mode 100644 index 38c7adb..0000000 --- a/static/metanohi-minilogo.svg +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/static/snails.png b/static/snails.png deleted file mode 100644 index 67d1957..0000000 Binary files a/static/snails.png and /dev/null differ