Compojure を使用して Wordpress のパーマリンクを模倣しようとしていますが、複数のパラメーターを使用するとすべての静的ファイル (css、js、および img) が見つからないのはなぜですか? これが私のコードです。
(defroutes approutes
(GET "/" [] (posts-for-home))
(GET "/:year/:month/:title" [year month title :as {uri :uri}] (single/tpl-single uri))
(route/resources "/")
(route/not-found "<h1>Page not found</h1>"))
(def app
(handler/site approutes))
ブラウザのデバッグ コンソールで、css がhttp://localhost:3000/2014/11/test/css/main.css
ではなく提供されているのを見ましたhttp://localhost:3000/css/main.css
。次に、テスト ルートを 1 つ追加し、次のようなパラメーターのみを使用しました。
(GET "/:testparameter" [testparameter] (single/tpl-single testparameter))
そのルートは完璧に機能していました。にアクセスしたときhttp://localhost:3000/justfortest
、すべての静的ファイルはルート パスから提供されていました。この複数のパラメータの問題を解決するにはどうすればよいですか? 答えてくれてありがとう。