posativ / acrylamid

(unmaintained) static blog generator in python with incremental rendering ⛺
http://posativ.org/acrylamid/
Other
277 stars 40 forks source link

W3C check fails if WWW_ROOT has a subdirectory #179

Closed vbeffara closed 11 years ago

vbeffara commented 11 years ago

Hi,

Cool to have the W3C check feature! Unfortunately it does not work if WWW_ROOT is not a plain hostname. If WWW_ROOT='http://example.com/subdir/' then adding debug code in check.py I find requests to URIs like this:

http://example.com/subdir/subdir/index.html

(i.e. the WWW_ROOT subdir is duplicated). Interestingly, sometimes files like output/subdir/subdir/index.html are indeed generated, but only when there is an exception somewhere, and I cannot reproduce ...

BTW, version is 0.7.7 from pip

posativ commented 11 years ago

Hey,

I couldn't reproduce this error on my first try:

~/issue-179> acrylamid check
/prefix/ Abort
/prefix/2012/die-verwandlung/ Abort
/prefix/articles/ Abort
/prefix/atom/ Abort
/prefix/rss/ Abort

with WWW_ROOT set to http://example.org/prefix/. Did you edit OUTPUT_DIR in some way?

I have also noticed that the check command needs some documentation... for example the current implementation requires your blog already deployed (it only calls the validator with the final URL instead of uploading the HTML files itself).

vbeffara commented 11 years ago

Well, that is exactly the error! The list displayed by the command above has the subdir only once, but the URI sent to the W3C validation service is this one with WWW_ROOT prepended - which has the subdir twice in it. Hence the W3C gets a 404 error and returns Abort, which is shown.