Permalink
Browse files

The generated site is not in `public/` anymore

  • Loading branch information...
1 parent c6fc34c commit 61d9344fff5aadd954c68ebc4d70e17852696856 @mislav committed Apr 13, 2016
Showing with 16 additions and 6 deletions.
  1. +4 −2 script/imagecheck
  2. +4 −1 script/linkcheck
  3. +5 −2 script/syntaxcheck
  4. +3 −1 script/trackingcheck
View
@@ -1,15 +1,17 @@
#!/bin/sh
# Check if referenced images are present
+site="${1:-_site}"
+
images="$(
{ ruby -rnokogiri -e '
Nokogiri(ARGF).css("img[src]").each { |node|
link = node["src"]
next if link.include? "://"
puts link
- }' $(find public -name '*.html' | grep -v 404) | sort -u
+ }' $(find "$site" -name '*.html' | grep -v 404) | sort -u
- find public -name '*.css' | xargs grep "images/" | cut -d '(' -f 2 | cut -d ')' -f 1
+ find "$site" -name '*.css' | xargs grep "images/" | cut -d '(' -f 2 | cut -d ')' -f 1
} | sort -u
)"
View
@@ -1,8 +1,11 @@
#!/bin/sh
# Display absolute links or assets
+
+site="${1:-_site}"
+
exec ruby -rnokogiri -e '
Nokogiri(ARGF).css("*[href], *[src]").each { |node|
link = node["href"] || node["src"]
next unless link.include? "://" or link[0,1] == "/"
puts link
- }' $(find public -name '*.html' | grep -v 404) | sort -u
+ }' $(find "$site" -name '*.html' | grep -v 404) | sort -u
View
@@ -1,12 +1,15 @@
#!/bin/sh
# Check ruby syntax in code examples
+
+site="${1:-_site}"
+
exec ruby -rnokogiri -e '
- Nokogiri(ARGF).css("pre > code.rb").each { |node|
+ Nokogiri(ARGF).css("[data-lang=ruby]").each { |node|
code = node.text
File.popen("ruby -wc >/dev/null", "w"){|f| f << code }
unless $?.success?
puts "------ " + node.path
puts code
puts "======"
end
- }' public/book/*.html public/dwemthy/index.html
+ }' "$site"/book/*.html "$site"/dwemthy/index.html
@@ -1,7 +1,9 @@
#!/bin/sh
+
+site="${1:-_site}"
code="$(grep data-site-id _includes/tracking_code.html)"
-for html in $(find public -name '*.html' | grep -v 404); do
+for html in $(find "$site" -name '*.html' | grep -v 404); do
if ! grep "$code" "$html" >/dev/null; then
echo no tracking: $html
fi

0 comments on commit 61d9344

Please sign in to comment.