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

gum: Add optional extra CSS and JS resources #752

Open
wants to merge 1 commit into
base: master
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
19 changes: 18 additions & 1 deletion gum/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,33 @@ To use Disqus, add the Disqus site name via the following variable.
DISQUS_SITENAME = ''
```


To add content or markup to the footer of every page: Add an `extra_footer.html` file to
a directory in your `THEME_TEMPLATES_OVERRIDES` path. It is empty by default.

To add extra CSS, for example to override styles without forking the Gum theme,
>>>>>>> 2707d51 (Documentation tweaks from review feedback)
you may specify either or both of these settings:

```
CUSTOM_CSS_FILES = ['list of paths to additional css static files']
CUSTOM_CSS_URLS = ['list of URLs of additional remote css to load']
```

To add extra Javascript to the theme, you may specify either or both of these settings:

```
CUSTOM_JS_FILES = ['list of paths to additional JavaScript static files']
CUSTOM_JS_URLS = ['list of URLs of additional JavaScript to load']

```

Other features include:

```
SITESUBTITLE = 'your site subtitle'
```


The following standard Pelican settings are honored:

```
Expand Down
22 changes: 22 additions & 0 deletions gum/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/gumby.css" />
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/style.css" />
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/pygment.css" />
{% if CUSTOM_CSS_FILES %}
{% for item in CUSTOM_CSS_FILES %}
<link rel="stylesheet" type="text/css" href="{{ SITEURL }}/{{ item }}" />
{% endfor %}
{% endif %}

{% if CUSTOM_CSS_URLS %}
{% for item in CUSTOM_CSS_URLS %}
<link rel="stylesheet" type="text/css" href="{{ item }}" />
{% endfor %}
{% endif %}

<script src="{{ SITEURL }}/theme/js/libs/modernizr-2.6.2.min.js"></script>

Expand Down Expand Up @@ -70,6 +81,17 @@
<noscript><p><img src="http://{{ PIWIK_URL }}/piwik.php?idsite={{ PIWIK_ID }}" style="border:0;" alt="" /></p></noscript>
{% endif %}

{% if CUSTOM_JS_FILES %}
{% for item in CUSTOM_JS_FILES %}
<script src="{{ SITEURL }}/{{ item }}"></script>
{% endfor %}
{% endif %}
{% if CUSTOM_JS_URLS %}
{% for item in CUSTOM_JS_URLS %}
<script src="{{ item }}"></script>
{% endfor %}
{% endif %}

{% endblock head %}
</head>

Expand Down