Changeset 606

Show
Ignore:
Timestamp:
10/22/07 12:00:58 (6 years ago)
Author:
cho45
Message:

lang/vim/blosxom.vim.cgi/head.html,
lang/vim/blosxom.vim.cgi/blosxom.vim.cgi:

これでなおるかな? svk やめて svn で

cd lang/vim
$ svn merge -r 605:598 http://svn.coderepos.org/share/lang/vim/

Location:
lang/vim/blosxom.vim.cgi
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/vim/blosxom.vim.cgi/blosxom.vim.cgi

    r604 r606  
    1414 
    1515set hidden 
     16set termencoding=utf-8 
     17set encoding=utf-8 
     18set fileencodings=utf-8 
     19set fileencoding=utf-8 
    1620 
    1721function Inspect(obj) 
     
    2832endfunction 
    2933 
    30 call Template("head.html", {"title": "This is Vim."}) 
     34call Template("head.html", {"title": "This is Vim.", "home": $SCRIPT_NAME}) 
    3135 
    3236 
     
    3842 
    3943call Inspect($PATH_INFO) 
     44call Inspect($SCRIPT_NAME) 
     45 
     46 
    4047call Out(strftime("%Y-%m-%d %H:%M:%S\n")) 
     48 
     49 
     50function 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 
     69endfunction 
     70 
    4171let files = split(glob("data/**/*.txt"), "\n") 
    4272let entries = sort(map(files, '{"path": v:val, "time": getftime(v:val)}'), "CompareByTime") 
     
    4575        let ent["title"] = file[0] 
    4676        let ent["body"] = join(file[1:], "\n") 
    47         let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", "") 
     77        let ent["name"] = substitute(ent["path"], '^data\|.[^.]*$', "", "g") 
    4878        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 
    5080        let ent["path"] = join(split(ent["home"], "/")[0:-1], "/") 
    51         " call Out(ent["title"] . " " . ent["path"] . "\n") 
     81endfor 
     82 
     83call FilteringByPathInfo(entries) 
     84 
     85for ent in entries 
    5286        call Template("story.html", ent) 
    5387endfor 
     
    5892silent exe "w " . tempname() 
    5993silent exe "!cat %" 
     94"silent echo join(getline(1, line("$")), "\n") 
    6095q! 
  • lang/vim/blosxom.vim.cgi/head.html

    r604 r606  
    22<html xmlns="http://www.w3.org/1999/xhtml"> 
    33        <head> 
    4                 <title></title> 
     4                <title>#{title}</title> 
    55                <style type="text/css"> 
    66                        body { 
     
    6161        <body> 
    6262                <div id="whole"> 
    63                         <h1 id="top"><a href="/">#{title}</a></h1> 
     63                        <h1 id="top"><a href="#{home}/">#{title}</a></h1> 
    6464 
    6565                        <div id="content">