0
ルートURLを相対リンクで使用するにはどうすればよいですか?このタグは、適切な場所を指しているようには見えません。MiddlemanにルートURLの相対リンクを取得させるにはどうすればよいですか?
<%= link_to 'Home', '/' %>
私はこのような局部的に再現できます。
gem install middleman
middleman new site
cd site
echo "<%= link_to 'Home', '/' %>" > source/index.html.erb
echo "set :relative_links, true" >> config.rb
middleman build
# start webserver from the middleman root directory, not the build directory.
# This simulates a local url where the root url is not the `/`.
python -m SimpleHTTPServer &
open http://localhost:8000/build
あなたが「ホーム」のリンクは/ではなく/サイトの相対的な家である建てるのに戻っていることがわかります。
ソリューションではなく、単なるコメントです。あなたは 'link_to 'なしでいつでも行うことができ、動的に生成されたページでも手でリンクを生成します。 '<%= i.title%>' – helcim