Start page acceptable.

This commit is contained in:
Niels Serup 2011-07-14 22:28:37 +02:00
parent 4549d035b8
commit 6f4c996774
7 changed files with 185 additions and 79 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@
/template.html /template.html
/extra/atom.xml /extra/atom.xml
log.mege log.mege
.finallog.mege
/mege/ /mege/
apache-config apache-config
.debug .debug

View File

@ -1,19 +1,15 @@
"""WSGI interface""" """WSGI interface"""
import sys import sys
import os import os.path
_absfile = os.path.abspath(__file__) _absfile = os.path.abspath(__file__)
_filedir = os.path.dirname(_absfile) _filedir = os.path.dirname(_absfile)
try:
import mege.server as server
except ImportError:
sys.path.insert(0, os.path.join(_filedir, 'mege'))
import mege.server as server
os.chdir(_filedir)
try: try:
application = server.MegeApplication() import mege.wsgi
except Exception as e: except ImportError:
import traceback sys.path.insert(0, os.path.join(_filedir, 'mege'))
with open('.nohifinallog', 'w') as f: import mege.wsgi
print(e, file=f) os.chdir(_filedir)
print(traceback.format_exc(), file=f)
application = mege.wsgi.create_application()

View File

@ -10,14 +10,15 @@
*/ */
add_external_document_writing_script = function(url, elem) { add_external_document_writing_script = function(url, elem) {
document.orig_write = document.write var orig_write, content, done;
var content = '' orig_write = document.write;
content = ''
document.write = function(msg) { document.write = function(msg) {
content += msg + '\n'; content += msg + '\n';
} }
var done = function() { done = function() {
document.write = document.orig_write; document.write = orig_write;
elem.innerHTML = content; elem.innerHTML = content;
} }
@ -27,7 +28,7 @@ add_external_document_writing_script = function(url, elem) {
ns.onload = function() { ns.onload = function() {
done(); done();
} }
ns.onreadystatechange= function() { ns.onreadystatechange = function() {
if (this.readyState == 'complete') if (this.readyState == 'complete')
done(); done();
} }
@ -37,6 +38,7 @@ add_external_document_writing_script = function(url, elem) {
add_fsf_widget = function(associate_id) { add_fsf_widget = function(associate_id) {
fsf_widget_size = 'normal'; fsf_widget_size = 'normal';
fsf_associate_id = associate_id + ''; fsf_associate_id = associate_id + '';
add_external_script('http://www.fsf.org/graphics/widget/global/widget.js', add_external_document_writing_script(
document.getElementById('fsfextern')); 'http://www.fsf.org/graphics/widget/global/widget.js',
document.getElementById('fsfextern'));
}; };

View File

@ -74,6 +74,14 @@ body {
width: auto; width: auto;
} }
#body ul, #body ol {
margin-left: 15px;
}
#body li {
list-style: square outside none;
}
#metadata { #metadata {
margin-top: 10px; margin-top: 10px;
border-style: dashed; border-style: dashed;
@ -84,9 +92,9 @@ body {
color: #fff; color: #fff;
} }
#metadata li { #metadata table, #metadata td, #metadata th {
display: inline; border: None;
list-style: none; margin: 0;
} }
#logo { #logo {
@ -105,6 +113,43 @@ body {
" url('/static/metanohi-logo.png') no-repeat center;\n"@*/ " url('/static/metanohi-logo.png') no-repeat center;\n"@*/
} }
#toc {
background-color: #ddd;
border: 2px dotted #aaa;
display: inline-block;
padding: 4px 9px;
margin: 2px 0 10px 4px;
}
#toc ul {
}
#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;
}
a { a {
text-decoration: none; text-decoration: none;
} }
@ -123,30 +168,73 @@ h1, h2, h3, h4, h5, h6 {
} }
h1 { h1 {
margin-top: 10px;
font-size: 26px; font-size: 26px;
} }
h1:first-child {
margin-top: 0;
}
h2 { h2 {
margin-top: 9px;
font-size: 22px; font-size: 22px;
} }
h3 { h3 {
font-size: 18px; margin-top: 6px;
font-size: 19px;
} }
h4 { h4 {
margin-top: 5px;
font-size: 16px; font-size: 16px;
font-weight: bold;
} }
h5 { h5 {
margin-top: 3px;
font-size: 14px; font-size: 14px;
font-weight: bold;
} }
h6 { h6 {
margin-top: 2px;
font-size: 12px; font-size: 12px;
font-weight: bold; font-weight: bold;
} }
p {
text-align: justify;
margin-bottom: 5px;
}
img {
border: none;
}
table {
margin: 0 auto;
border-collapse: collapse;
}
table, td, th {
border: 1px solid black;
}
td, th {
margin: 0 5px;
padding: 1px 3px;
}
.strong {
font-weight: bold;
}
.emph {
font-style: italic;
}
.center-align { .center-align {
text-align: center; text-align: center;
} }
@ -170,3 +258,11 @@ h6 {
.left-float { .left-float {
float: left; float: left;
} }
.textbanner {
background-color: red;
font-size: 20px;
display: inline-block;
padding: 2px 5px;
margin: 3px;
}

View File

@ -1,4 +1,7 @@
<?xml version='1.0' encoding='utf-8'?> <!--@exec
page.title = html_escape_transform(run_macros(page.title))
page.summary = html_escape_transform(run_macros(page.summary))
@--><?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN' <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.1//EN'
'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'> 'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html version='-//W3C//DTD XHTML 1.1//EN' <html version='-//W3C//DTD XHTML 1.1//EN'
@ -15,7 +18,7 @@
projects of varying importance.' /> projects of varying importance.' />
<meta name='keywords' <meta name='keywords'
content='programming, hacking, nqpz, portfolio' /> content='programming, hacking, nqpz, portfolio' />
<meta name='generator' content='{generator}' /> <meta name='generator' content='http://metanohi.org/projects/mege/' />
<link rel='stylesheet' type='text/css' media='screen, tv' <link rel='stylesheet' type='text/css' media='screen, tv'
href='/static/screen.css' /> href='/static/screen.css' />
<link rel='stylesheet' type='text/css' media='print' <link rel='stylesheet' type='text/css' media='print'
@ -24,16 +27,15 @@
href='/static/tty.css' /> href='/static/tty.css' />
<link rel='stylesheet' type='text/css' media='handheld' <link rel='stylesheet' type='text/css' media='handheld'
href='/static/handheld.css' /> href='/static/handheld.css' />
<link rel='stylesheet' type='text/css' media='handheld, screen and <link href='/atom.xml' type='application/atom+xml' rel='alternate'
(max-width: 500px)' href='/static/handheld.css' /> title='metanohi atom feed' />
<link href='/atom.xml' type='application/atom+xml' rel='alternate' title='metanohi atom feed' />
<link rel='schema.DCTERMS' href='http://purl.org/dc/terms/' /> <link rel='schema.DCTERMS' href='http://purl.org/dc/terms/' />
<meta name='DCTERMS.title' content='{title}' /> <meta name='DCTERMS.title' content='<!--@eval page.title@-->' />
<meta name='DCTERMS.description' content='{description}' /> <meta name='DCTERMS.description' content='<!--@eval page.summary@-->' />
<meta name='DCTERMS.creator' content='Niels Serup' /> <meta name='DCTERMS.creator' content='Niels Serup' />
<meta name='DCTERMS.format' content='application/xhtml+xml' /> <meta name='DCTERMS.format' content='application/xhtml+xml' />
<meta name='DCTERMS.created' content='{created}' /> <meta name='DCTERMS.created' content='<!--@eval page.created@-->' />
<meta name='DCTERMS.modified' content='{modified}' /> <meta name='DCTERMS.modified' content='<!--@eval page.modified@-->' />
<meta name='DCTERMS.language' content='en' /> <meta name='DCTERMS.language' content='en' />
<meta name='DCTERMS.isPartOf' content='http://metanohi.org/' /> <meta name='DCTERMS.isPartOf' content='http://metanohi.org/' />
<meta name='DCTERMS.isVersionOf' content='<!--@eval page.core_url@-->' /> <meta name='DCTERMS.isVersionOf' content='<!--@eval page.core_url@-->' />
@ -59,7 +61,7 @@ if page.licenses:
working. working.
--> -->
<script type='text/javascript' src='/static/extra.js'></script> <script type='text/javascript' src='/static/extra.js'></script>
<!--@eval page.head@--> <!--@eval run_macros(page.head)@-->
</head> </head>
<body> <body>
<a id='minilogo' href='/'></a> <a id='minilogo' href='/'></a>
@ -71,10 +73,10 @@ for x in('projects', 'writings', 'films', 'about'):
</ul> </ul>
</div> </div>
<div id='body'<!--@exec if page.is_fullpage: print(" class='full'", end='')@-->> <div id='body'<!--@exec if page.is_fullpage: print(" class='full'", end='')@-->>
<!--@eval page.toc_html if page.has_toc else ''@--> <!--@eval "<div id='toc'><h3>Contents</h3>" + page.toc_html + '</div><br />' if page.has_toc else ''@-->
<!--@eval run_macros(page.body)@--> <!--@eval run_macros(page.body)@-->
<div id='metadata'> <div id='metadata'>
<!--@eval page.metadata_html@--> <!--@eval run_macros(page.metadata_html)@-->
</div> </div>
</div> </div>
<div id='logo'> <div id='logo'>

View File

@ -1,54 +1,60 @@
#+title: Home #+title: Home
#+summary: Home! #+summary: This is the start page.
#+license: bysa, own works
#+license: Varying, external works
#++show #++show
#+BEGIN_SRC javascript #+BEGIN_SRC javascript
window.addEventListener('load', function(event){add_fsf_widget(8085);}); // Add the FSF widget after the page has loaded.
window.addEventListener('load', function(event){add_fsf_widget(8085);}, false);
#+END_SRC #+END_SRC
* This is metanohi * This is metanohi
aaue abc&strong&emph&large. *metanohi* is a website founded in 2009 with a well-defined purpose: to
#&-color=red exist. It is the personal website of [[/about/niels][Niels Serup]], a [[/writings/hacking/][hacker]] in a world of
ou non-hackers.
#&
#&+center Historically, this start page has featured text which had little purpose except
This text is centered. to exist. That is over now. /metanohi/ has no real need for a start page ---
#& and that means no more superfluous text.
# #++show * Passive activism
# #+BEGIN_SRC html
# <p style='margin: 0 auto; width: 400px'>
# <a href="http://windows7sins.org/"
# style='display: block; float: left'>
# <img src="http://windows7sins.org/i/widget.png"
# alt="Windows 7 Sins" style='width: 200px; height: 200px' />
# </a>
# <a href="http://www.fsf.org/campaigns/opendocument/"
# style='display: block; float: left'>
# <img src="http://static.fsf.org/nosvn/opendocument/medium/odf.png"
# alt="Use ODF!" style='width: 200px; height: 200px' />
# </a>
# </p>
# <p style='background-color: #ff0000; padding: 10px; display: block;
# width: 380px; margin: 0 auto 10px auto' class='large'>
# <a href='http://petition.stopsoftwarepatents.eu/' class='center'>
# STOP SOFTWARE PATENTS
# </a>
# </p>
# <p class='center'> #++show
# <a href="http://www.fsf.org/facebook/mark-zuckerberg-is-time-magazines-person-of-the-year-wheres-the-dislike-button/"> #+BEGIN_SRC html
# <img src="http://static.fsf.org/nosvn/dislike200.png" <div style='background-color: silver; padding: 5px; border: 5px outset red;'>
# alt="Don't use Facebook!" title="Don't use Facebook!" style='width: 200px; height: 105px' /> <div style='margin: 0 auto; width: 525px; text-align: center;'>
# </a> <div style='height: 200px;'>
<a href='http://windows7sins.org/' style='display: block; float: left'>
# <a <img src='http://windows7sins.org/i/widget.png'
# href="http://wikimediafoundation.org/wiki/Support_Wikipedia/en"><img alt='Windows 7 Sins' style='width: 200px; height: 200px' />
# border="0" alt="Support Wikipedia" title="Support Wikipedia" </a>
# src="http://upload.wikimedia.org/wikipedia/commons/4/4b/Fundraising_2009-square-treasure-en.png" /></a> <a href='http://wikimediafoundation.org/wiki/Support_Wikipedia/en'
# </p> style='display: block; float: left; margin-top: 75px'>
<img alt='Support Wikipedia' title='Support Wikipedia'
# <div style='margin: 0 auto; width: 260px' id='fsfextern'></div> src='http://upload.wikimedia.org/wikipedia/commons/4/4b/Fundraising_2009-square-treasure-en.png'
# #+END_SRC style='width: 125px; height: 125px' />
</a>
<a href='http://www.fsf.org/campaigns/opendocument/' style='display: block; float: left'>
<img src='http://static.fsf.org/nosvn/opendocument/medium/odf.png'
alt='Use ODF!' style='width: 200px; height: 200px' />
</a>
</div>
<a href='http://www.fsf.org/facebook/mark-zuckerberg-is-time-magazines-person-of-the-year-wheres-the-dislike-button/'
style='display: block; padding: 6px 0; background-color: yellow;'>
<img src='http://static.fsf.org/nosvn/dislike200.png'
alt="Don't use Facebook!" title="Don't use Facebook!"
style='width: 200px; height: 105px' />
</a>
<a style='display: block; font-size: 30px; background-color: red' href='http://petition.stopsoftwarepatents.eu/'>STOP SOFTWARE PATENTS</a>
<div style='padding: 6px 0; background-color: green;'>
<div style='margin: 0 auto; width: 260px;' id='fsfextern'></div>
</div>
</div>
</div>
#+END_SRC

View File

@ -0,0 +1,3 @@
#+title: Hacking
Hacking