Help publishing a website
Dan Sharp <[email protected]>
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
I have puzzled with this off and on for a while, but I think I am going
to have to ask the experts now. I am having trouble publishing my
website with aap. It seems to build everything okay, but when I do a
publish, some directory names are being ignored, so most things are
getting dumped into the main directory instead of the specified
subdirectory.
I have attached a representative sample of what I am doing. I tried to
model my setup after what is in the documentation, but appear to have
missed something. Basically, my main.aap does
###
FTPROOT=file:~dwsharp/temp
:child ftplugin/main.aap
FILES = index.html
images/vim.moolenaar.vimlogo.png
ftplugin/$*FTPLUGIN_FILES
:attr {publish = $FTPROOT/%file%} $FILES
all: $FILES
:print $FILES
###
and the ftplugin/main.aap (attached here as ftplugin-main.aap) does
###
LIST_FILES = *.vim
:include ../common.aap
_top.FTPLUGIN_FILES = index.html
$LIST_FILES
all: $_top.FTPLUGIN_FILES
###
I thought a publish would create a tree like
/home/dwsharp/temp/index.html
/home/dwsharp/temp/images/vim.moolenaar.vimlogo.png
/home/dwsharp/temp/ftplugin/index.html
/home/dwsharp/temp/ftplugin/ant.vim
/home/dwsharp/temp/ftplugin/aspvbs.vim
...
but instead I end up with
/home/dwsharp/temp/index.html
/home/dwsharp/temp/images/vim.moolenaar.vimlogo.png
/home/dwsharp/temp/ant.vim
/home/dwsharp/temp/aspvbs.vim
...
so specifying 'images/vim.moolenaar.vimlogo.png' successfully creates
the subdirectory, but 'ftplugin/$*FTPLUGIN_FILES' does not.
Also, the ':print $FILES' command in main.aap correctly shows the list
of files as 'index.html images/vim.moolenaar.vimlogo.png
ftplugin/index.html ftplugin/*.vim' but a verbose publish never shows
ftplugin/index.html being copied, and the index.html I end up with is
the one for the main directory (which is correct, but means that the
ftplugin/index.html is not being touched at all in the publish;
otherwise, I would have expected it to overwrite the main one).
If anyone has some ideas and suggestions, I would love to hear them.
One thing I did notice is that the verbose publish shows
Aap: Copied "images/vim.moolenaar.vimlogo.png" to
"file:~dwsharp/temp/images/vim.moolenaar.vimlogo.png"
Aap: Copied "ftplugin/ant.vim" to "file:~dwsharp/temp/ant.vim"
Is there something extra that needs to be done when declaring a path
with a variable vs. a harcoded path?
Dan Sharp
common.aap
(text/plain, 674 B)
# Create a simple table of all the files in the directory.
listing.part: $LIST_FILES
@if len(source_list) > 0:
@import time
:print <table> >! $target
@for src in source_list:
fileEntry = `os.path.basename(src)`
timeEntry = `time.strftime("%Y-%m-%d", time.localtime(os.path.getmtime(src)))`
text << EOT
<tr>
<td><a href="$fileEntry">$fileEntry</a></td>
<td>Last Update: $timeEntry</td>
</tr>
EOT
:print $text >> $target
:print </table> >> $target
index.html : ../pretitle.part title.part ../posttitle.part body.part listing.part ../footer.part
:cat $source >! $target
ftplugin-main.aap
(text/plain, 138 B)
LIST_FILES = *.vim
:include ../common.aap
_top.FTPLUGIN_FILES = index.html
$LIST_FILES
all: $_top.FTPLUGIN_FILES
howto-main.aap
(text/plain, 354 B)
_top.HOWTO_FILES = index.html
Vim-Compile-Win32-HOWTO.html
Vim-Compile-Win32-HOWTO.pdf
Vim-Compile-Win32-HOWTO.txt
Vim-Compile-Win32-HOWTO.xml
Vim-Compile-Win32-HOWTO/*.html
unix2dos.bat
all: $_top.HOWTO_FILES
index.html : ../pretitle.part title.part ../posttitle.part body.part ../footer.part
:cat $source >! $target
main.aap
(text/plain, 655 B)
FTPROOT ?= file:~dwsharp/temp
:child ftplugin/main.aap
:child howto/main.aap
FILES =
index.html
images/vim.hughes.site.created.with.vim.png
images/vim.moolenaar.vimlogo.png
images/vim.randhol.Edited_with_VIM.png
ftplugin/$*FTPLUGIN_FILES
howto/$*HOWTO_FILES
:attr {publish = $FTPROOT/%file%} $FILES
all: $FILES
:print $FILES
index.html: pretitle.part title.part posttitle.part body.part footer.part
:cat $source
| :eval re.sub('../images/', 'images/', stdin) >! $target
# Get rid of the listing files we created.
clean:
:tree . {filename = listing.part}
:delete $(name)