Changeset 621 for lang/vim/blosxom.vim.cgi
- Timestamp:
- 10/23/07 08:49:04 (6 years ago)
- Location:
- lang/vim/blosxom.vim.cgi
- Files:
-
- 2 modified
-
blosxom.vim.cgi (modified) (5 diffs)
-
head.html (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/vim/blosxom.vim.cgi/blosxom.vim.cgi
r606 r621 14 14 15 15 set hidden 16 set termencoding=utf-817 set encoding=utf-818 set fileencodings=utf-819 set fileencoding=utf-820 16 21 17 function Inspect(obj) … … 32 28 endfunction 33 29 34 call Template("head.html", {"title": "This is Vim." , "home": $SCRIPT_NAME})30 call Template("head.html", {"title": "This is Vim."}) 35 31 36 32 … … 42 38 43 39 call Inspect($PATH_INFO) 44 call Inspect($SCRIPT_NAME)45 46 47 40 call Out(strftime("%Y-%m-%d %H:%M:%S\n")) 48 49 50 function FilteringByPathInfo(entries)51 let pathinfo = split($PATH_INFO, "/")52 call Inspect(pathinfo)53 if len(pathinfo) > 054 call Inspect(str2nr(pathinfo[0]))55 if str2nr(pathinfo[0]) == 056 call Inspect("path")57 call filter(a:entries, '!match(v:val["name"], "^'.$PATH_INFO.'")')58 else59 "call Inspect('strftime("%Y", v:val["time"]) == '.string(pathinfo[0]))60 call filter(a:entries, 'strftime("%Y", v:val["time"]) == '.string(pathinfo[0]))61 if len(pathinfo) > 162 call filter(a:entries, 'strftime("%m", v:val["time"]) == '.string(pathinfo[1]))63 if len(pathinfo) > 264 call filter(a:entries, 'strftime("%d", v:val["time"]) == '.string(pathinfo[2]))65 end66 endif67 endif68 endif69 endfunction70 71 41 let files = split(glob("data/**/*.txt"), "\n") 72 42 let entries = sort(map(files, '{"path": v:val, "time": getftime(v:val)}'), "CompareByTime") … … 75 45 let ent["title"] = file[0] 76 46 let ent["body"] = join(file[1:], "\n") 77 let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", " g")47 let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", "") 78 48 let ent["date"] = strftime("%Y-%m-%d %H:%M:%S", ent["time"]) 79 let ent["home"] = $SCRIPT_NAME 49 let ent["home"] = $SCRIPT_NAME ? $SCRIPT_NAME : "" 80 50 let ent["path"] = join(split(ent["home"], "/")[0:-1], "/") 81 endfor 82 83 call FilteringByPathInfo(entries) 84 85 for ent in entries 51 " call Out(ent["title"] . " " . ent["path"] . "\n") 86 52 call Template("story.html", ent) 87 53 endfor … … 92 58 silent exe "w " . tempname() 93 59 silent exe "!cat %" 94 "silent echo join(getline(1, line("$")), "\n")95 60 q! -
lang/vim/blosxom.vim.cgi/head.html
r606 r621 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 3 <head> 4 <title> #{title}</title>4 <title></title> 5 5 <style type="text/css"> 6 6 body { … … 61 61 <body> 62 62 <div id="whole"> 63 <h1 id="top"><a href=" #{home}/">#{title}</a></h1>63 <h1 id="top"><a href="/">#{title}</a></h1> 64 64 65 65 <div id="content">
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)