1
0
mirror of https://github.com/github/choosealicense.com synced 2024-12-22 12:50:24 +01:00

Make css and js load correctly if site rendered in a subdirectory

to make showig changes from {user}.github.io/choosealicense.com
possible, as suggested by @waldyrious in
https://github.com/github/choosealicense.com/pull/833#issuecomment-860777503

Note links within the site will still break in this scenario, would
need relative_url sprinkled in all internal links to avoid. Non-goal
for now.
This commit is contained in:
Mike Linksvayer 2021-08-13 11:42:54 -07:00
parent d98e8991e8
commit feba36a467
No known key found for this signature in database
GPG Key ID: 136DBD194F0080CF
3 changed files with 8 additions and 8 deletions

View File

@ -16,9 +16,9 @@
</div> <!-- /container --> </div> <!-- /container -->
{% if page.collection == "licenses" or page.class == "license-types" %} {% if page.collection == "licenses" or page.class == "license-types" %}
<script src="/assets/vendor/jquery/jquery.min.js"></script> <script src="{{ 'assets/vendor/jquery/jquery.min.js' | relative_url }}"></script>
<script src="/assets/vendor/qtip2/jquery.qtip.min.js"></script> <script src="{{ 'assets/vendor/qtip2/jquery.qtip.min.js' | relative_url }}"></script>
<script src="/assets/vendor/clipboard/dist/clipboard.min.js"></script> <script src="{{ 'assets/vendor/clipboard/dist/clipboard.min.js' | relative_url }}"></script>
<script> <script>
window.annotations = {{ site.data.rules | jsonify }}; window.annotations = {{ site.data.rules | jsonify }};
{% if page.collection == "licenses" %} {% if page.collection == "licenses" %}
@ -32,7 +32,7 @@
]; ];
{% endif %} {% endif %}
</script> </script>
<script src="/assets/js/app.js"></script> <script src="{{ 'assets/js/app.js' | relative_url }}"></script>
{% endif %} {% endif %}
</body> </body>
</html> </html>

View File

@ -5,8 +5,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Chivo:900"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Chivo:900">
<link rel="stylesheet" href="/assets/css/application.css?v={{ site.github.build_revision }}"> <link rel="stylesheet" href="{{ 'assets/css/application.css' | relative_url }}?v={{ site.github.build_revision }}">
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="{{ 'favicon.ico' | relative_url }}" type="image/x-icon">
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="/assets/vendor/html5shiv/dist/html5shiv.js"></script> <script src="/assets/vendor/html5shiv/dist/html5shiv.js"></script>
<script src="/assets/vendor/selectivizr/selectivizr.js"></script> <script src="/assets/vendor/selectivizr/selectivizr.js"></script>

View File

@ -1,8 +1,8 @@
--- ---
--- ---
@import "/assets/vendor/normalize-css/normalize.css"; @import "../vendor/normalize-css/normalize.css";
@import "/assets/vendor/qtip2/jquery.qtip.min.css"; @import "../vendor/qtip2/jquery.qtip.min.css";
body { body {
background: #fafafa; background: #fafafa;