Skip to content
New issue

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

Work a little on performance. Concatenate and minify all js and css. #374

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,4 @@ cython_debug/
# static files generated from Django application using `collectstatic`
media
mediafiles

ro-help/static/CACHE
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ gunicorn==20.0.4
gevent==1.4.0
whitenoise==5.0.1
sentry-sdk==0.14.3
django-compressor==2.4
17 changes: 12 additions & 5 deletions ro_help/hub/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,24 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block meta_tags %}{% with title="Luptă împotriva pandemiei de Covid-19." %}{% meta_tags %}{% endwith %}{% endblock %}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web:400,600,700&subset=latin-ext">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/bulma.min.css">
{% load compress %}
{% compress css %}
<link rel="stylesheet" href="{% static "css/fonts.css" %}">
<link rel="stylesheet" href="{% static "css/bulma.min.css" %}">
<link rel="stylesheet" href="{% static "css/bulma-collapsible.min.css" %}">
<link rel="stylesheet" href="{% static "css/hub.css" %}">
{% include "favicons.html" %}
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<script src="{% static "js/navbar.js" %}"></script>
{% endcompress %}

{% compress js %}
<script defer src="{% static 'js/all.min.js' %}"></script>
<script src="{% static 'js/bulma-collapsible.min.js' %}"></script>
<script src="{% static 'js/jquery-3.5.0.min.js' %}"></script>
<script src="{% static 'js/jquery.waypoints.min.js' %}"></script>
<script src="{% static 'js/infinite.min.js' %}"></script>
<script src="{% static 'js/navbar.js' %}"></script>
{% endcompress %}

{% include "favicons.html" %}
<title>{% block title %}RoHelp{% endblock %}</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-160603540-4"></script>
Expand Down
6 changes: 1 addition & 5 deletions ro_help/hub/templates/favicons.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<link rel="shortcut icon" href="{% static "images/favicons/favicon.ico" %}" />
<link rel="manifest" href="{% static "images/favicons/manifest.json" %}" />

<!-- for Windows 8.0 and IE 10 -->
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="{% static "images/favicons/ms-icon-144x144.png" %}" />

<meta name="msapplication-config" content="{% static "images/favicons/browserconfig.xml" %}" />

<link rel="icon" type="image/png" sizes="16x16" href="{% static "images/favicons/favicon-16x16.png" %}" />
Expand All @@ -22,4 +18,4 @@
<link rel="apple-touch-icon" sizes="120x120" href="{% static "images/favicons/apple-icon-120x120.png" %}" />
<link rel="apple-touch-icon" sizes="144x144" href="{% static "images/favicons/apple-icon-144x144.png" %}" />
<link rel="apple-touch-icon" sizes="152x152" href="{% static "images/favicons/apple-icon-152x152.png" %}" />
<link rel="apple-touch-icon" sizes="180x180" href="{% static "images/favicons/apple-icon-180x180.png" %}" />
<link rel="apple-touch-icon" sizes="180x180" href="{% static "images/favicons/apple-icon-180x180.png" %}" />
3 changes: 2 additions & 1 deletion ro_help/ro_help/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

# SECURITY WARNING: don"t run with debug turned on in production!
DEBUG = TEMPLATE_DEBUG = env.bool("DEBUG", True)

ALLOWED_HOSTS = [".rohelp-102801068.eu-central-1.elb.amazonaws.com", "dev.rohelp.ro", "rohelp.ro", "prod.rohelp.ro"]

# TODO: should be replaced with ALLOWED_HOSTS once we go live
Expand All @@ -71,6 +70,7 @@
"file_resubmit",
"rangefilter",
"admin_totals",
"compressor"
]

MIDDLEWARE = [
Expand Down Expand Up @@ -198,6 +198,7 @@
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"compressor.finders.CompressorFinder",
]

# SMTP
Expand Down
1 change: 1 addition & 0 deletions ro_help/static/css/bulma.min.css

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions ro_help/static/css/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/* latin-ext */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 400;
font-display: swap;
src: local("Titillium Web Regular"), local("TitilliumWeb-Regular"),
url(../fonts/TitilliumWebRegular-ext.woff2) format("woff2");
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 400;
font-display: swap;
src: local("Titillium Web Regular"), local("TitilliumWeb-Regular"),
url(../fonts/TitilliumWebRegular.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 600;
font-display: swap;
src: local("Titillium Web SemiBold"), local("TitilliumWeb-SemiBold"),
url(../fonts/TitilliumWebSemiBold-ext.woff2) format("woff2");
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 600;
font-display: swap;
src: local("Titillium Web SemiBold"), local("TitilliumWeb-SemiBold"),
url(../fonts/TitilliumWebSemiBold.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
/* latin-ext */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 700;
font-display: swap;
src: local("Titillium Web Bold"), local("TitilliumWeb-Bold"),
url(../fonts/TitilliumWebBold-ext.woff2) format("woff2");
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
font-family: "Titillium Web";
font-style: normal;
font-weight: 700;
font-display: swap;
src: local("Titillium Web Bold"), local("TitilliumWeb-Bold"),
url(../fonts/TitilliumWebBold.woff2) format("woff2");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
U+FEFF, U+FFFD;
}
Binary file added ro_help/static/fonts/TitilliumWebBold-ext.woff2
Binary file not shown.
Binary file added ro_help/static/fonts/TitilliumWebBold.woff2
Binary file not shown.
Binary file not shown.
Binary file added ro_help/static/fonts/TitilliumWebRegular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions ro_help/static/js/all.min.js

Large diffs are not rendered by default.