<bobthecow>
'course i shopped around a bit and found out that new jersey has a subsidy on LED bulbs, so i drove across the bridge and bought them there.
<bobthecow>
for $7 each :)
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
alerante has quit [Ping timeout: 255 seconds]
VitamineD has quit [Quit: Leaving.]
VitamineD has joined #nanoc
VitamineD has quit [Quit: Leaving.]
achal has joined #nanoc
skroon_ has quit [Ping timeout: 265 seconds]
alerante has joined #nanoc
alerante has quit [Ping timeout: 265 seconds]
<ddfreyne>
tom[]: oh you
skroon has joined #nanoc
relix has joined #nanoc
relix has quit [Client Quit]
irsol has quit [Read error: Operation timed out]
irsol has joined #nanoc
alerante has joined #nanoc
alerante has quit [Read error: Operation timed out]
ics_ has quit [Ping timeout: 246 seconds]
ics has joined #nanoc
relix has joined #nanoc
VitamineD has joined #nanoc
MaZderMind has joined #nanoc
<MaZderMind>
hi all. i have written a url-to-thumbnail filter which unfortunately is called once for every url, no matter if the output file is current or not.
<MaZderMind>
nanoc is recognizing that the file doesn't need a re-compile (it is not issuing an "update .../thumb.png" line
<MaZderMind>
but the filter is called anyway
<MaZderMind>
is this expected behaviour and how can I stop the filter from re-generating the tumbs again and again?
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
relix has joined #nanoc
<MaZderMind>
sorry for bugging you. it seems if you let it run throup and not canel it with ctrl-c beforehand, it does the business. no worries :)
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alerante has joined #nanoc
alerante has quit [Changing host]
alerante has joined #nanoc
relix has joined #nanoc
<MaZderMind>
hum actually it's still a problem the filter failed (avconv-problem) after ~200 videos. restarting nanoc reruns the filter for all 200 videos, despite the .pngs are there and nanoc knows that, because it does not print an "updating..." line
<bobthecow>
MaZderMind: nanoc suppresses the "updating" line if the file's identical, even if it had to do a full compile to figure that out.
<bobthecow>
there's a good chance you're doing something, either with your filter or your site configuration, which makes it so that nanoc can't properly track dependencies for those items.
<bobthecow>
run nanoc show-data (after a successful compile) and see if that gives you any hints?
<MaZderMind>
bobthecow: okay, that explains the missing updating line
<MaZderMind>
the items are generated on-the-fly in a custom DataSource
<bobthecow>
oh. are you specifying an mtime for them?
<MaZderMind>
I added a {:mtime => DateTime.new(2000, 1, 1) }) to make sure, nanoc will only filter/compile the items once
<bobthecow>
and are you giving a checksum in your data source?
<bobthecow>
i'm not sure what happens when you don't...
<MaZderMind>
ah :) interesting
<bobthecow>
it's possible nanoc decides that it can't tell whether the items change?
<bobthecow>
ddfreyne would know better than i.
<bobthecow>
i just know i always use checksum and mtime for custom data sources :)
<bobthecow>
basically nanoc is really really conservative.
<bobthecow>
if it thinks there's any possible chance that the item would change if recompiled, it will recompile.
<bobthecow>
which is what you want a static site generator to do...
<bobthecow>
it's just not awesome when you have something like this which recompiles every time :P
<bobthecow>
for a while i had something on my site that was making all (~5000) items depend on all other items.
<MaZderMind>
well, yes. The thing is thet the videos I'm generating a site for are hosted on a ftp-server, so to get the mtime & checksum right, I'd have to download gigabytes of data
<MaZderMind>
just to find that they did not change and the thumbs can stay as they are
<MaZderMind>
I'm trying with fixed checksums and mtimes right now
<bobthecow>
you can get the mtime via ftp.
<bobthecow>
and as long as it's centralized, you probably can use just the mtime, and don't need to worry about the checksum
<MaZderMind>
yes, that's true, but as it does not work with a fixed mtime, there's no point in implementing that yet
<bobthecow>
so passing a fixed checksum (or a hash of the mtime) should be fine.
<bobthecow>
did you try `nanoc show-data` to see what things depend on?
<MaZderMind>
okay, just to make sure: if a nanoc run fails and i restart it, should it regenerate everything or just what was missing from before?
<bobthecow>
it should regenerate everything if it fails
<bobthecow>
because it doesn't know.
<MaZderMind>
k, that explains it a little
<MaZderMind>
it failed after ~2 hours because of a broken video (and thus a failed filter)
<MaZderMind>
and I wondered why it started from scratch after that
<bobthecow>
are you downloading video while compiling?
<MaZderMind>
only the first 20 seconds
<MaZderMind>
just enough to get a thumbnail
<bobthecow>
if you just did that bit by itself, how long would it take you to download the video (without compiling)
<bobthecow>
what i'm asking about is whether it makes sense to split the "download video" and "compile site" into two phases.
<MaZderMind>
from each video my filter is downloading the first few MBs and generates a thumbnail from that
<bobthecow>
that is often the case with remote data sources.
<MaZderMind>
that may make sense. I hoped to have nanoc manage the "which thumbs do I have already" part
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bobthecow>
do you ever need to worry about updating a thumb?
<MaZderMind>
nop
<MaZderMind>
but about adding more videos later
<bobthecow>
gotcha.
alerante has quit [Remote host closed the connection]
<bobthecow>
so even mtime doesn't matter, so much as existence.
jugglinmike has joined #nanoc
<bobthecow>
do video urls ever change?
<MaZderMind>
existence does: when a video is added, the datasource picks the new video up but its thumb is missing, so nanoc will call the filter which tuns an url into a png
<bobthecow>
but you could hardcode both an mtime and a checksum. all you need to know is if you have a new file.
<MaZderMind>
i already did that: {:mtime => DateTime.new(2000, 1, 1), :checksum => url.checksum }
<bobthecow>
yeah, but a failed compile will still screw you.
<stbuehler>
a failed compile shouldn't create the target file, right?
<MaZderMind>
it won't
<MaZderMind>
that's why the filter fails (binary filter did not write anything ...)
<bobthecow>
stbuehler: the problem is that a failed compile will make nanoc recompile (i.e. not respect timestamps and stuff)
<stbuehler>
bobthecow: recompile everything? oO.
<bobthecow>
without making it through a full compile, nanoc has no way of knowing what items depend on other items.
<MaZderMind>
couldn't the filter check if the output file is there and if it is, just copy that file into the tmp-file?
<stbuehler>
MaZderMind: you probably could hack it that way. although just writing a simple Makefile sounds so much easier :)
<MaZderMind>
Makefile just for the thumbnails.. that could work out
<MaZderMind>
but for the whole video-portal-html-foo nanoc is just beauty
<bobthecow>
MaZderMind: i'm thinking there's a way to use datasource #sync or a nanoc command to make it work for you.
<bobthecow>
really, though, you want your video transfer to be out-of-band of the rest of a compile.
<bobthecow>
you don't want it to screw you on recompiles and such.
<MaZderMind>
I'm not downloading all the videos. my filter just calls `avconv -i #{url.shellescape} -ss 20 -frames:v 1 -vf scale='iw*sar:ih' -f image2 -c png #{output_filename.shellescape} >/dev/null 2>&1` and generates a single png from the video-url
<VitamineD>
but you still need a connection to build your site
<MaZderMind>
yes, I do. that's part of the project. even the datasource fetch their information from an external xml api
<MaZderMind>
I now understand, why thins happen as they happen, thank you for that.
<bobthecow>
DataSource#sync is made for things like this.
<bobthecow>
the rule of thumb is that external requests should never happen during compile.
<bobthecow>
you put all that garbage in #sync
<bobthecow>
then run
<bobthecow>
nanoc sync; nanoc compile
<MaZderMind>
ah i see
<bobthecow>
so #sync would download, at the very least, the xml api data it needs to populate the items.
<MaZderMind>
where would a datasource store its local cache?
<MaZderMind>
in content/ ?
<bobthecow>
wherever you want :)
<bobthecow>
not in content.
<bobthecow>
that's another datasource's folder.
<MaZderMind>
kk - that was the question ^^
<bobthecow>
make up a new one.
<MaZderMind>
ok, that sounds reasonable
<bobthecow>
i have a top level folder called /data/ in my project, and several data sources write to it.
<MaZderMind>
sync will do all the networking stuff and care for fetching only missing files, compile will just do that - compile from prefetched information
<bobthecow>
yeah.
<MaZderMind>
I'll try to go that way, thank you!
<bobthecow>
and that way a failed compile doesn't screw you,
<MaZderMind>
nice, thank you.
<bobthecow>
and a compile will be a lot less likely to fail because it doesn't depend on an external data source.
<MaZderMind>
kk. going that route. thank you very much
<bobthecow>
let us know if you run into other issues.
<MaZderMind>
i will, be assured
alerante has joined #nanoc
alerante has quit [Ping timeout: 255 seconds]
<ddfreyne>
MaZderMind: nanoc will only redo everything if a compilation fails
<ddfreyne>
So it is not truly incremental
<ddfreyne>
hand hurts, can't type much
<ddfreyne>
slightly sick, will talk later.
<VitamineD>
that's what you get for being serious on twitter
<MaZderMind>
ddfreyne: yes, bobthecow explained that to me. he also pointed the difference between sync and compile out and that's the way to go for my exact issue
alerante has joined #nanoc
<tom[]>
ddfreyne: get well soon
skroon has quit [Ping timeout: 240 seconds]
louquillio_ has quit [Remote host closed the connection]
louquillio_ has joined #nanoc
skroon has joined #nanoc
VitamineD has quit [Quit: Leaving.]
VitamineD has joined #nanoc
alerante has quit [Remote host closed the connection]
alerante has joined #nanoc
alerante has quit [Ping timeout: 246 seconds]
<travis-ci>
[travis-ci] nanoc/nanoc/fix/stylesheet-href a13bf59 Denis Defreyne: The build passed.
VitamineD1 has joined #nanoc
VitamineD has quit [Ping timeout: 265 seconds]
FunkyPenguin has quit [Read error: Connection reset by peer]
FunkyPenguin has joined #nanoc
Boom_Farmer has joined #nanoc
<Boom_Farmer>
I'm a total newb at this, but how do I get relative paths for internal links and CSS? I'm installing nanoc in a subdirectory.
<Boom_Farmer>
I keep seeing references to "filter :relativize_paths, :type => :css" but I don't know where to put it in the Rules file.
<bobthecow>
Boom_Farmer: you put that in a compile rule for any css file you want to relativize paths in.
<Boom_Farmer>
bobthecow: I recognize some of those words.
<bobthecow>
paste your rules file and i can tell you where that is for you :) https://gist.github.com
<ddfreyne>
Boom_Farmer: You need nokogiri, which is an HTML parser. The error message tells you what to do (Install the 'nokogiri' gem using `gem install nokogiri`.)
<ddfreyne>
(If you have a Gemfile (which I believe you don't), add nokogiri to there instead, and run `bundle`)
<Boom_Farmer>
Wow, I'm snakebit.
<Boom_Farmer>
O.o
<Boom_Farmer>
Failed to build nokogiri.
<ddfreyne>
:(
<ddfreyne>
Boom_Farmer: Does it say anything about requiring Ruby 1.9.3?
<Boom_Farmer>
No, but ruby --version gives 1.9.3p194.
<ddfreyne>
Boom_Farmer: can you share the exact nokogiri build error message?
<guardian>
well I have nanoc + compass for my site but I'm not sure bootstrap is meant to go along with compass
<ddfreyne>
That template hasn't been updated in a long time but it's still correct
<ddfreyne>
guardian: not sure
<ddfreyne>
Find out and tell me your adventures!
<guardian>
I just discovered bootstrap sass is officially maintained
<guardian>
so likely scrapping compass, using sass filter + official bootstrap sass will do it
<bobthecow>
compass == sass.
<guardian>
well no?
<bobthecow>
compass + bootstrap sass would do the same.
<bobthecow>
if you want to use compass, too.
<guardian>
ah yeah not sure I want/need compass
<guardian>
if I have bootstrap right?
<bobthecow>
it depends whether you're doing other stuff.
<bobthecow>
if it's fairly straightforward bootstrap with minimal customization, then no.
<guardian>
I'm back to my doc stuff, I asked about weeks ago
<bobthecow>
but if you're doing image spriting, fancy stuff.
<bobthecow>
then you might want compass?
<guardian>
so I'm going bootstrap, then one of our designer will customize the visual
<guardian>
ah yeah image spriting maybe... not sure I need that
<guardian>
I started that doc project with Zurb but I've been unimpressed, then the designer told me he wants to unify the visual appearance of our brand, and two of the products already use bootstrap
<guardian>
so I'll likely replace the zurb sidebar template with its bootstrap equivalent
<guardian>
and let him style from there
<bobthecow>
start out with sass, not compass... then add compass back in when/if you need it.
<bobthecow>
you should be fine without.
<guardian>
but my memory seemed to have fail me: I thought bootstrap meant less
<guardian>
so I would have had to tweak the integration with nanoc
<bobthecow>
bootstrap is less.
<guardian>
but since bootstrap's sass version is an offcial port, seems reasonable to keep going the sass route
<bobthecow>
bootstrap-sass is sass.
<bobthecow>
right. so use bootstrap-sass + sass.
<bobthecow>
i'm agreeing with you :)
alerante has joined #nanoc
<guardian>
what does a nanoc + bootstrap (less) require?
<guardian>
just to satisfy my curiosity
<guardian>
I think I've seen nanoc websites on github invoking an external command to process .less
<guardian>
looks a bit ugly compared to using the :sass filter
<bobthecow>
you can use the less filter for nanoc.
<bobthecow>
which is exactly the same ugly.
<bobthecow>
justinhileman.info is less based.
<bobthecow>
and even uses some bootstrap.less mixins :)
<guardian>
ah well nanoc has a less filter apparently, so it's equally easy to support less I guess
<bobthecow>
yep.
<guardian>
I'll toy with that thanks for agreeing :)
<guardian>
it's good to have an expert opinion
<bobthecow>
the only thing you *might* run into is getting the less gem to install in ruby.
alerante has quit [Ping timeout: 265 seconds]
<guardian>
oh well yeah, same with sass then
achal has quit [Quit: Connection closed for inactivity]
jugglinmike has quit [Quit: Leaving.]
alerante has joined #nanoc
alerante has quit [Ping timeout: 255 seconds]
alerante has joined #nanoc
alerante has quit [Ping timeout: 240 seconds]
alerante has joined #nanoc
tom[] has quit [Read error: Connection reset by peer]