andreaskoch / allmark

A cross-platform markdown web server
https://allmark.io
Other
314 stars 73 forks source link

404 error on requests for included images #34

Closed ogaida closed 4 years ago

ogaida commented 4 years ago

Thank you very much for this great tool!

my problem:

given:

image

result in allmark:

image

debug:

you can see the 400er error, when the png-files are requested.

C:\temp\ci>allmark server
allmark - The standalone markdown webserver (Version: v0.10.0-dev)

Usage:
allmark <command> <repository path>

Available commands:
     init  Initialize the configuration
    serve  Start serving the supplied repository via HTTP and HTTPs

Fork me on GitHub "https://github.com/andreaskoch/allmark"

C:\temp\ci>allmark serve
2020/07/16 11:58:24         Debug    Re-initializing the repository index.
2020/07/16 11:58:24         Debug    Scanning directory "C:\\temp\\ci"
2020/07/16 11:58:24         Debug    Creating a physical item from route ""
2020/07/16 11:58:24         Debug    ------- Sub Indexes for "C:\\temp\\ci" ---------------
2020/07/16 11:58:24         Debug    Sub index (old):
<empty-tree>
2020/07/16 11:58:24         Debug    Sub index (new):
- <no-name-assigned>
2020/07/16 11:58:24         Debug    "" was not found in
<empty-tree>
2020/07/16 11:58:24         Debug    "": new
2020/07/16 11:58:24         Debug    ------- Difference ---------------
2020/07/16 11:58:24         Debug    New: 1
2020/07/16 11:58:24         Debug    Modified: 0
2020/07/16 11:58:24         Debug    Deleted: 0
2020/07/16 11:58:24         Debug    ------- Full Indexes ---------------
2020/07/16 11:58:24         Debug    Old Index:
<empty-tree>
2020/07/16 11:58:24         Debug    New Index:
- <no-name-assigned>
2020/07/16 11:58:24         Debug    sendUpdate(Update (New: 1, Modified: 0, Deleted: 0)): Notifying all subscribers
2020/07/16 11:58:24          Info    Reindexing: Off
2020/07/16 11:58:24          Info    Live Reload: Off
2020/07/16 11:58:24          Info    Open URL: http://localhost:33001
2020/07/16 11:58:24          Info    HTTP Endpoint: [::]:33002
2020/07/16 11:58:24          Info    HTTP Endpoint: 0.0.0.0:33001
2020/07/16 11:58:25         Debug    Requesting ""
2020/07/16 11:58:25         Debug    Parsing item ""
2020/07/16 11:58:25         Debug    Converting markdown for item "".
2020/07/16 11:58:25         Debug    Returning item ""
::1 - - [16/Jul/2020:11:58:25 +0200] "GET / HTTP/1.1" 200 5169
2020/07/16 11:58:25         Debug    Requesting "class_old.png"
2020/07/16 11:58:25          Warn    File "class_old.png" was not found.
2020/07/16 11:58:25         Debug    No item or file found for route "class_old.png"
2020/07/16 11:58:25         Debug    Requesting "class_new.png"
2020/07/16 11:58:25          Warn    File "class_new.png" was not found.
2020/07/16 11:58:25         Debug    No item or file found for route "class_new.png"
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /class_old.png HTTP/1.1" 404 2962
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /class_new.png HTTP/1.1" 404 2962
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /theme/modernizr.js HTTP/1.1" 200 14633
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /theme/codehighlighting/highlight.css HTTP/1.1" 200 2619
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /theme/screen.css HTTP/1.1" 200 13248
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /theme/jquery.tmpl.js HTTP/1.1" 200 6009
::1 - - [16/Jul/2020:11:58:25 +0200] "GET /theme/jquery.js HTTP/1.1" 200 84246
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/lazysizes.js HTTP/1.1" 200 5732
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/search.js HTTP/1.1" 200 975
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/site.js HTTP/1.1" 200 1145
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/latest.js HTTP/1.1" 200 813
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/typeahead.js HTTP/1.1" 200 29675
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/presentation.js HTTP/1.1" 200 2967
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/codehighlighting/highlight.js HTTP/1.1" 200 47867
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/github-ribbon.png HTTP/1.1" 200 7327
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /theme/print.css HTTP/1.1" 200 1570
2020/07/16 11:58:26    Statistics    Priming the latest items cache took 0.000000 seconds.
2020/07/16 11:58:26         Debug    Converting markdown for item "".
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /latest HTTP/1.1" 200 3874
::1 - - [16/Jul/2020:11:58:26 +0200] "GET /opensearch.xml HTTP/1.1" 200 503
ogaida commented 4 years ago

The markdown documents must follow a convention to work with allmark. All referenced objects must be under the files folder. Of course, this makes it much more difficult to start with a complex file tree full of markdown documents. All documents have to be revised.

I would like to have allmark without this convention. So this is more a nice2have instead an issue. What is the reason for this convention?