summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@figma.com>2019-02-07 20:38:39 +0300
committerRasmus Andersson <rasmus@figma.com>2019-02-07 20:38:39 +0300
commitaf51a3e178eb7820dfcc90e6b2d026326653df0c (patch)
treef829edce7009701370ba49c747047eae9ab2f27e
parentff306da62c080c8d5867d20d2d9f464ed2d51388 (diff)
downloadinter-af51a3e178eb7820dfcc90e6b2d026326653df0c.tar.xz
website: get rid of home-made autoreload in favor of new livereload feature in jekyll 3.7
-rw-r--r--.gitignore3
-rw-r--r--docs/.gitignore3
-rw-r--r--docs/_includes/autoreload-in-debug.html46
-rw-r--r--docs/_layouts/default.html1
-rwxr-xr-xdocs/_scripts/serve.sh7
5 files changed, 9 insertions, 51 deletions
diff --git a/.gitignore b/.gitignore
index b2adc00bd..fe5c4df72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,9 +15,6 @@ nohup.out
build
/_*
-/docs/lab/_serve*
-/docs/lab/fonts
-/docs/_site
/githash.txt
/src/FontInspector.html
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 000000000..8c0390504
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,3 @@
+/.jekyll-metadata
+/_site
+/lab/fonts
diff --git a/docs/_includes/autoreload-in-debug.html b/docs/_includes/autoreload-in-debug.html
deleted file mode 100644
index fa29294b0..000000000
--- a/docs/_includes/autoreload-in-debug.html
+++ /dev/null
@@ -1,46 +0,0 @@
-{% if site.safe == false %}
-<!-- During authoring, this automatically reloads the post as its changing -->
-<script type="text/javascript">
-(function() {
-var qs = document.location.search;
-var current_etag = qs.match(/etag=("?[a-zA-Z0-9_-]+)/);
-if (current_etag !== null) { current_etag = current_etag[1]; }
-var scrolly = qs.match(/scrolly=([0-9]+)/);
-if (scrolly) {
- scrolly = parseInt(scrolly[1]);
- if (scrolly > 0) {
- window.scrollTo(window.scrollX, scrolly);
- setTimeout(function () {
- window.scrollTo(window.scrollX, scrolly);
- }, 10);
- }
-}
-
-function check() {
- var r = new XMLHttpRequest();
- var url = document.location.href + ((qs && qs !== '') ? '&' : '?') + 'r=' + Math.random();
- r.open('GET', url, true);
- r.onreadystatechange = function() {
- if (r.readyState == 4){
- var found_etag = r.getResponseHeader('Etag');
- if (found_etag) {
- found_etag = found_etag.replace(/^"|"$/g);
- }
- //console.log('current_etag:', current_etag, 'found_etag:', found_etag);
- if (current_etag === null) {
- current_etag = found_etag;
- } else if (found_etag && found_etag !== current_etag) {
- document.location.search =
- '?etag=' + encodeURIComponent(found_etag) +
- '&scrolly=' + window.scrollY;
- return;
- }
- setTimeout(check, 500);
- }
- };
- r.send(null);
-}
-check();
-})();
-</script>
-{% endif %} \ No newline at end of file
diff --git a/docs/_layouts/default.html b/docs/_layouts/default.html
index c1300b70e..3017293a8 100644
--- a/docs/_layouts/default.html
+++ b/docs/_layouts/default.html
@@ -96,6 +96,5 @@ endfor
gtag('config', 'UA-105091131-2');
</script>
{% endif %}
- {% include autoreload-in-debug.html %}
</body>
</html>
diff --git a/docs/_scripts/serve.sh b/docs/_scripts/serve.sh
index 40f310df5..e48fd67db 100755
--- a/docs/_scripts/serve.sh
+++ b/docs/_scripts/serve.sh
@@ -25,4 +25,9 @@ if [ "$1" != "" ]; then
BINDADDR=$1
fi
-jekyll serve --limit_posts 20 --watch --host "$BINDADDR" --port 3002
+jekyll serve \
+ --incremental \
+ --watch \
+ --host "$BINDADDR" \
+ --port 3002 \
+ --livereload