From 17bcb7f641f1cade3b986bf1af7ecf5a43d7b274 Mon Sep 17 00:00:00 2001 From: David Fischer Date: Tue, 7 Aug 2018 15:50:45 -0700 Subject: [PATCH 1/3] All static media is run through "collectstatic" --- .gitignore | 1 + media/css/badge_only.css | 2 +- media/css/sphinx_rtd_theme.css | 2 +- media/font/fontawesome_webfont.eot | 2 +- media/font/fontawesome_webfont.svg | 2 +- media/font/fontawesome_webfont.ttf | 2 +- media/font/fontawesome_webfont.woff | 2 +- media/font/fontawesome_webfont.woff2 | 1 + media/fonts | 2 +- media/javascript/jquery/jquery-2.0.3.min.js | 2 +- media/javascript/jquery/jquery-migrate-1.2.1.min.js | 2 +- media/javascript/jquery/jquery-ui-1.8.24.custom.min.js | 2 +- media/javascript/readthedocs-doc-embed.js | 2 +- media/javascript/underscore.js | 2 +- readthedocs/settings/base.py | 7 +++++-- 15 files changed, 19 insertions(+), 14 deletions(-) create mode 120000 media/font/fontawesome_webfont.woff2 diff --git a/.gitignore b/.gitignore index 6ff593282ab..d4939081a95 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ media/json media/man media/pdf media/static +/static node_modules package-lock.json readthedocs/rtd_tests/builds diff --git a/media/css/badge_only.css b/media/css/badge_only.css index 5485c8af4c9..12c15c72a6b 120000 --- a/media/css/badge_only.css +++ b/media/css/badge_only.css @@ -1 +1 @@ -../static/core/css/badge_only.css \ No newline at end of file +../../readthedocs/core/static/core/css/badge_only.css \ No newline at end of file diff --git a/media/css/sphinx_rtd_theme.css b/media/css/sphinx_rtd_theme.css index d506abba5aa..d8b2a0137ff 120000 --- a/media/css/sphinx_rtd_theme.css +++ b/media/css/sphinx_rtd_theme.css @@ -1 +1 @@ -../static/core/css/theme.css \ No newline at end of file +../../readthedocs/core/static/core/css/theme.css \ No newline at end of file diff --git a/media/font/fontawesome_webfont.eot b/media/font/fontawesome_webfont.eot index d7ddd3244bc..0692b78ab30 120000 --- a/media/font/fontawesome_webfont.eot +++ b/media/font/fontawesome_webfont.eot @@ -1 +1 @@ -../static/core/font/fontawesome-webfont.eot \ No newline at end of file +../../readthedocs/core/static/core/font/fontawesome-webfont.eot \ No newline at end of file diff --git a/media/font/fontawesome_webfont.svg b/media/font/fontawesome_webfont.svg index abc7434505e..4f3efa81d26 120000 --- a/media/font/fontawesome_webfont.svg +++ b/media/font/fontawesome_webfont.svg @@ -1 +1 @@ -../static/core/font/fontawesome-webfont.svg \ No newline at end of file +../../readthedocs/core/static/core/font/fontawesome-webfont.svg \ No newline at end of file diff --git a/media/font/fontawesome_webfont.ttf b/media/font/fontawesome_webfont.ttf index e0067becadf..79ce9444c0c 120000 --- a/media/font/fontawesome_webfont.ttf +++ b/media/font/fontawesome_webfont.ttf @@ -1 +1 @@ -../static/core/font/fontawesome-webfont.ttf \ No newline at end of file +../../readthedocs/core/static/core/font/fontawesome-webfont.ttf \ No newline at end of file diff --git a/media/font/fontawesome_webfont.woff b/media/font/fontawesome_webfont.woff index 549827633c5..84464078e31 120000 --- a/media/font/fontawesome_webfont.woff +++ b/media/font/fontawesome_webfont.woff @@ -1 +1 @@ -../static/core/font/fontawesome-webfont.woff \ No newline at end of file +../../readthedocs/core/static/core/font/fontawesome-webfont.woff \ No newline at end of file diff --git a/media/font/fontawesome_webfont.woff2 b/media/font/fontawesome_webfont.woff2 new file mode 120000 index 00000000000..d8b851262b1 --- /dev/null +++ b/media/font/fontawesome_webfont.woff2 @@ -0,0 +1 @@ +../../readthedocs/core/static/core/font/fontawesome-webfont.woff2 \ No newline at end of file diff --git a/media/fonts b/media/fonts index eee2d551896..fb346f06d29 120000 --- a/media/fonts +++ b/media/fonts @@ -1 +1 @@ -static/core/font/ \ No newline at end of file +../readthedocs/core/static/core/font \ No newline at end of file diff --git a/media/javascript/jquery/jquery-2.0.3.min.js b/media/javascript/jquery/jquery-2.0.3.min.js index 2c7ebab0232..5123af31c90 120000 --- a/media/javascript/jquery/jquery-2.0.3.min.js +++ b/media/javascript/jquery/jquery-2.0.3.min.js @@ -1 +1 @@ -../../static/vendor/jquery-standalone.js \ No newline at end of file +../../../readthedocs/static/vendor/jquery-standalone.js \ No newline at end of file diff --git a/media/javascript/jquery/jquery-migrate-1.2.1.min.js b/media/javascript/jquery/jquery-migrate-1.2.1.min.js index b5930ced444..d7405a0b65d 120000 --- a/media/javascript/jquery/jquery-migrate-1.2.1.min.js +++ b/media/javascript/jquery/jquery-migrate-1.2.1.min.js @@ -1 +1 @@ -../../static/vendor/jquery-migrate-standalone.js \ No newline at end of file +../../../readthedocs/static/vendor/jquery-migrate-standalone.js \ No newline at end of file diff --git a/media/javascript/jquery/jquery-ui-1.8.24.custom.min.js b/media/javascript/jquery/jquery-ui-1.8.24.custom.min.js index efd82f5b996..1c410298d15 120000 --- a/media/javascript/jquery/jquery-ui-1.8.24.custom.min.js +++ b/media/javascript/jquery/jquery-ui-1.8.24.custom.min.js @@ -1 +1 @@ -../../static/vendor/jquery-ui-standalone.js \ No newline at end of file +../../../readthedocs/static/vendor/jquery-ui-standalone.js \ No newline at end of file diff --git a/media/javascript/readthedocs-doc-embed.js b/media/javascript/readthedocs-doc-embed.js index 3774ea7a77b..53269f13920 120000 --- a/media/javascript/readthedocs-doc-embed.js +++ b/media/javascript/readthedocs-doc-embed.js @@ -1 +1 @@ -../static/core/js/readthedocs-doc-embed.js \ No newline at end of file +../../readthedocs/core/static/core/js/readthedocs-doc-embed.js \ No newline at end of file diff --git a/media/javascript/underscore.js b/media/javascript/underscore.js index a49ca8b3847..57efbbba0aa 120000 --- a/media/javascript/underscore.js +++ b/media/javascript/underscore.js @@ -1 +1 @@ -../static/vendor/underscore-standalone.js \ No newline at end of file +../../readthedocs/static/vendor/underscore-standalone.js \ No newline at end of file diff --git a/readthedocs/settings/base.py b/readthedocs/settings/base.py index f469a3499cc..d5d95455695 100644 --- a/readthedocs/settings/base.py +++ b/readthedocs/settings/base.py @@ -167,12 +167,15 @@ def USE_PROMOS(self): # noqa PRODUCTION_MEDIA_ARTIFACTS = os.path.join(PRODUCTION_ROOT, 'media') # Assets and media - STATIC_ROOT = os.path.join(SITE_ROOT, 'media/static/') + STATIC_ROOT = os.path.join(SITE_ROOT, 'static') STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(SITE_ROOT, 'media/') MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX = '/media/admin/' - STATICFILES_DIRS = [os.path.join(SITE_ROOT, 'readthedocs', 'static')] + STATICFILES_DIRS = [ + os.path.join(SITE_ROOT, 'media'), + os.path.join(SITE_ROOT, 'readthedocs', 'static'), + ] TEMPLATES = [ { From 1e0b3190006a3c0dbf203733bbf3888be6b0f72c Mon Sep 17 00:00:00 2001 From: David Fischer Date: Tue, 7 Aug 2018 16:23:45 -0700 Subject: [PATCH 2/3] MEDIA_URL -> static --- readthedocs/templates/admin.html | 12 ------------ readthedocs/templates/base.html | 6 +++--- readthedocs/templates/builds/build_list.html | 3 ++- 3 files changed, 5 insertions(+), 16 deletions(-) delete mode 100644 readthedocs/templates/admin.html diff --git a/readthedocs/templates/admin.html b/readthedocs/templates/admin.html deleted file mode 100644 index 7487a941b2b..00000000000 --- a/readthedocs/templates/admin.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/readthedocs/templates/base.html b/readthedocs/templates/base.html index 57d80a18f52..26b7aa6c13c 100644 --- a/readthedocs/templates/base.html +++ b/readthedocs/templates/base.html @@ -10,7 +10,7 @@ {% block extra_metas %}{% endblock extra_metas %} - + {% block title %}{% endblock %}{% block head_title %}{% endblock %} | {% block branding %}Read the Docs {% endblock %} @@ -47,7 +47,7 @@ - + {% block extra_links %}{% endblock %} @@ -58,7 +58,7 @@ require('jquery'); - + +