Permalink
Browse files

Add initial twentyten blog template

  • Loading branch information...
migueldeicaza committed Dec 8, 2010
1 parent b2903b9 commit 84085b19ccf8cbab122a1c4fb8244b3bdc39a4fc
Showing with 1,623 additions and 1 deletion.
  1. +3 −1 README
  2. +4 −0 makefile
  3. +5 −0 twentyten/README
  4. +133 −0 twentyten/blog-template
  5. +14 −0 twentyten/entry-template
  6. +21 −0 twentyten/miguel-style.css
  7. +119 −0 twentyten/prettyprint.js
  8. +1,324 −0 twentyten/style.css
View
4 README
@@ -51,7 +51,9 @@ This is Lame Blog.
For files with the HTML ending, it assumes that the title for
the blog entry will be the first line (which should be tagged
- with <h1>title</h1>).
+ with <h1>title</h1>). This means:
+
+ <h1>This is my Title</h1>
For text files, the first line should be formatted like this:
View
@@ -10,6 +10,10 @@ lb.exe: lb.cs config.cs
b: lb.exe
mono --debug lb.exe -c config.xml -p output
+c: lb.exe
+ -mkdir new; cp twentyten/* new
+ mono --debug lb.exe -c config.xml -p new -b twentyten/blog-template -e twentyten/entry-template
+
clean:
rm -fr *.exe output
View
@@ -0,0 +1,5 @@
+This template is based on the 2010 WordPress template from:
+
+ http://2010dev.wordpress.com/
+
+And which is released under the GNU GPLv2.
View
@@ -0,0 +1,133 @@
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>@TITLE@</title>
+ <link rel='stylesheet' href='@BASEDIR@style.css' type='text/css' />
+ <link rel='stylesheet' href='@BASEDIR@miguel-style.css' type='text/css' />
+ <link rel="alternate" type="application/rss+xml" title="RSS" href="http://tirania.org/blog/miguel.rss2" />
+ <script src='@BASEDIR@prettyprint.js' type='text/javascript'></script>
+ <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+ <script type="text/javascript">
+ function startup()
+ {
+ paintColors ();
+ }
+ </script>
+ @ANALYTICS@
+</head>
+
+<body class="home blog" onload='startup ();'>
+ <div id="wrapper">
+
+ <div id="header">
+ <a href="@BLOGWEBDIR@">@DESCRIPTION@</a>
+ </div><!-- header -->
+
+ <div id="main">
+ <div id="container">
+ @BLOG_ENTRIES@
+
+ @PAGE_NAVIGATION@
+ <center>
+ This is a personal web page. Things said here do not represent the position of my employer.
+ </center>
+ </div>
+
+ <div id="primary" class="widget-area" role="complementary">
+ <ul class="xoxo">
+ <li class="widget-container">
+ <h3 class="widget-title">RSS</h3>
+ <div>
+ <a href="@BLOGWEBDIR@@RSSFILENAME@.rss2"><img src="@BASEDIR@xml.gif" alt="xml.gif" /></a>
+ <a href="http://fusion.google.com/add?feedurl=@BLOGWEBDIR@@RSSFILENAME@.rss2">
+ <img src="http://primates.ximian.com/~miguel/pictures/addgoogle2.gif" alt="addgoogle2.gif" /></a>
+ </div>
+ </li>
+
+ <li class="widget-container">
+ <h3 class="widget-title">My Other Blog</h3>
+ <div>
+ <p><a href="http://monomac.wordpress.com">MonoMac/MonoTouch blog</a>.
+ </div>
+ </li>
+
+ <li class="widget-container">
+ <h3 class="widget-title">Twitter</h3>
+ <div>
+ <p><a href="http://twitter.com/migueldeicaza">Follow me on twitter</a>.
+ <script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=migueldeicaza"></script>
+ </div>
+ </li>
+
+ <li class="widget-container">
+ <h3 class="widget-title">Comments</h3>
+ <div>Email: <a href="mailto:@EDITOR@">@EDITOR@</a>.
+ </div>
+
+ <li class="widget-container">
+ <h3 class="widget-title">Search this Blog</h3>
+ <!-- Google CSE Search Box Begins -->
+ <div><form action="http://google.com/cse" id="searchbox_017740955003523021154:1z0nz3i1mbw">
+ <input type="hidden" name="cx" value="017740955003523021154:1z0nz3i1mbw" />
+ <input type="text" name="q" size="25" />
+ <input type="submit" name="sa" value="Search" />
+ </form>
+ <script type="text/javascript" src="http://google.com/coop/cse/brand?form=searchbox_017740955003523021154%3A1z0nz3i1mbw">
+ </script>
+ </div>
+ <!-- Google CSE Search Box Ends -->
+ </li>
+
+ <li class="widget-container">
+ <h3 class="widget-title">Recommended Reading</h3>
+ <div>
+ <a href="http://www.amazon.com/gp/product/0321562992?ie=UTF8&tag=tiraniaorg-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0321562992">
+ <img border="0" src="https://images-na.ssl-images-amazon.com/images/I/51uwyv0A0QL._SL160_.jpg"></a>
+ <img src="http://www.assoc-amazon.com/e/ir?t=tiraniaorg-20&l=as2&o=1&a=0321562992" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
+ <p>
+
+ <a href="http://www.amazon.com/gp/product/0123704901?ie=UTF8&tag=tiraniaorg-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0123704901">
+ <img border="0"
+ src="https://images-na.ssl-images-amazon.com/images/I/517kQTy1i7L._SL160_.jpg"></a>
+ <img src="http://www.assoc-amazon.com/e/ir?t=tiraniaorg-20&l=as2&o=1&a=0123704901"
+ width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
+ </div>
+ </li>
+
+ <li class="widget-container">
+ <h3 class="widget-title">Pictures:</h3>
+ <div><a href="http://picasaweb.google.com/miguel.de.icaza/?pli=1">Picasa</a><br/>
+ <a href="http://www.flickr.com/photos/migueldeicaza/">Flickr</a>
+ </li>
+ </ul>
+
+ <div class="separator"> </div>
+
+ @ARCHIVE_NAVIGATOR@
+
+ <p>
+ <a href="http://www.go-mono.com"><img src="http://www.go-mono.com/images/mono-contributor-static.gif" alt="mono-contributor-static.gif" /></a>
+ </p>
+
+ <ul class="xoxo">
+ <li class="widget-container">
+ <h3 class="widget-title">Fundamental</h3>
+ <div><a href="http://www.go-mono.com/monologue">Mono Blogs</a><br>
+ <a href="http://www.commondreams.org">CommonDreams</a><br/>
+ <a href="http://grurrah.com/">Grurrah - Green Ideas</a><br/>
+ </div>
+ </li>
+ </ul>
+
+ </div> <!-- container -->
+ </div> <!-- main -->
+
+ <div id="footer">
+ </div> <!-- footer -->
+ </div> <!-- wrapper -->
+</body>
+</html>
+
+<div id='sidebar'>
+</div>
+
View
@@ -0,0 +1,14 @@
+%ENTRY_ANCHOR%
+<p>
+%ENTRY_NAVIGATION%
+<p>
+<div class='blogentry'>
+<h1><a href="%BASEDIR%%ENTRY_PERMALINK%" class="entryTitle">%ENTRY_CAPTION%</a></h1>
+%ENTRY_BODY%
+
+<div class='footer'>Posted by %COPYRIGHT% on <a href="%ENTRY_URL_PERMALINK%">%ENTRY_DATECAPTION%</a>
+%ENTRY_SPECIFIC%
+</div>
+
+%COMMENTS%
+</div><p>
View
@@ -0,0 +1,21 @@
+.code-xml, .code-csharp
+{
+ margin:15px;
+ padding:15px;
+ font-size: small;
+ font-family: "Courier New", Courier;
+ background:whitesmoke;
+ border: solid 1px silver;
+ line-height:110%;
+}
+
+.shell {
+ border-style: solid; background: #000000; color: #eeeeee;
+ border-width: 1px; padding: 2pt;
+ margin:15px;
+}
+
+.separator {
+ border-bottom: 1px dotted #aaaaaa; padding-top: 1em; padding-bottom: 1em;
+}
+
View
@@ -0,0 +1,119 @@
+var keywords = "";
+
+var keywordArray = new Array (
+ "abstract","event","new","struct","as","explicit","null","switch","base","extern",
+ "object","this","bool","false","operator","throw","break","finally","out","true",
+ "byte","fixed","override","try","case","float","params","typeof","catch","for",
+ "private","uint","char","foreach","protected","ulong","checked","goto","public",
+ "unchecked","class","if","readonly","unsafe","const","implicit","ref","ushort",
+ "continue","in","return","using","decimal","int","sbyte","virtual","default",
+ "interface","sealed","volatile","delegate","internal","short","void","do","is",
+ "sizeof","while","double","lock","stackalloc","else","long","static","enum",
+ "namespace","string");
+
+
+function paintColors ()
+{
+ keywords = "(";
+ for (n=0; n<keywordArray.length; n++)
+ keywords += "\\b" + keywordArray[n] + "\\b|";
+ keywords += "string)";
+
+ var elems = document.getElementsByTagName ("xmp");
+ for (n=elems.length - 1; n>=0; n--)
+ {
+ if (elems[n].className == "code-csharp") {
+ format (elems [n], formatCs);
+ }
+ else if (elems[n].className == "code-xml") {
+ format (elems [n], formatXml);
+ }
+ }
+ var elems = document.getElementsByTagName ("pre");
+ for (n=elems.length - 1; n>=0; n--)
+ {
+ if (elems[n].className == "code-csharp") {
+ format (elems [n], formatCs);
+ }
+ else if (elems[n].className == "code-xml") {
+ format (elems [n], formatXml);
+ }
+ }
+}
+
+function format (node, func)
+{
+ text = node.innerHTML;
+
+ div = document.createElement("div");
+ var className = node.className;
+
+ // remove trailing/leading lines
+ while (text.charAt (0) == "\n" || text.charAt (0) == "\r" )
+ text = text.substr (1);
+
+ while (text.charAt (text.length) == "\n" || text.charAt (text.length) == "\r" )
+ text = text.splice (0, -1);
+
+ div.innerHTML = func (text);
+ node.parentNode.replaceChild(div, node);
+ div.className = className;
+}
+
+function formatCs (text)
+{
+
+ var re = / /g;
+ text = text.replace (re, "&nbsp;");
+
+ // cant get this one to work in the good syntax
+ re = new RegExp ("\"((((?!\").)|\\\")*)\"","g");
+ text = text.replace (re,"<span style='color:purple'>\"$1\"</span>");
+
+ re = /\/\/(((.(?!\"\<\/span\>))|"(((?!").)*)"\<\/span\>)*)(\r|\n|\r\n)/g;
+ text = text.replace (re,"<span style='color:green'>//$1</span><br/>");
+
+ re = new RegExp (keywords,"g");
+ text = text.replace (re,"<span style='color:blue'>$1</span>");
+
+ re = /\t/g;
+ text = text.replace (re,"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+
+ re = /\n/g;
+ text = text.replace (re,"<br/>");
+
+ div = document.createElement("div");
+ div.innerHTML = text;
+
+ spans = div.getElementsByTagName ("span")
+ for (i = 0; i < spans.length; i++) {
+ if (spans [i].parentNode.nodeName == "SPAN") {
+ spans [i].style.color = "";
+ }
+ }
+
+ return div.innerHTML;
+}
+
+function formatXml (text)
+{
+ var re = / /g;
+ text = text.replace (re, "&nbsp;");
+
+ re = /\t/g;
+ text = text.replace (re, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
+
+ re = /\<\s*(\/?)\s*(.*?)\s*(\/?)\s*\>/g;
+ text = text.replace (re,"{blue:&lt;$1}{maroon:$2}{blue:$3&gt;}");
+
+ re = /{(\w*):(.*?)}/g;
+ text = text.replace (re,"<span style='color:$1'>$2</span>");
+
+ re = /"(.*?)"/g;
+ text = text.replace (re,"\"<span style='color:purple'>$1</span>\"");
+
+ re = /\r\n|\r|\n/g;
+ text = text.replace (re, "<br/>");
+
+ return text;
+}
Oops, something went wrong.

0 comments on commit 84085b1

Please sign in to comment.