Re: Help publishing a website
Dan Sharp <[email protected]>
| Newsgroups | gmane.comp.tools.aap.user |
|---|---|
| Message-ID | <[email protected]> |
Bram Moolenaar wrote:
> Dan Sharp wrote:
>
<snip>
>
> OK, this is the reason: The files in "ftplugin" are first used in a
> dependency without a directory name, thus as "index.html". Aap does
> remember that the file is in the "ftplugin" directory, thus it's a
> separate node from "index.html" in the top directory. But the short
> name is the one that's used for "%file%" in the publish attribute.
> Since it was first used without the directory name, "%file%" is replaced
> with "index.html" instead of "ftplugin/index.html".
That makes sense. I assumed %file% was simply replaced with the text
passed to the :attr command. It sounds like the text passed to :attr is
actually kind of a pointer to a node, and the short name from that node
is what is actually used to expand %file%?
> How to solve this problem? You apparently expected the name as it was
> used for ":attr" to be used for "%file%".
Correct
> Currently "%file%" isn't
> expanded until the publish action is done. Perhaps it should be done
> when executing the ":attr" command?
Or at least using the values passed to the :attr command. Maybe that is
the same as what you said.
> The result is that it would make a difference between:
>
> subdir/main.aap:
> :attr {publish = $PUB/%file%} index.html
>
> main.aap:
> :attr {publish = $PUB/%file%} subdir/index.html
>
> Even though "index.html" is the same file here and the value of the
> attribute is the same, you do expect different results, right?
Not quite sure I follow, exactly. Does subdir/main.aap and main.aap
indicate separate files here? If so, then I would assume $PUB in
subdir/main.aap would include 'subdir' and so both index.html files
would end up in the same place. If subdir/main.aap and main.aap are
targets in a single recipe, then I would expect index.html and
subdir/index.html to be two different files (subdir/main.aap affects
index.html in the current directory, and main.aap in the current
directory affects subdir/index.html). I guess I expect the paths given
to the :attr command to be relative to the current directory of the
script being executed. Was that at all clear?
Dan Sharp
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf