{"id":31,"date":"2014-04-07T04:54:21","date_gmt":"2014-04-07T04:54:21","guid":{"rendered":"http:\/\/www.mbarsinai.com\/blog\/?p=31"},"modified":"2014-04-07T04:54:21","modified_gmt":"2014-04-07T04:54:21","slug":"lessons-learned-by-a-frugal-hacktivist","status":"publish","type":"post","link":"https:\/\/www.mbarsinai.com\/blog\/2014\/04\/07\/lessons-learned-by-a-frugal-hacktivist\/","title":{"rendered":"Lessons learned by a frugal hacktivist"},"content":{"rendered":"<p>There&#8217;s a compulsory biometric database being built in Israel. It&#8217;s bad, but it&#8217;s not the point of this post. I&#8217;m taking part in some civilian effort to stop it, and part of this is having a website. So we built one. For free. <a href=\"http:\/\/english.no2bio.org\">Here it is<\/a>. And here is what I learned, divided to non-technical and rather technical points.<\/p>\n<p>Non-technical:<\/p>\n<ul>\n<li>We wanted a good looking, fast website. As the government employes paid commenters, we didn&#8217;t want any talkback options.<\/li>\n<li>We have some people that can build websites (me, but not just me). However, we&#8217;re all busy.<\/li>\n<li>The website had to be updated periodically, but not too often.<\/li>\n<li>We are a voluntary organization, and we don&#8217;t have any money.<\/li>\n<\/ul>\n<p>While we were aware of standard options, such as opening a wordpress blog or a Facebook page, we decided to go with a static web site, hosted as a <a href=\"https:\/\/pages.github.com\">github project page<\/a>. The motivation was that this would generate a very fast website, and we could get all the design flexibility we need (canned solutions are not that flexible, really).<\/p>\n<p>However, keep in mind that github project pages come with some strings attached. The website has to be open-source, or pay for the hosting, and no server-side processing can occur. This means any updates to the site require some technical skills.<\/p>\n<p>For hacktivism, the open source string may be a real issue. If you spend a lot of time creating a web site, and you don&#8217;t want the other side to just fork it and create their own version. You may want to keep your source closed. We didn&#8217;t have this issue, as the biometric database already has web presence, as well as TV commercials, posters, etc.<\/p>\n<p>So far, which is not very far really, the choice for static website seems good. Here are the technicalities. The main goal was to get something done fast, but at a high quality.<\/p>\n<h4>Site generator<\/h4>\n<p>We went with <a href=\"http:\/\/harpjs.com\">harp.js<\/a>. While <a href=\"http:\/\/jekyllrb.com\">jekyll<\/a> looks like a more natural choice for github, it is not as flexible as harp. Jekyll assume you are writing a blog. Harp has a more holistic approach, and also supports lesscss (and many other languages). I already had experience with jekyll (earned while doing <a href=\"http:\/\/t-j.org.il\/Portals\/26\/web-tour\/\">this site<\/a>) but decided to try harp and have jekyll as a &#8220;plan b&#8221;. All in all this worked.<\/p>\n<h4>Front end<\/h4>\n<p><a href=\"http:\/\/getbootstrap.com\">Bootstrap3<\/a>. You can&#8217;t beat the king.<\/p>\n<h4>Content Generation<\/h4>\n<p>Here&#8217;s where Jekyll is better than Harp &#8211; we wanted to generate a <a href=\"http:\/\/english.no2bio.org\/items.html\" target=\"_blank\">list of links<\/a>, display a list of them and give each one a page. Jekyll would have done this out of the box, if we would have treated each link as a post. Harp requires having a file for each page in the site, which meant we had to maintain the json map and a set of files, and make sure each key in the map has a file named after it. Not fun and error prone. Well, bash to the rescue:<\/p>\n<pre><code>\r\ncat _data.json | jq keys | grep \\\\w | cut -d\\\" -f2 | xargs -I{} touch {}.md\r\n<\/code><\/pre>\n<p>This line ensures that each key has a file with corresponding name. If the file already exists, it is not overridden, which is important if someone wanted to add additional data to the to a link&#8217;s page.<\/p>\n<h4>Issues<\/h4>\n<ul>\n<li>Contact forms require a back-end to process the input, and static sites don&#8217;t have any back-end. There are ways of doing them, e.g. using google forms. We address this soon, but currently we&#8217;re happy to use github issues, which also works. Also, you can use a mailto link, but you&#8217;ll be facing another set of issues there.<\/li>\n<li>As always, collaborating using github is a pleasure.<\/li>\n<li>When other people fork your site, they shouldn&#8217;t call their branch &#8220;gh-pages&#8221; &#8211; it makes the CNAME files collide. Only have a single branch with this name.<\/li>\n<\/ul>\n<h4>Conclusion<\/h4>\n<p>When needing a website that does not take data from users, static websites may be a good choice. If you can keep your source open, hosting them as github project pages is a fast solution that&#8217;s free and easy, as long as you have people with technical skills available. If you have some cause you&#8217;re trying to push, you can <a href=\"https:\/\/github.com\/michbarsinai\/no2bio-eng\" target=\"_blank\"> fork us on gihub<\/a>.<\/p>\n<p>Oh, and if you want to learn about the biometric data base in Israel and you don&#8217;t read Hebrew &#8211; <a href=\"http:\/\/english.no2bio.org\">we have a site for this<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a compulsory biometric database being built in Israel. It&#8217;s bad, but it&#8217;s not the point of this post. I&#8217;m taking part in some civilian effort to stop it, and part of this is having a website. So we built one. For free. Here it is. And here is what I learned, divided to non-technical [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3NnQg-v","_links":{"self":[{"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":7,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":38,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions\/38"}],"wp:attachment":[{"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mbarsinai.com\/blog\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}