Changeset 593 for lang/io/ioblosxom
- Timestamp:
- 10/21/07 22:29:42 (6 years ago)
- Location:
- lang/io/ioblosxom
- Files:
-
- 2 modified
-
ioblosxom.io (modified) (5 diffs)
-
template.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/io/ioblosxom/ioblosxom.io
r573 r593 2 2 # vim:ft=io: 3 3 4 #f := CGI clone parse5 #f print6 7 4 doFile("eio.io") 8 5 6 Object p := method( 7 writeln(self) 8 self 9 ) 10 9 11 IoBlosxom := Object clone do ( 12 13 dataDirectory := "data" 14 title := "IoBlosxom" 15 10 16 Entry := Object clone do ( 11 17 file := File clone 18 name := "" 12 19 title := "" 13 20 body := "" 14 time := ""21 date := "" 15 22 16 23 setFile := method(v, … … 24 31 self flavour := pathInfo last afterSeq(".") ifNilEval("html") 25 32 self pathInfo last clipAfterStartOfSeq(".") 33 self home := System getenv("SCRIPT_NAME") ifNilEval("/") 34 self path := System getenv("SCRIPT_NAME") ifNilEval("/") split("/") removeLast 26 35 27 36 self title := "IoBlosxom" 28 self entries := self filters(self getEntries(Directory with( "data")))37 self entries := self filters(self getEntries(Directory with(dataDirectory))) 29 38 self debugObj := list(pathInfo, flavour) 30 39 … … 33 42 34 43 filters := method(entries, 35 entries sortInPlace(time) reverse 44 # self pathInfo = list("", "2007", "10") 45 y := self pathInfo at(1) ifNilEval("") asNumber 46 m := self pathInfo at(2) ifNilEval("") asNumber 47 d := self pathInfo at(3) ifNilEval("") asNumber 48 entries sortInPlace(date) reverse select (e, 49 d isNan ifFalse( if (e date day != d, continue) ) 50 m isNan ifFalse( if (e date month != m, continue) ) 51 if (y isNan, 52 if (self pathInfo at(1) isNil, 53 true 54 , 55 e name beginsWithSeq(self pathInfo join("/")) 56 ) 57 , 58 if (e date year == y, true) 59 ) 60 ) 36 61 ) 37 62 … … 49 74 e title = l at(0) 50 75 e body = l slice(1) 51 e time = f lastDataChangeDate 76 e date = f lastDataChangeDate 77 e name = f path asMutable removePrefix(dataDirectory) clipAfterStartOfSeq(".") 52 78 e 53 79 )) … … 57 83 ret 58 84 ) 59 )60 61 Object p := method(62 writeln(self)63 self64 85 ) 65 86 -
lang/io/ioblosxom/template.html
r573 r593 71 71 <body> 72 72 <div id="whole"> 73 <h1 id="top"><a href=" /"><%=title%></a></h1>73 <h1 id="top"><a href="<%=home%>/"><%=title%></a></h1> 74 74 75 75 <p class="debug"><%=debugObj%></p> … … 79 79 <% entries foreach(entry, %> 80 80 <div class="entry"> 81 <h2 class="entry-title"><%=entry title%></h2> 81 <h2 class="entry-title"> 82 <a href="<%=home%><%=entry name%>" rel="bookmark"> 83 <%=entry title%> 84 </a> 85 </h2> 82 86 <dl class="entry-information"> 83 87 <dt>DateTime</dt> 84 <dd><%=entry time asString%></dd> 88 <dd><%=entry date asString%></dd> 89 <dt>Path</dt> 90 <dd><%=entry name%></dd> 85 91 </dl> 86 92 <div class="content">
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)