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

[WIP] Add use of require.css and require.js #1

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
13 changes: 12 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"require": {
"sculpin/sculpin": "2.*@dev",

"components/bootstrap": "~2.3.1",
"components/bootstrap-default": "~2.3.1",
"components/jquery": "~1.9.1",
"components/highlightjs": "~7.3.0",
"components/font-awesome": "~3.0.2@dev",
Expand All @@ -23,6 +23,17 @@
"michelf/php-markdown": "@beta",
"composer/composer": "@dev"
},
"extra": {
"component": {
"styles": [
"source/css/style.css",
"vendor/components/highlightjs/styles/github.css"
],
"files": [
"source/css/stack-logo.png"
]
}
},
"config": {
"component-dir": "source/components"
}
Expand Down
71 changes: 60 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 20 additions & 24 deletions source/_views/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
<title>{% block full_title %}{% block title %}{{ page.title }}{% endblock %} &mdash; {{ site.title }} &mdash; {{ site.subtitle }}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{{ site.url }}/components/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="{{ site.url }}/components/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css" />
<link href="{{ site.url }}/components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link href="{{ site.url }}/css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{{ site.url }}/components/highlightjs/styles/github.css" />
<link href="{{ site.url }}/components/require.css" rel="stylesheet" type="text/css" />
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
Expand All @@ -26,26 +22,26 @@
Go stack some middlewares
</footer>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="{{ site.url }}/components/jquery/jquery.min.js"><\/script>')</script>
<script src="{{ site.url }}/components/bootstrap/js/bootstrap.min.js"></script>
{% block scripts %}
{% endblock %}

{% if site.google_analytics_tracking_id %}
<script src="{{ site.url }}/components/require.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
{% if site.google_analytics_tracking_id %}
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.google_analytics_tracking_id }}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
{% endif %}
require.config({
"baseUrl": "{{ site.url }}/components"
});
require(['highlightjs', 'bootstrap'], function(hljs) {
hljs.initHighlighting();
});
</script>
{% endif %}
<script src="{{ site.url }}/components/highlightjs/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
{% block scripts %}
{% endblock %}
</body>
</html>