Changeset 606
- Timestamp:
- 10/22/07 12:00:58 (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
r604 r606 14 14 15 15 set hidden 16 set termencoding=utf-8 17 set encoding=utf-8 18 set fileencodings=utf-8 19 set fileencoding=utf-8 16 20 17 21 function Inspect(obj) … … 28 32 endfunction 29 33 30 call Template("head.html", {"title": "This is Vim." })34 call Template("head.html", {"title": "This is Vim.", "home": $SCRIPT_NAME}) 31 35 32 36 … … 38 42 39 43 call Inspect($PATH_INFO) 44 call Inspect($SCRIPT_NAME) 45 46 40 47 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) > 0 54 call Inspect(str2nr(pathinfo[0])) 55 if str2nr(pathinfo[0]) == 0 56 call Inspect("path") 57 call filter(a:entries, '!match(v:val["name"], "^'.$PATH_INFO.'")') 58 else 59 "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) > 1 62 call filter(a:entries, 'strftime("%m", v:val["time"]) == '.string(pathinfo[1])) 63 if len(pathinfo) > 2 64 call filter(a:entries, 'strftime("%d", v:val["time"]) == '.string(pathinfo[2])) 65 end 66 endif 67 endif 68 endif 69 endfunction 70 41 71 let files = split(glob("data/**/*.txt"), "\n") 42 72 let entries = sort(map(files, '{"path": v:val, "time": getftime(v:val)}'), "CompareByTime") … … 45 75 let ent["title"] = file[0] 46 76 let ent["body"] = join(file[1:], "\n") 47 let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", " ")77 let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", "g") 48 78 let ent["date"] = strftime("%Y-%m-%d %H:%M:%S", ent["time"]) 49 let ent["home"] = $SCRIPT_NAME ? $SCRIPT_NAME : ""79 let ent["home"] = $SCRIPT_NAME 50 80 let ent["path"] = join(split(ent["home"], "/")[0:-1], "/") 51 " call Out(ent["title"] . " " . ent["path"] . "\n") 81 endfor 82 83 call FilteringByPathInfo(entries) 84 85 for ent in entries 52 86 call Template("story.html", ent) 53 87 endfor … … 58 92 silent exe "w " . tempname() 59 93 silent exe "!cat %" 94 "silent echo join(getline(1, line("$")), "\n") 60 95 q! -
lang/vim/blosxom.vim.cgi/head.html
r604 r606 2 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 3 <head> 4 <title> </title>4 <title>#{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=" /">#{title}</a></h1>63 <h1 id="top"><a href="#{home}/">#{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)