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
/extra/atom.xml
log.mege
.finallog.mege
/mege/
apache-config
.debug

View File

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

View File

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

View File

@ -74,6 +74,14 @@ body {
width: auto;
}
#body ul, #body ol {
margin-left: 15px;
}
#body li {
list-style: square outside none;
}
#metadata {
margin-top: 10px;
border-style: dashed;
@ -84,9 +92,9 @@ body {
color: #fff;
}
#metadata li {
display: inline;
list-style: none;
#metadata table, #metadata td, #metadata th {
border: None;
margin: 0;
}
#logo {
@ -105,6 +113,43 @@ body {
" 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 {
text-decoration: none;
}
@ -123,30 +168,73 @@ h1, h2, h3, h4, h5, h6 {
}
h1 {
margin-top: 10px;
font-size: 26px;
}
h1:first-child {
margin-top: 0;
}
h2 {
margin-top: 9px;
font-size: 22px;
}
h3 {
font-size: 18px;
margin-top: 6px;
font-size: 19px;
}
h4 {
margin-top: 5px;
font-size: 16px;
font-weight: bold;
}
h5 {
margin-top: 3px;
font-size: 14px;
font-weight: bold;
}
h6 {
margin-top: 2px;
font-size: 12px;
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 {
text-align: center;
}
@ -170,3 +258,11 @@ h6 {
.left-float {
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'
'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'>
<html version='-//W3C//DTD XHTML 1.1//EN'
@ -15,7 +18,7 @@
projects of varying importance.' />
<meta name='keywords'
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'
href='/static/screen.css' />
<link rel='stylesheet' type='text/css' media='print'
@ -24,16 +27,15 @@
href='/static/tty.css' />
<link rel='stylesheet' type='text/css' media='handheld'
href='/static/handheld.css' />
<link rel='stylesheet' type='text/css' media='handheld, screen and
(max-width: 500px)' href='/static/handheld.css' />
<link href='/atom.xml' type='application/atom+xml' rel='alternate' 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/' />
<meta name='DCTERMS.title' content='{title}' />
<meta name='DCTERMS.description' content='{description}' />
<meta name='DCTERMS.title' content='<!--@eval page.title@-->' />
<meta name='DCTERMS.description' content='<!--@eval page.summary@-->' />
<meta name='DCTERMS.creator' content='Niels Serup' />
<meta name='DCTERMS.format' content='application/xhtml+xml' />
<meta name='DCTERMS.created' content='{created}' />
<meta name='DCTERMS.modified' content='{modified}' />
<meta name='DCTERMS.created' content='<!--@eval page.created@-->' />
<meta name='DCTERMS.modified' content='<!--@eval page.modified@-->' />
<meta name='DCTERMS.language' content='en' />
<meta name='DCTERMS.isPartOf' content='http://metanohi.org/' />
<meta name='DCTERMS.isVersionOf' content='<!--@eval page.core_url@-->' />
@ -59,7 +61,7 @@ if page.licenses:
working.
-->
<script type='text/javascript' src='/static/extra.js'></script>
<!--@eval page.head@-->
<!--@eval run_macros(page.head)@-->
</head>
<body>
<a id='minilogo' href='/'></a>
@ -71,10 +73,10 @@ for x in('projects', 'writings', 'films', 'about'):
</ul>
</div>
<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)@-->
<div id='metadata'>
<!--@eval page.metadata_html@-->
<!--@eval run_macros(page.metadata_html)@-->
</div>
</div>
<div id='logo'>

View File

@ -1,54 +1,60 @@
#+title: Home
#+summary: Home!
#+summary: This is the start page.
#+license: bysa, own works
#+license: Varying, external works
#++show
#+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
* This is metanohi
aaue abc&strong&emph&large.
#&-color=red
ou
#&
*metanohi* is a website founded in 2009 with a well-defined purpose: to
exist. It is the personal website of [[/about/niels][Niels Serup]], a [[/writings/hacking/][hacker]] in a world of
non-hackers.
#&+center
This text is centered.
#&
Historically, this start page has featured text which had little purpose except
to exist. That is over now. /metanohi/ has no real need for a start page ---
and that means no more superfluous text.
# #++show
# #+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>
* Passive activism
# <p class='center'>
# <a href="http://www.fsf.org/facebook/mark-zuckerberg-is-time-magazines-person-of-the-year-wheres-the-dislike-button/">
# <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
# href="http://wikimediafoundation.org/wiki/Support_Wikipedia/en"><img
# border="0" alt="Support Wikipedia" title="Support Wikipedia"
# src="http://upload.wikimedia.org/wikipedia/commons/4/4b/Fundraising_2009-square-treasure-en.png" /></a>
# </p>
# <div style='margin: 0 auto; width: 260px' id='fsfextern'></div>
# #+END_SRC
#++show
#+BEGIN_SRC html
<div style='background-color: silver; padding: 5px; border: 5px outset red;'>
<div style='margin: 0 auto; width: 525px; text-align: center;'>
<div style='height: 200px;'>
<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://wikimediafoundation.org/wiki/Support_Wikipedia/en'
style='display: block; float: left; margin-top: 75px'>
<img alt='Support Wikipedia' title='Support Wikipedia'
src='http://upload.wikimedia.org/wikipedia/commons/4/4b/Fundraising_2009-square-treasure-en.png'
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