-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfast-compilation.html
More file actions
159 lines (117 loc) · 7.87 KB
/
fast-compilation.html
File metadata and controls
159 lines (117 loc) · 7.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8"/>
<title>Cryogen: Fast Compilation</title>
<link rel="icon" href="/img/logo.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/color-brewer.min.css">
<link href='http://fonts.googleapis.com/css?family=Alegreya:700italic,400,700' rel='stylesheet'
type='text/css'>
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Lato:400,400italic">
<link href="/css/screen.css" rel="stylesheet" type="text/css" />
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-56703143-2', 'auto');
ga('send', 'pageview');
</script>
<meta name="keywords" content="cryogen, clojure, blog engine, static site, static site generator, leiningen">
<meta name="description"
content="Cryogen is a simple static site generator built with Clojure and designed by Carmen La. It's shipped on Leiningen so setup is simple and fuss free.">
<meta name="canonical" content="http://cryogenweb.org/docs/fast-compilation.html">
</head>
<body>
<div class="container">
<header>
<div class="row">
<div class="col-lg-5 col-md-5 col-sm-6">
<a href="/index.html"><img height="120px" src="/img/banner.png"/>
<h1>Cryogen</h1></a>
<h2 id="slogan" class="faint">Static sites generated with Clojure</h2>
</div>
<div class="col-lg-7 col-md-7 col-sm-6">
<nav>
<ul id="menu" class="nav nav-pills navbar-right">
<li><a id="home-link" href="/index.html">Home</a></li>
<li><a id="docs-link" href="/docs/home.html">Doc<span class="show-on-mobile">s</span><span
class="hide-on-mobile">umentation</span></a></li>
<li><a href="https://github.com/cryogen-project/cryogen"><span class="hide-on-mobile">View on </span>GitHub</a>
</li>
</ul>
</nav>
</div>
</div>
</header>
<div id="main" class="row">
<div class="row">
<div id="reading-pane" class="col-lg-9 col-md-9 col-sm-12">
<div id="page-header">
<h1>Fast Compilation</h1>
</div>
<div id="toc"><ol class="toc"><li><a href="#limitations">Limitations</a></li><li><a href="#how_to_enable">How to enable</a></li></ol></div>
<div id="content">
<p>As of Cryogen 0.4.0 <a href="https://github.com/cryogen-project/cryogen-core/pull/149">there is support for fast but partial compilation</a>. It is intended to be used when you work on a blog post or page and want to see it quickly, without re-compiling the whole site.</p><p><strong>BEWARE</strong>: This feature is only intended for "development," make sure to make a full build (f.ex. via <code>lein run</code>) before publishing your site.</p><h2 id="limitations">Limitations</h2><p>The difference from a full compilation is that the output directory is not wiped out and that only the changed markup file plus all non-page/post output files are compiled. If you change any other file, such as inside the template, a full compilation runs.</p><p>The downsides are that the previous and next links on neighboring posts will not be updated and that all derived pages such as the index, tag pages, archives, site map, and RSS will only know about this changed post/page. Thus the blog is in an inconsistent state, until a full compilation is performed.</p><p><i>(NOTE: To support a consistent incremental compilation: instead of simply filtering out unchanged files, we would need "read in" all to have the metadata but skip markup processing and output for the unchanged ones + update the neighboring posts.)</i></p><h2 id="how_to_enable">How to enable</h2><p>To enable the partial, fast compilation, use the <code>*:fast</code> variants of the serve commands:</p><pre><code>lein serve:fast
clojure -X:serve:fast
</code></pre><p>or, in your blog's <code>src/cryogen/server.clj</code>, replace the calls to <code>(start-watcher! dir ignored-files compile-assets-timed)</code> with <code>(start-watcher-for-changes! dir ignored-files compile-assets-timed {})</code> (notice the different function and an extra argument).</p>
</div>
<div id="prev-next">
<a class="left" href="/docs/add-basic-search.html">« Prev</a>
</div>
</div>
<div id="topics-list" class="col-lg-3 col-md-3 col-sm-12">
<div id="topics">
<h4>Getting Started</h4>
<ul>
<li><a href="/docs/home.html">Welcome</a></li>
<li><a href="/docs/getting-started.html">Getting Started</a></li>
<li><a href="/docs/structure.html">Directory Structure</a></li>
<li><a href="/docs/configuration.html">Configuration</a></li>
</ul>
<h4>Your Content</h4>
<ul>
<li><a href="/docs/writing-posts.html">Writing Posts</a></li>
<li><a href="/docs/creating-pages.html">Creating Pages</a></li>
<li><a href="/docs/switching-markdown-asciidoc.html">Switching between Markdown and AsciiDoc</a></li>
<li><a href="/docs/customizing-the-index.html">Customizing your Index Page</a></li>
<li><a href="/docs/klipse.html">Klipse Integration</a></li>
</ul>
<h4>Deployment</h4>
<ul>
<li><a href="/docs/deploying-to-github-pages.html">GitHub Pages</a></li>
<li><a href="/docs/deploying-with-nginx-VPS.html">Nginx on a VPS</a></li>
<li><a href="/docs/deploying-to-netlify.html">Netlify</a></li>
</ul>
<h4>Additional Resources</h4>
<ul>
<li><a href="/docs/customizing-cryogen.html">Customizing/Extending Cryogen</a></li>
<li><a href="/docs/deploying-with-travis.html">Deploying with Travis CI</a></li>
<li><a href="/docs/add-basic-search.html">Basic Search with Lunr</a></li>
<li><a href="/docs/fast-compilation.html">Fast Compilation</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer class="text-center text-muted">
<p>Copyright © 2014 - <span id="cpyear"></span> <span>Carmen La</span><br>
Powered by <a href="https://github.com/cryogen-project/cryogen">Cryogen</a></p>
</footer>
</div>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="/js/main.js" type="text/javascript"></script>
<script src="/js/highlight.pack.js" type="text/javascript"></script>
<script>hljs.initHighlightingOnLoad();</script>
</body>
</html>