We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
以下のような robots_disallow robots_text DSL を作りたい
robots_disallow
robots_text
domain('test.example.com') { proxy_to 'rails:3000' # 全部拒否 robots_disallow :all robots_disallow # または引数なしでも全部拒否とみなす # パス指定 robots_disallow '/api/' # 可変長引数 # ファイルの内容を指定(robots_disallow)との併用不可 robots_text <<~ROBOTS User-agent: * Disallow: /api/ Disallow: /public_api/ ROBOTS }
robots_disallow :all だけ実現するなら、ファイルを置いておくだけでいける。 コンテナ内の /var/www/robots_disallow/robots.txt に以下のファイルを置いておく
robots_disallow :all
/var/www/robots_disallow/robots.txt
User-agent: * Disallow: /
以下のような関数を用意。DSLから呼べるようにする。
def robots_config(allow: false) <<~CONFIG location = /robots.txt { root /var/www/robots_disallow; } CONFIG
robots_disallow '/api/' のように動的に変化させるなら、ERBでテンプレートレンダリングするのが良さそう。
robots_disallow '/api/'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
以下のような
robots_disallow
robots_text
DSL を作りたい対応案
robots_disallow :all
だけ実現するなら、ファイルを置いておくだけでいける。コンテナ内の
/var/www/robots_disallow/robots.txt
に以下のファイルを置いておく以下のような関数を用意。DSLから呼べるようにする。
robots_disallow '/api/'
のように動的に変化させるなら、ERBでテンプレートレンダリングするのが良さそう。The text was updated successfully, but these errors were encountered: