Ricky Tan: Token Sales: Data & Returns

Ricky Tan: Token Sales: Data & Returns

The exponential growth in Token Sales (ICO’s) has been staggering. Does it make sense for the average investor in digital currencies to pick individual tokens or invest in a portfolio of tokens rather than in Bitcoin or Ethereum? Early data says no.
If you’re interested in digital currencies, blockchain technology or venture finance, you have probably heard about Token Sales and/or ICO’s (Initial Coin Offerings). There are many excellent articles about the underlying business model, use cases of tokens and rise of the token sale as primary fundraising method. Every day sees a new Token Sale announcement and even mainstream business outlets have published articles about the amount of capital raised through this new method (Economist, Forbes, Fortune, HBR, FT).
We should look at the little data that is available to see what’s been happening and the financial returns for digital currency investors. My conclusion is that tokens are risky investments that, on average, do not provide a greater return than core digital currencies such as Ethereum.
Fertile Days, Limited Data
Once you go down the rabbit-hole of investigating the space of tokens, you quickly discover 3 things:
There is a lack of terminology: Coins, App Coins, Tokens, Token Sales, Token Offerings, ICO’s, etc.
Information is scattered: You have to check twitter, reddit, token rating websites, and digital currency discussion forums to stay up to date on the latest sales and final results.
Need data? Good luck!: High quality and consistent data on token sales is extremely rare.
On the one hand, these struggles are a positive. As mentioned by Chris Dixon and Olaf Carlson-Wee in a great a16z podcast: when no one knows what to call something it means that we’re still in the “fertile, creative days” of innovation. On the other hand, it makes it really hard to comprehend this space and/or make investment decisions.
Close to $400M has been raised
The dataset that I’ve put together comprises 117 Token Sales (ICO’s) that have been announced since July 2014. Of these 117 Token Sales, 56 projects successfully raised a total amount of $378M of capital.

Figure 1: Total USD Raised Incl. The DAO
Given the outlier nature of The DAO token sale and its failure, a more correct statement is that $228M of capital has been raised through Token Sales. A staggering $134M has been raised in 2017 year-to-date and $101M in April 2017 alone. At the time of writing 18 Token Sales are still open for fundraising and this number increases every day.

Figure 2: Total USD Raised Excl. The DAO
Market Capitalization of Tokens > $1.2B
While it’s interesting to look at Token Sales in terms of in dollars raised, it’s equally important to calculate the value of the tokens after they have been issued.
Of the 56 successful Token Sales in the dataset, 34 tokens have started trading and are listed on Coinmarketcap. The market capitalization (the USD value of available supply of tokens) for these 34 tokens currently stands at $1.16B.

Figure 3: Market Capitalization of “Listed” Tokens
The 33 projects that these tokens represent raised $150M in their respective token sales. A back of the envelope calculation shows a 8x increase in dollar value, and our impulsive reaction might be to rush into every single token sale we can get into.
Tokens ARE Risky
The theoretical case for Token Sales is that it they are the optimal way to launch decentralized business models, ranging from core blockchain protocols to Decentralized Applications (dApps) on top of existing blockchains. Ethereum itself started as a Token Sale raising $18M worth of Bitcoin. In these decentralized business models tokens should be the core value unit that represent some combination of usage, work and/or ownership. As Nick Tomaino explained, we should think of tokens primarily as a product feature and not as a fundraising feature.
The majority of projects behind the tokens have not yet launched. They’re in various stages, ranging from beta launch to being stuck in endless ideation. Simultaneously, many projects are taking advantage or “exploit” the exponential growth and interest from unsophisticated investors interested in digital currencies. This ranges from projects that have no obvious network effects at all or are outright scams (Google “ico scam” for starters).
This indicates that Token Sales are a very young and very risky market. It will take time and more data to get a sense of how risky tokens are and what factors determine winners and outperformance. Sophisticated investors and VC’s in the cryptocurrency space look at the development teams, network potential and core technology as factors that could mitigate some of the risks. The average investor and many digital currency enthusiast will have very few of these skills. Nonetheless, there is some data that we can use to conduct a straightforward analysis and answer the following question:
Have Token Sales returned more money than Bitcoin and/or Ether?
Tokens Do Not Outperform Ethereum
Given the limited amount of data needed for financial return analysis, I was able to calculate the returns for 28 tokens since their sale and compared them with returns on Bitcoin and Ether during the same timeframe. The 28 tokens and the projects they represent were the only ones on which I could collect data from multiple sources to calculate the price at issuance, price now and market capitalization.

Figure 4: Absolute Returns and Hypothetical Portfolio Returns
If you were to invest $1 in each of the 28 Token Sales, held onto the tokens and sold them at the time of writing you would have made roughly 9x of the notional investment. This compares with “only” 2x if you had invested $1 in Bitcoin tokens at exactly the same times as the Token Sales. More importantly, a portfolio of Ethereum tokens would have yielded 11x, beating the portfolio of tokens.
Because of the limited data, outliers skew the results drastically. For example, Augur’s token sale took place in October 2015, when Ether was trading at $0.70. Since then, Augur REP-tokens have increased by 29x vs 134x for Ether. Taking Augur out, the results swing in favor of tokens, as per the figure below. When I remove the 2 largest return outliers for Tokens and Ether (i.e. remove 4 in total) the Ether and Token portfolios return roughly the same amount.

Figure 5: Multiples for various portfolio combinations
It’s not the goal of this analysis to determine which tokens are the best investments. We can slice and dice the dataset in many ways that tip the returns in favor of either Tokens, Ether or even Bitcoin. We must not forget that many of the Token Sales are an application layer on top of the Ethereum blockchain. By investing in tokens you are essentially exposing yourself to some (undetermined) amount of Ethereum exposure, and taking on additional risk. One could argue that the performance swings in my hypothetical portfolios are merely reflections of this additional risk. Until there is more time series data the jury is still out on whether this is the case.

Figure 6: Market Cap of Tokens vs Market Cap of Ethereum
Conclusion
The conclusion that I am confident to make is that the data shows that most digital currency enthusiasts are better off staying away from Token Sales. Unless you’re planning to actually use the tokens for the services that the underlying projects will offer, tokens as a speculative investment come with great risks.
Investors who are unable to do a full due diligence (development team, technical specifications, network model) on a new Token Sale are probably better off investing in core cryptocurrencies such as Ether. This will yield better results than rushing into every single Token Sale or even token portfolios. It’s common sense and is backed by some data now.

Against Tulip Subsidies

Against Tulip Subsidies

I.

Imagine a little kingdom with a quaint custom: when a man likes a woman, he offers her a tulip; if she accepts, they are married shortly thereafter. A couple who marries sans tulip is considered to be living in sin; no other form of proposal is appropriate or accepted.

One day, a Dutch trader comes to the little kingdom. He explains that his homeland also has a quaint custom involving tulips: they speculate on them, bidding the price up to stratospheric levels. Why, in the Netherlands, a tulip can go for ten times more than the average worker earns in a year! The trader is pleased to find a new source of bulbs, and offers the people of the kingdom a few guilders per tulip, which they happily accept.

Soon other Dutch traders show up and start a bidding war. The price of tulips goes up, and up, and up; first dozens of guilders, then hundreds. Tulip-growers make a fortune, but everyone else is less pleased. Suitors wishing to give a token of their love find themselves having to invest their entire life savings – with no guarantee that the woman will even say yes! Soon, some of the poorest people are locked out of marriage and family-raising entirely.

Some of the members of Parliament are outraged. Marriage is, they say, a human right, and to see it forcibly denied the poor by foreign speculators is nothing less than an abomination. They demand that the King provide every man enough money to guarantee he can buy a tulip. Some objections are raised: won’t it deplete the Treasury? Are we obligated to buy everyone a beautiful flawless bulb, or just the sickliest, grungiest plant that will technically satisfy the requirements of the ritual? If some man continuously proposes to women who reject him, are we obligated to pay for a new bulb each time, subsidizing his stupidity?

The pro-subsidy faction declares that the people asking these question are well-off, and can probably afford tulips of their own, and so from their place of privilege they are trying to raise pointless objections to other people being able to obtain the connubial happiness they themselves enjoy. After the doubters are tarred and feathered and thrown in the river, Parliament votes that the public purse pay for as many tulips as the poor need, whatever the price.

A few years later, another Dutch trader comes to the little kingdom. Everyone asks if he is there to buy tulips, and he says no, the Netherlands’ tulip bubble has long since collapsed, and the price is down to a guilder or two. The people of the kingdom are very surprised to hear that, since the price of their own tulips has never stopped going up, and is now in the range of tens of thousands of guilders. Nevertheless, they are glad that, however high tulip prices may be for them, they know the government is always there to help. Sure, the roads are falling apart and the army is going hungry for lack of rations, but at least everyone who wants to marry is able to do so.

Meanwhile, across the river is another little kingdom that had the same tulip-related marriage custom. They also had a crisis when the Dutch merchants started making the prices go up. But they didn’t have enough money to afford universal tulip subsidies. It was pretty touch-and-go for a while, and a lot of poor people were very unhappy.

But nowadays they use daffodils to mark engagements, and their economy has never been better.

II.

In America, aspiring doctors do four years of undergrad in whatever area they want (I did Philosophy), then four more years of medical school, for a total of eight years post-high school education. In Ireland, aspiring doctors go straight from high school to medical school and finish after five years.

I’ve done medicine in both America and Ireland. The doctors in both countries are about equally good. When Irish doctors take the American standardized tests, they usually do pretty well. Ireland is one of the approximately 100% of First World countries that gets better health outcomes than the United States. There’s no evidence whatsoever that American doctors gain anything from those three extra years of undergrad. And why would they? Why is having a philosophy degree under my belt supposed to make me any better at medicine?

(I guess I might have acquired a talent for colorectal surgery through long practice pulling things out of my ass, but it hardly seems worth it.)

I’ll make another confession. Ireland’s medical school is five years as opposed to America’s four because the Irish spend their first year teaching the basic sciences – biology, organic chemistry, physics, calculus. When I applied to medical school in Ireland, they offered me an accelerated four year program on the grounds that I had surely gotten all of those in my American undergraduate work. I hadn’t. I read some books about them over the summer and did just fine.

Americans take eight years to become doctors. Irishmen can do it in four, and achieve the same result. Each year of higher education at a good school – let’s say an Ivy, doctors don’t study at Podunk Community College – costs about $50,000. So American medical students are paying an extra $200,000 for…what?

Remember, a modest amount of the current health care crisis is caused by doctors’ crippling level of debt. Socially responsible doctors often consider less lucrative careers helping the needy, right up until the bill comes due from their education and they realize they have to make a lot of money right now. We took one look at that problem and said “You know, let’s make doctors pay an extra $200,000 for no reason.”

And to paraphrase Dirkson, $200,000 here, $200,000 there, and pretty soon it adds up to real money. 20,000 doctors graduate in the United States each year; that means the total yearly cost of requiring doctors to have undergraduate degrees is $4 billion. That’s most of the amount of money you’d need to house every homeless person in the country ($10,000 to house one homeless x 600,000 homeless).

I want to be able to say people have noticed the Irish/American discrepancy and are thinking hard about it. I can say that. Just not in the way I would like. Many of the elder doctors I talked to in Ireland wanted to switch to the American system. Not because they thought it would give them better doctors. Just because they said it was more fun working with medical students like myself who were older and a little wiser. The Irish medical students were just out of high school and hard to relate to – us foreigners were four years older than that and had one or another undergraduate subject under our belts. One of my attendings said that it was nice having me around because I’d studied Philosophy in college and that gave our team a touch of class. A touch of class!

This is why, despite my reservations about libertarianism, it’s not-libertarianism that really scares me. Whenever some people without skin in the game are allowed to make decisions for other people, you end up with a bunch of elderly doctors getting together, think “Yeah, things do seem a little classier around here if we make people who are not us pay $200,000, make it so,” and then there goes the money that should have housed all the homeless people in the country.

But more important, it also destroyed my last shred of hope that the current mania for requiring college degrees for everything had a good reason behind it.

III.

The only reason I’m picking on medicine is that it’s so clear. You have your experimental group in the United States, your control group in Ireland, you can see the lack of difference. You can take an American doctor and an Irish doctor, watch them prescribe the same medication in the same situation, and have a visceral feel for “Wait, we just spent $200,000 for no reason.”

But it’s not just medicine. Let me tell you about my family.

There’s my cousin. He wants to be a firefighter. He’s wanted to be a firefighter ever since he was young, and he’s done volunteer work for his local fire department, who have promised him a job. But in order to get it, he has to go do four years of college. You can’t be a firefighter without a college degree. That would be ridiculous. Back in the old days, when people were allowed to become firefighters after getting only thirteen measly years of book learning, I have it on good authority that several major states burnt to the ground.

My mother is a Spanish teacher. After twenty years teaching, with excellent reviews by her students, she pursued a Masters’ in Education because her school was going to pay her more money if she had it. She told me that her professors were incompetent, had never actually taught real students, and spent the entire course pushing whatever was the latest educational fad; however, after paying them thousands of dollars, she got the degree and her school dutifully increased her salary. She is lucky. In several states, teachers are required by law to pursue a Masters’ degree to be allowed to continue teaching. Oddly enough, these states have no better student outcomes than states without this requirement, but this does not seem to affect their zeal for this requirement. Even though many rigorous well-controlled studies have found that presence of absence of a Masters’ degree explains approximately zero percent of variance in teacher quality, many states continue to require it if you want to keep your license, and almost every state will pay you more for having it.

Before taking my current job, I taught English in Japan. I had no Japanese language experience and no teaching experience, but the company I interviewed with asked if I had an undergraduate degree in some subject or other, and that was good enough for them. Meanwhile, I knew people who were fluent in Japanese and who had high-level TOEFL certification. They did not have a college degree so they were not considered.

My ex-girlfriend majored in Gender Studies, but it turned out all of the high-paying gender factories had relocated to China. They solved this problem by going to App Academy, a three month long, $15,000 course that taught programming. App Academy graduates compete for the same jobs as people who have taken computer science in college, a four year long, $200,000 undertaking.

I see no reason to think my family and friends are unique. The overall picture seems to be one of people paying hundreds of thousands of dollars to get a degree in Art History to pursue a job in Sales, or a degree in Spanish Literature to get a job as a middle manager. Or not paying hundreds of thousands of dollars, if they happen to be poor, and so being permanently locked out of jobs as a firefighter or salesman.

IV.

So presidential candidate Bernie Sanders has proposed universal free college tuition.

On the one hand, I sympathize with his goals. If you can’t get any job better than ‘fast food worker’ without a college degree, and poor people can’t afford college degrees, that’s a pretty grim situation, and obviously unfair to the poor.

On the other hand, if can’t you get married without a tulip, and poor people can’t afford tulips, that’s also a pretty grim situation, and obviously unfair to the poor.

But the solution isn’t universal tulip subsidies.

Higher education is in a bubble much like the old tulip bubble. In the past forty years, the price of college has dectupled (quadrupled when adjusting for inflation). It used to be easy to pay for college with a summer job; now it is impossible. At the same time, the unemployment rate of people without college degrees is twice that of people who have them. Things are clearly very bad and Senator Sanders is right to be concerned.

But, well, when we require doctors to get a college degree before they can go to medical school, we’re throwing out a mere $5 billion, barely enough to house all the homeless people in the country. But Senator Sanders admits that his plan would cost $70 billion per year. That’s about the size of the entire economy of Hawaii. It’s enough to give $2000 every year to every American in poverty.

At what point do we say “Actually, no, let’s not do that, and just let people hold basic jobs even if they don’t cough up a a hundred thousand dollars from somewhere to get a degree in Medieval History”?

I’m afraid that Sanders’ plan is a lot like the tulip subsidy idea that started off this post. It would subsidize the continuation of a useless tradition that has turned into a speculation bubble, prevent the bubble from ever popping, and disincentivize people from figuring out a way to route around the problem, eg replacing the tulips with daffodils.

(yes, it is nice to have college for non-economic reasons too, but let’s be honest – if there were no such institution as college, would you, totally for non-economic reasons, suggest the government pay poor people $100,000 to get a degree in Medieval History? Also, anything not related to job-getting can be done three times as quickly by just reading a book.)

If I were Sanders, I’d propose a different strategy. Make “college degree” a protected characteristic, like race and religion and sexuality. If you’re not allowed to ask a job candidate whether they’re gay, you’re not allowed to ask them whether they’re a college graduate or not. You can give them all sorts of examinations, you can ask them their high school grades and SAT scores, you can ask their work history, but if you ask them if they have a degree then that’s illegal class-based discrimination and you’re going to jail. I realize this is a blatant violation of my usual semi-libertarian principles, but at this point I don’t care.

Switching to Hugo from Nikola

Switching to Hugo from Nikola

https://staticxx.facebook.com/connect/xd_arbiter/r/0sTQzbapM8j.js?version=42#channel=f3ed48452b6ca3&origin=https%3A%2F%2Fsadanand-singh.github.io

Skip to main content

Switching to Hugo from Nikola

in Blog 

0 Comments 

  

https://www.facebook.com/v2.7/plugins/like.php?action=like&app_id=&channel=https%3A%2F%2Fstaticxx.facebook.com%2Fconnect%2Fxd_arbiter%2Fr%2F0sTQzbapM8j.js%3Fversion%3D42%23cb%3Df11ac5ff394519%26domain%3Dsadanand-singh.github.io%26origin%3Dhttps%253A%252F%252Fsadanand-singh.github.io%252Ff3ed48452b6ca3%26relation%3Dparent.parent&container_width=382&href=https%3A%2F%2Fsadanand-singh.github.io%2Fposts%2Fnikola2hugo%2F&layout=standard&locale=en_US&sdk=joey&send=true&share=false&show_faces=false&size=small

I have been using Nikola to build this Blog. Its a great static site build system that is based on Python. However, It has some crazy amount of dependencies (to have reasonable looking site). It uses restructured text (rst) as the primary language for content creation. Personally, I use markdown for almost every thing else – taking notes, making diary, code documentation etc. Furthermore, given Nikola tries to support almost everything in a static site builder, lately its is becoming more and more bloated.

Case in point, recently it got support for shortcodes and although that did enable me to write posts in Markdown, but it is so difficult to develop them (It does not help to have almost no documentation/guide for their development). They are heavily tied to the plugin system with light support for template based shortcodes.

I really have nothing against Nikola. However, I did not feel at home – I wanted a light system that focused on markdown and had all the flexibilities that I wanted. My research soon brought me to Hugo.

Table of Contents

Hugo – the blazing fast site generator

Hugo is a light weight, fast and modern static website engine written in go. It literally takes just milliseconds to build your entire site. For the given lightness, it is highly flexible as well. You can organize your content however you want with any URL structure, group your content using your own indexes and categories and define your own metadata in any format: YAMLTOML or JSON. I was impressed! Keep in my mind, python is still my primary language of programming for scripting and machine learning. And, I have almost no programming experience with go.

I chose YAML for all the configuration as well as metadata. In my next step to make this move, I had to choose the theme for my blog. If you have been following me, I have been using several flavors of Bootswatch themes. So my first goal was implement my heavily modified version of bootswatch theme in Hugo.

Bootswatch Theme

Developing a theme from scratch (Well, the implementation from scratch, as I all I am trying to do is mimic/improvise my current theme from Nikola) turned out to be a great adventure and learning exercise. It helped me understand the Hugo architecture in great detail. It did help to have some good documentation written for developers, not users! Although, Hugo’s documentation can surely help itself with some cleaning and some fresher looks!

Hugo uses go templates with many extra functions and set of variables provided by Hugo. I personally feel Hugo’s template-ing system to be more flexible and easier than Mako – the one used by default by Nikola.

I converted almost all of Mako theme from Nikola website to Hugo’s format and architecture with additions (copied features and code) from a nice theme called TranqilPeak. In particular, I liked their fonts, search feature for taxonomies pages. Copying these features also meant I had to learn a bit of javascript and css. You can find a working copy of my theme in the src branch of gihub repository of my blog. I plan to release this theme as a standalone theme in near future though.

Shortcodes

Given I am using a bootstrap based theme, I like having a lot of its features available to me when I am writing in Markdown. The powerful template based shortcodes in Hugo provide a great way to write custom HTML code inside markdown. I feel Hugo shortcodes are so powerful, you could develop your own grammar of markup language in it! 😋

Some of my shortcodes are basically based on bootstrap classes like panel, label, emphasis, highlighted text, and block quotes. I also liked the figure command provided by restructured text in Nikola. Luckily, same features are available in Hugo using a default shortcode called figure. Hugo also provides several other useful default shortcodes like youtuberef/relref for referencing other posts etc.

I have also some additional shortcodes for code-blocks and math. I will be detailing about them in a bit more detail in the next section. All of my shortcodes are available with the theme in the same github repo.

Other Caveats and Fixes

While converting to Hugo was fun, there were some caveats. The issues I faced were mainly with home page, site search, and ipython notebook posts.

Home Page with Content and Post Lists

Getting home page to work was very simple. Hugo documentation page provides a very clear details about order in which various templates are looked. For home page, you will need to provide a template for index.html. Then Inside the content folder, you can put the metadata and the content for the home page in a file named _index.md.

I also added following template code in the index.html template to get list of posts with machine learning related tags:

{{ $.Scratch.Add "mlposts" slice }}
{{ $tags := (slice "Machine Learning" "EDA" "Kaggle" "ML" "Deep Learning" "DL" "Data Science") }}
{{ range .Site.RegularPages }}
    {{ $page := . }}
    {{ $has_common_tags := intersect $tags .Params.tags | len | lt 0 }}
    {{ if $has_common_tags }}
        {{ $.Scratch.Add "mlposts" $page }}
    {{ end }}
{{ end }}
{{ $cand := .Scratch.Get "mlposts" }}
{{ range first 10 $cand }}
    {{ .Render "li"}}
{{ end }}

Hugo has support for several output formats, including HTML and JSON. For implementing tipue search, we need to generate a JSON file with site content. This can be done by adding following to the configuration file:

# Output formats
outputs:
  home: [ "HTML", "JSON"]
  page: [ "HTML"]

and, using the following index.json template:

{{- $.Scratch.Add "index" slice -}}
{{- range where .Site.RegularPages "Type" "not in"  (slice "page" "json" "nosearch") -}}
{{- $.Scratch.Add "index" (dict "url" .Permalink "title" .Title "text" .Plain "tags" (delimit .Params.tags ", ")) -}}
{{- end -}}
{"pages": {{- $.Scratch.Get "index" | jsonify -}}}

Now, include the following css in the <head> of your pages:

<link href="//cdnjs.cloudflare.com/ajax/libs/Tipue-Search/5.0.0/tipuesearch.css" rel="stylesheet" type="text/css">

The following modal code is needed to display the search results, preferably at the end of the body of the HTMLpage:

<div id="search-resuts" class="modal fade" role="dialog" style="height: 80%;">
<div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">×</button>
        <h4 class="modal-title">Search Results:</h4>
      </div>
      <div class="modal-body" id="tipue_search_content" style="max-height: 600px; overflow-y: auto;">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
</div>
</div>

Finally, the following javascript in the lower end of the body of HTML pages:

<script>
$(document).ready(function() {
    var url1 = "https://cdnjs.cloudflare.com/ajax/libs/Tipue-Search/5.0.0/tipuesearch_set.js";
    var url2 = "https://cdnjs.cloudflare.com/ajax/libs/Tipue-Search/5.0.0/tipuesearch.min.js";
    $.when(
        $.getScript( url1 ),
        $.getScript( url2 ),
        $.Deferred(function( deferred ){
            $( deferred.resolve );
        })
    ).done(function() {
        $('#tipue_search_input').tipuesearch({
            'mode': 'json',
            'contentLocation': '/index.json'
        });
        $('#tipue_search_input').keyup(function (e) {
            if (e.keyCode == 13) {
                $('#search-results').modal()
            }
        });
    });
});
</script>

And, of course you will need a form/input for performing the search:

<span class="navbar-form navbar-right">
    <input type="text" id="tipue_search_input" class="form-control" placeholder="Search">
</span>

Code Highlighting

Although, by default Hugo provides code highlighting using the pygments, I prefer to use client-side highlighting using prism.js. I also use the following plugins of prism.js for line numbers, highlighting and cleanup of white space:

Finally, I create a shortcode called code-block to add relevant classes and variables around <code> and <pre> tags so that prism could highlight code correctly.

jupyter Notebooks as Posts

One of the advantages of using Nikola is that, it provides native support for writing Blog posts in jupyter notebooks.

But, on some Google search, I found this neat solution.

In summary, the setup is very simple – Use the linked jupyter.css file in your template, then add this css file to relevant pages. I do the this based on a metadata variable notebook: true via the following template code:

{{ if .Params.notebook }}
    <link href="{{ $.Site.BaseURL }}css/jupyter.css" rel="stylesheet" type="text/css">
{{ end }}

Then for any jupyter notebook, convert it to basic HTML using the following command:

jupyter nbconvert --to html --template basic *source_file.ipynb*

Finally, create a markdown file for your post to put the contents of this HTML file. Works like charm since markdown supports including raw HTML code!

Latex Math Equations

I used katex for using math in markdown. I was having some issue with the multi-line display math equations, so I created a shortcode called tex to write HTML code explicitly so that katexcould handle that easily.

I added following code in the <head> of all of posts:

{{ if .Params.hasMath }}
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.css"
    integrity="sha384-wITovz90syo1dJWVh32uuETPVEtGigN07tkttEqPv+uR2SE/mbQcG7ATL28aI9H0"
    crossorigin="anonymous">
{{ end }}

And the following script at the end of the <body>section:

{{ if .Params.hasMath }}
    <script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/katex.min.js"
    integrity="sha384-/y1Nn9+QQAipbNQWU65krzJralCnuOasHncUFXGkdwntGeSvQicrYkiUBwsgUqc1"
    crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1/contrib/auto-render.min.js"
    integrity="sha256-ExtbCSBuYA7kq1Pz362ibde9nnsHYPt6JxuxYeZbU+c="
    crossorigin="anonymous"></script>
    <script>
        renderMathInElement(document.body,
            {
                delimiters: [
                    {left: "\\\\begin{equation*}", right: "\\\\end{equation*}", display: true},
                    {left: "$$", right: "$$", display: true},
                    {left: "\\\[", right: "\\\]", display: true},
                    {left: "$", right: "$", display: false},
                    {left: "\\\(", right: "\\\)", display: false}
                ]
            }
        );
    </script>
{{ end }}

Now, whenever, I need to add math equations in a post, enable the hasMath: true parameter in its metadata.

So there you have it. I have my Blog now up and running with Hugo. Hope I will be more active here, since it now takes only seconds to deploy once I have a post written. No excuses now! 😜

https://disqus.com/embed/comments/?base=default&f=sadanandsblog&t_i=nikola2hugo.sadanand&t_u=https%3A%2F%2Fsadanand-singh.github.io%2Fposts%2Fnikola2hugo%2F&t_d=%20%20%20%20%20%20%20%20Switching%20to%20Hugo%20from%20Nikola%20%20%20%20%20%20&t_t=%20%20%20%20%20%20%20%20Switching%20to%20Hugo%20from%20Nikola%20%20%20%20%20%20&s_o=default#version=0c08ab914fa63cb2aae6da0057f0e0ee

Umfragen Bundestagswahl

Umfragen Bundestagswahl

INSA / YouGov

[Umfragen]

Wenn am nächsten Sonntag Bundestagswahl wäre …

Datum   CDU/CSU SPD GRÜNE FDP LINKE PIRATEN FW AfD Sonstige   Befragte Zeitraum
Datum   CDU/CSU SPD GRÜNE FDP LINKE PIRATEN FW AfD Sonstige   Befragte Zeitraum
O: Online-Panel – internetbasierte Befragung von gezielt ausgewählten Mitgliedern einer Personengruppe (Befragten-Pool)
AfD = Alternative für Deutschland
CDU = Christlich Demokratische Union Deutschlands
CSU = Christlich-Soziale Union in Bayern e. V.
SPD = Sozialdemokratische Partei Deutschlands
GRÜNE = BÜNDNIS 90/DIE GRÜNEN
FDP = Freie Demokratische Partei
FW = FREIE WÄHLER Bundesvereinigung
LINKE = DIE LINKE
PIRATEN = Piratenpartei Deutschland
Sonstige = sonstige Parteien
– Als Umfragewert: nicht ausgewiesen; als Wahlergebnis: nicht teilgenommen
22.08.2017   38 % 24 % 7 % 9 % 9 % 10 % 3 %   O • 2.036 18.08.–21.08.
15.08.2017   37 % 25 % 7 % 9 % 9 % 10 % 3 %   O • 2.025 11.08.–14.08.
07.08.2017   37 % 25 % 6,5 % 9 % 10,5 % 9 % 3 %   O • 2.046 04.08.–07.08.
01.08.2017   37 % 24,5 % 7 % 9 % 10 % 9,5 % 3 %   O • 2.046 28.07.–31.07.
25.07.2017   37,5 % 25 % 6,5 % 8,5 % 10,5 % 9 % 3 %   O • 2.009 21.07.–24.07.
18.07.2017   36 25 % 6,5 % 8,5 % 9,5 % 10 % 4,5 %   O • 2.026 14.07.–17.07.
10.07.2017   36 25 % 6,5 % 9 % 9,5 % 9,5 % 4,5 %   O • 2.009 07.07.–10.07.
03.07.2017   36,5 25 % 6,5 % 9 % 10,5 % 9 % 3,5 %   O • 2.044 30.06.–03.07.
27.06.2017   37 26 % 6,5 % 9 % 10 % 8,5 % 3 %   O • 2.056 23.06.–26.06.
20.06.2017   36,5 25 % 6,5 % 9 % 11 % 9 % 3 %   O • 2.040 16.06.–19.06.
12.06.2017   37,5 23,5 % 6,5 % 9 % 11 % 9 % 3,5 %   O • 2.051 09.06.–12.06.
06.06.2017   38 23 % 7 % 9 % 11 % 8 % 4 %   O • 2.037 02.06.–06.06.
29.05.2017   35,5 26 % 6 % 10 % 10 % 9 % 3,5 %   O • 2.053 26.05.–29.05.
22.05.2017   36,5 % 26 % 6 % 9,5 % 10 % 8 % 4 %   O • 2.042 19.05.–22.05.
16.05.2017   36 % 27 % 6 % 8 % 9 % 10 % 4 %   O • 2.037 12.05.–15.05.
09.05.2017   35 % 27 % 7 % 7 % 10 % 10 % 4 %   O • 2.067 05.05.–08.05.
02.05.2017   34 % 28,5 % 6,5 % 7 % 10,5 % 9 % 4,5 %   O • 2.035 28.04.–02.05.
25.04.2017   34 % 30 % 6,5 % 6,5 % 9,5 % 10 % 3,5 %   O • 2.041 21.04.–24.04.
19.04.2017   34 % 30,5 % 6 % 6,5 % 9 % 10 % 4 %   O • 2.038 14.04.–18.04.
10.04.2017   33 % 31,5 % 6,5 % 6,5 % 8,5 % 10 % 4 %   O • 2.030 07.04.–10.04.
03.04.2017   32 % 32,5 % 6,5 % 6,5 % 9 % 9 % 4,5 %   O • 2.033 31.03.–03.04.
27.03.2017   32 % 32 % 6,5 % 6 % 8,5 % 11 % 4 %   O • 2.034 24.03.–27.03.
20.03.2017   31 % 32 % 6,5 % 6,5 % 8,5 % 11,5 % 4 %   O • 1.933 17.03.–20.03.
13.03.2017   31 % 31 % 6,5 % 7 % 8,5 % 11,5 % 4,5 %   O • 2.051 10.03.–13.03.
07.03.2017   30,5 % 31,5 % 6,5 % 7,5 % 8,5 % 11 % 4,5 %   O • 2.022 03.03.–06.03.
28.02.2017   30,5 % 32 % 6,5 % 7 % 8 % 11 % 5 %   O • 2.004 24.02.–27.02.
21.02.2017   31,5 % 30 % 6,5 % 5,5 % 9,5 % 11 % 6 %   O • 2.030 17.02.–20.02.
13.02.2017   30 % 31 % 7 % 5 % 10 % 12 % 5 %   O • 2.028 10.02.–13.02.
06.02.2017   30 % 31 % 7 % 6 % 10 % 12 % 4 %   O • 2.042 03.02.–06.02.
02.02.2017   Zur telefonischen Umfrage (CATI) von INSA 31.01.–01.02.
30.01.2017   32,5 % 26 % 7,5 % 6,5 % 10,5 % 13 % 4 %   O • 2.088 27.01.–30.01.
23.01.2017   32,5 % 21 % 8,5 % 7,5 % 11 % 14,5 % 5 %   O • 1.992 20.01.–23.01.
17.01.2017   33,5 % 21 % 8,5 % 7,5 % 11 % 13,5 % 5 %   O • 2.031 13.01.–16.01.
09.01.2017   32 % 21 % 9 % 7 % 11 % 15 % 5 %   O • 2.054 06.01.–09.01.
03.01.2017   32 % 21 % 10 % 6 % 11,5 % 15 % 4,5 %   O • 2.099 30.12.–02.01.
23.12.2016   31,5 % 20,5 % 10 % 6 % 11,5 % 15,5 % 5 %   O • 2.083 21.12.–23.12.
20.12.2016   33 % 21,5 % 10 % 6,5 % 11,5 % 13 % 4,5 %   O • 2.116 16.12.–19.12.
13.12.2016   32 % 21,5 % 11,5 % 5,5 % 12 % 13 % 4,5 %   O • 1.455 09.12.–12.12.
06.12.2016   32 % 22,5 % 10,5 % 5 % 11,5 % 14 % 4,5 %   O • 2.080 02.12.–05.12.
28.11.2016   32,5 % 22 % 10 % 5,5 % 11,5 % 13,5 % 5 %   O • 2.097 25.11.–28.11.
22.11.2016   31,5 % 22 % 10,5 % 5,5 % 10,5 % 15 % 5 %   O • 2.030 18.11.–21.11.
14.11.2016   30 % 22,5 % 10,5 % 6,5 % 11,5 % 14,5 % 4,5 %   O • 2.037 11.11.–14.11.
08.11.2016   30,5 % 22 % 11 % 7 % 10,5 % 13,5 % 5,5 %   O • 2.045 04.11.–07.11.
02.11.2016   30,5 % 22,5 % 11 % 6,5 % 11,5 % 13 % 5 %   O • 2.037 28.10.–02.11.
25.10.2016   30,5 % 22,5 % 11,5 % 6 % 11,5 % 14 % 4 %   O • 2.043 21.10.–24.10.
18.10.2016   29,5 % 21,5 % 12 % 6,5 % 12,5 % 13,5 % 4,5 %   O • 2.077 14.10.–17.10.
10.10.2016   29,5 % 22 % 11 % 6,5 % 12 % 15 % 4 %   O • 2.085 07.10.–10.10.
05.10.2016   30 % 21 % 11,5 % 7 % 11,5 % 15 % 4 %   O • 2.049 30.09.–03.10.
27.09.2016   30 % 21 % 10 % 7 % 11 % 15,5 % 5,5 %   O • 2.048 23.09.–26.09.
19.09.2016   30 % 22 % 11 % 7 % 10 % 15 % 5 %   O • 2.069 16.09.–19.09.
13.09.2016   30,5 % 21,5 % 11 % 7 % 10 % 15 % 5 %   O • 2.035 09.09.–12.09.
05.09.2016   30,5 % 21,5 % 11,5 % 6,5 % 9,5 % 15 % 5,5 %   O • 2.071 02.09.–05.09.
30.08.2016   30,5 % 21 % 11,5 % 7 % 10,5 % 14,5 % 5 %   O • 2.013 26.08.–29.08.
23.08.2016   31 % 21 % 11,5 % 6,5 % 10,5 % 14 % 5,5 %   O • 2.020 19.08.–22.08.
16.08.2016   31 % 20,5 % 11 % 7 % 11,5 % 13,5 % 5,5 %   O • 2.046 12.08.–15.08.
09.08.2016   31,5 % 21 % 11,5 % 6,5 % 11,5 % 13 % 5 %   O • 2.056 05.08.–08.08.
02.08.2016   31,5 % 21 % 11 % 6,5 % 11 % 13 % 6 %   O • 1.973 30.07.–01.08.
26.07.2016   31,5 % 21,5 % 12 % 6,5 % 11,5 % 12 % 5 %   O • 2.049 22.07.–25.07.
19.07.2016   32 % 21 % 12 % 7 % 11,5 % 11 % 5,5 %   O • 2.038 15.07.–18.07.
11.07.2016   31 % 20,5 % 12 % 7,5 % 11 % 12,5 % 5,5 %   O • 2.034 08.07.–11.07.
04.07.2016   30 % 21 % 12 % 8 % 10 % 14,5 % 4,5 %   O • 2.001 01.07.–04.07.
27.06.2016   30 % 19 % 13 % 8 % 11 % 14 % 5 %   O • 2.054 24.06.–27.06.
20.06.2016   31 % 20 % 13 % 7 % 11 % 13 % 5 %   O • 2.017 17.06.–20.06.
13.06.2016   30 % 19,5 % 12 % 8 % 11 % 14 % 5,5 %   O • 2.047 10.06.–13.06.
06.06.2016   30 % 19 % 13 % 8 % 10,5 % 14 % 5,5 %   O • 2.032 03.06.–06.06.
31.05.2016   30 % 19 % 13 % 8 % 9,5 % 15 % 5,5 %   O • 2.053 25.05.–30.05.
23.05.2016   30,5 % 19,5 % 13 % 7 % 10 % 15 % 5 %   O • 2.022 20.05.–23.05.
17.05.2016   30,5 % 19,5 % 13 % 7,5 % 10,5 % 15 % 4 %   O • 1.947 13.05.–17.05.
09.05.2016   30,5 % 19,5 % 13 % 8 % 10 % 15 % 4 %   O • 2.048 04.05.–09.05.
02.05.2016   32 % 19,5 % 13 % 8 % 10 % 13,5 % 4 %   O • 2.036 29.04.–02.05.
25.04.2016   31 % 19,5 % 14 % 8 % 10 % 13,5 % 4 %   O • 2.054 22.04.–25.04.
18.04.2016   31,5 % 19,5 % 13 % 7 % 9,5 % 13,5 % 6 %   O • 2.010 16.04.–18.04.
11.04.2016   31,5 % 19,5 % 13,5 % 7,5 % 9,5 % 12,5 % 6 %   O • 1.997 08.04.–11.04.
04.04.2016   32 % 20 % 12,5 % 7,5 % 9 % 13 % 6 %   O • 2.036 01.04.–04.04.
29.03.2016   32 % 20 % 12,5 % 6 % 11 % 13 % 5,5 %   O • 1.873 24.03.–29.03.
21.03.2016   33 % 22 % 11 % 7 % 10,5 % 12 % 4,5 %   O • 2.022 18.03.–21.03.
14.03.2016   32 % 22 % 10 % 6,5 % 11 % 13 % 5,5 %   O • 2.004 11.03.–14.03.
08.03.2016   32,5 % 23 % 11 % 6,5 % 10 % 11,5 % 5,5 %   O • 2.011 04.03.–07.03.
29.02.2016   32,5 % 23 % 11 % 6,5 % 11 % 11,5 % 4,5 %   O • 2.007 26.02.–29.02.
22.02.2016   32,5 % 22,5 % 10,5 % 6,5 % 10 % 12,5 % 5,5 %   O • 2.001 19.02.–22.02.
15.02.2016   32,5 % 22,5 % 11 % 7 % 9,5 % 12,5 % 5 %   O • 2.014 12.02.–15.02.
09.02.2016   32,5 % 22 % 11 % 6 % 10,5 % 12 % 6 %   O • 2.054 05.02.–09.02.
01.02.2016   33 % 23 % 10 % 6 % 10 % 12,5 % 5,5 %   O • 2.007 29.01.–01.02.
25.01.2016   32,5 % 23 % 10 % 6 % 9 % 13 % 6,5 %   O • 2.047 22.01.–25.01.
18.01.2016   32,5 % 22,5 % 9,5 % 6,5 % 10 % 12,5 % 6,5 %   O • 2.051 15.01.–18.01.
11.01.2016   35 % 21,5 % 10 % 6 % 10 % 11,5 % 6 %   O • 2.039 08.01.–11.01.
04.01.2016   36 % 22,5 % 10 % 5 % 10 % 9,5 % 7 %   O • 2.022 30.12.–04.01.
21.12.2015   35,5 % 23 % 9,5 % 6 % 11 % 9,5 % 5,5 %   O • 2.066 18.12.–21.12.
14.12.2015   35 % 23,5 % 9 % 5,5 % 10 % 10 % 7 %   O • 2.030 11.12.–14.12.
08.12.2015   35 % 23,5 % 9,5 % 6 % 9,5 % 10 % 6,5 %   O • 2.012 04.12.–07.12.
30.11.2015   34,5 % 23,5 % 9,5 % 5,5 % 9,5 % 10,5 % 7 %   O • 2.016 27.11.–30.11.
23.11.2015   34,5 % 23 % 9 % 6 % 10,5 % 10 % 7 %   O • 2.025 20.11.–23.11.
16.11.2015   35 % 23,5 % 10 % 5 % 10 % 10,5 % 6 %   O • 2.057 13.11.–16.11.
09.11.2015   34 % 24 % 10 % 6 % 11 % 10 % 5 %   O • 2.017 06.11.–09.11.
02.11.2015   35,5 % 24,5 % 10 % 5,5 % 10 % 8 % 6,5 %   O • 2.173 30.10.–02.11.
27.10.2015   35 % 24,5 % 11 % 4,5 % 9,5 % 8,5 % 7 %   O • 2.196 23.10.–26.10.
19.10.2015   37 % 25 % 9,5 % 5 % 9,5 % 7,5 % 6,5 %   O • 2.173 16.10.–19.10.
12.10.2015   38 % 24,5 % 10 % 5 % 9 % 6,5 % 7 %   O • 2.190 09.10.–12.10.
06.10.2015   39 % 24 % 9,5 % 5 % 10 % 6 % 6,5 %   O • 2.183 02.10.–05.10.
28.09.2015   38,5 % 23,5 % 10,5 % 4 % 10,5 % 6 % 7 %   O • 2.201 25.09.–28.09.
21.09.2015   39,5 % 24,5 % 9,5 % 4 % 10 % 6 % 6,5 %   O • 2.187 18.09.–21.09.
14.09.2015   40 % 24 % 10 % 4 % 9,5 % 5,5 % 7 %   O • 2.172 11.09.–14.09.
08.09.2015   41,5 % 24 % 10,5 % 4 % 9,5 % 5 % 5,5 %   O • 2.151 04.09.–07.09.
31.08.2015   41,5 % 23,5 % 10 % 4 % 9,5 % 4,5 % 7 %   O • 2.169 28.08.–31.08.
26.08.2015   42 % 23,5 % 10,5 % 4 % 9,5 % 3,5 % 7 %   O • 2.169 21.08.–24.08.
17.08.2015   41 % 24,5 % 11 % 4,5 % 9 % 4 % 6 %   O • 2.178 14.08.–17.08.
11.08.2015   42,5 % 23 % 10,5 % 4,5 % 9 % 4 % 6,5 %   O • 2.161 07.08.–10.08.
03.08.2015   43 % 24,5 % 10 % 4 % 9,5 % 3 % 6 %   O • 2.166 31.07.–03.08.
28.07.2015   41,5 % 25,5 % 9,5 % 4 % 9,5 % 3 % 7 %   O • 2.167 24.07.–27.07.
20.07.2015   42 % 25 % 9,5 % 4 % 9,5 % 1,5 % 3 % 5,5 %   O • 2.187 17.07.–20.07.
13.07.2015   42 % 25,5 % 9,5 % 4 % 9,5 % 3,5 % 6 %   O • 2.178 10.07.–13.07.
07.07.2015   43 % 24 % 10 % 4 % 9 % 1 % 4 % 5 %   O • 2.189 03.07.–06.07.
30.06.2015   39,5 % 24,5 % 9,5 % 5 % 9,5 % 2 % 4,5 % 5,5 %   O • 2.187 26.06.–29.06.
23.06.2015   40 % 25 % 10 % 4 % 9,5 % 4,5 % 7 %   O • 2.179 19.06.–22.06.
15.06.2015   41 % 24 % 9,5 % 4,5 % 10,5 % 4,5 % 6 %   O • 2.177 12.06.–15.06.
10.06.2015   40 % 24 % 10 % 5 % 10 % 5 % 6 %   O • 2.189 05.06.–08.06.
01.06.2015   41 % 25 % 10 % 5 % 8,5 % 5 % 5,5 %   O • 2.168 29.05.–01.06.
27.05.2015   41 % 24,5 % 9,5 % 5 % 9,5 % 5,5 % 5 %   O • 2.163 22.05.–25.05.
19.05.2015   40,5 % 24 % 10 % 4,5 % 9,5 % 5,5 % 6 %   O • 2.175 15.05.–18.05.
13.05.2015   41,5 % 24,5 % 9 % 3 % 9,5 % 6 % 6,5 %   O • 2.149 08.05.–11.05.
04.05.2015   41 % 25 % 9,5 % 3 % 9,5 % 2 % 6 % 4 %   O • 2.148 01.05.–04.05.
27.04.2015   40,5 % 25 % 11 % 3 % 8,5 % 1,5 % 6 % 4,5 %   O • 2.169 24.04.–27.04.
21.04.2015   41 % 24,5 % 10 % 3,5 % 9 % 6,5 % 5,5 %   O • 2.174 17.04.–20.04.
14.04.2015   41 % 23,5 % 10 % 3 % 9,5 % 6,5 % 6,5 %   O • 2.161 10.04.–13.04.
09.04.2015   42 % 24 % 9 % 3 % 9 % 6,5 % 6,5 %   O • 2.174 03.04.–07.04.
31.03.2015   43 % 23,5 % 10 % 3 % 9 % 6 % 5,5 %   O • 1.978 27.03.–30.03.
24.03.2015   41 % 24 % 9,5 % 4 % 9 % 6,5 % 6 %   O • 2.012 20.03.–23.03.
17.03.2015   41 % 22,5 % 9,5 % 3,5 % 10 % 7,5 % 6 %   O • 1.998 13.03.–16.03.
11.03.2015   41 % 24,5 % 9,5 % 3 % 9 % 7,5 % 5,5 %   O • 1.997 06.03.–09.03.
02.03.2015   41 % 24 % 9,5 % 3 % 9 % 7,5 % 6 %   O • 2.019 27.02.–02.03.
24.02.2015   41 % 24,5 % 9,5 % 3 % 8,5 % 7,5 % 6 %   O • 1.992 20.02.–23.02.
18.02.2015   42 % 24 % 10 % 3 % 8,5 % 7 % 5,5 %   O • 2.011 13.02.–17.02.
10.02.2015   40,5 % 25 % 10,5 % 3 % 8,5 % 7,5 % 5 %   O • 2.005 06.02.–09.02.
02.02.2015   41 % 25 % 10 % 2,5 % 9 % 7 % 5,5 %   O • 2.013 30.01.–02.02.
26.01.2015   42 % 24 % 10 % 3 % 8,5 % 7 % 5,5 %   O • 2.005 23.01.–26.01.
20.01.2015   42 % 23 % 10 % 3,5 % 9 % 1,5 % 7 % 4 %   O • 2.019 16.01.–19.01.
15.01.2015   43 % 23 % 10 % 2,5 % 9 % 1,5 % 7,5 % 3,5 %   O • 2.058 09.01.–12.01.
06.01.2015   42,5 % 24 % 9 % 2 % 9,5 % 7,5 % 5,5 %   O • 2.036 02.01.–05.01.
16.12.2014   41,5 % 24,5 % 9,5 % 2 % 10 % 7,5 % 5 %   O • 2.017 12.12.–15.12.
11.12.2014   41 % 24 % 9,5 % 2 % 9,5 % 8 % 6 %   O • 2.046 05.12.–08.12.
02.12.2014   41,5 % 23 % 9 % 2 % 10 % 8,5 % 6 %   O • 2.047 28.11.–01.12.
24.11.2014   41 % 24 % 9 % 2,5 % 10,5 % 7,5 % 5,5 %   O • 1.979 21.11.–24.11.
17.11.2014   40 % 25 % 10 % 2,5 % 10 % 7 % 5,5 %   O • 2.017 14.11.–17.11.
11.11.2014   41 % 24,5 % 10 % 3,5 % 9 % 8 % 4 %   O • 2.028 07.11.–10.11.
05.11.2014   41 % 25 % 9 % 2,5 % 9 % 1,5 % 8 % 4 %   O • 2.020 03.11.–05.11.
28.10.2014   41 % 24 % 10 % 2 % 9 % 1,5 % 8 % 4,5 %   O • 2.003 24.10.–27.10.
21.10.2014   40,5 % 24,5 % 9 % 2,5 % 9 % 1,5 % 8 % 5 %   O • 2.005 17.10.–20.10.
13.10.2014   40 % 24 % 10 % 2 % 9 % 9 % 6 %   O • 2.043 10.10.–13.10.
07.10.2014   39 % 24 % 11 % 3 % 8 % 8 % 7 %   O • 2.030 03.10.–06.10.
29.09.2014   38,5 % 25 % 11 % 3 % 9,5 % 8,5 % 4,5 %   O • 2.037 26.09.–29.09.
24.09.2014   39,5 % 24 % 10 % 3 % 9 % 8 % 6,5 %   O • 2.019 19.09.–22.09.
16.09.2014   39 % 25 % 10 % 3,5 % 9,5 % 7 % 6 %   O • 2.020 12.09.–15.09.
10.09.2014   39,5 % 23 % 11 % 3,5 % 9 % 2 % 6 % 6 %   O • 2.030 05.09.–08.09.
02.09.2014   40 % 25 % 10 % 3 % 10 % 6 % 6 %   O • 2.036 29.08.–01.09.
27.08.2014   42 % 25 % 10 % 3,5 % 9,5 % 5 % 5 %   O • 1.998 22.08.–25.08.
20.08.2014   41 % 26 % 10 % 3,5 % 9 % 5 % 5,5 %   O • 2.005 15.08.–18.08.
13.08.2014   42 % 26 % 9,5 % 3 % 9 % 5,5 % 5 %   O • 2.006 08.08.–11.08.
05.08.2014   41 % 25 % 9,5 % 3 % 9,5 % 2 % 4,5 % 5,5 %   O • 2.032 01.08.–04.08.
29.07.2014   40 % 24,5 % 10,5 % 3,5 % 9 % 1,5 % 5 % 6 %   O • 2.014 25.07.–28.07.
23.07.2014   41 % 24 % 10 % 3,5 % 9 % 1,5 % 6 % 5 %   O • 2.044 18.07.–21.07.
14.07.2014   40 % 24 % 11 % 3,5 % 9 % 1,5 % 6 % 5 %   O • 2.018 11.07.–14.07.
08.07.2014   40 % 25 % 10 % 4 % 9 % 2,5 % 5,5 % 4 %   O • 2.033 04.07.–07.07.
30.06.2014   41 % 24 % 10 % 3,5 % 9 % 2 % 6 % 4,5 %   O • 2.044 27.06.–30.06.
23.06.2014   40,5 % 24 % 11 % 3 % 9 % 2 % 6 % 4,5 %   O • 2.020 20.06.–23.06.
16.06.2014   39,5 % 25 % 11 % 4 % 8,5 % 1,5 % 6 % 4,5 %   O • 1.993 13.06.–16.06.
11.06.2014   39 % 24,5 % 11 % 4,5 % 9 % 2 % 6,5 % 3,5 %   O • 2.036 06.06.–10.06.
03.06.2014   38 % 26 % 11 % 3,5 % 9 % 2,5 % 6 % 4 %   O • 2.014 30.05.–02.06.
27.05.2014   39 % 26 % 10 % 4 % 9 % 2 % 6 % 4 %   O • 2.009 23.05.–26.05.
19.05.2014   40 % 25 % 10 % 4 % 9 % 2 % 5 % 5 %   O • 2.009 16.05.–19.05.
13.05.2014   40 % 23,5 % 11 % 4 % 10 % 2 % 5,5 % 4 %   O • 2.033 09.05.–12.05.
05.05.2014   41 % 25 % 11 % 3 % 9 % 2 % 5 % 4 %   O • 2.082 02.05.–05.05.
29.04.2014   41,5 % 24 % 10 % 4,5 % 9 % 2 % 5,5 % 3,5 %   O • 2.093 25.04.–28.04.
23.04.2014   41 % 24,5 % 10,5 % 4,5 % 9 % 2 % 5 % 3,5 %   O • 2.089 18.04.–21.04.
14.04.2014   40,5 % 23,5 % 10 % 5 % 10 % 2 % 5,5 % 3,5 %   O • 2.080 11.04.–14.04.
08.04.2014   41 % 24 % 10 % 4 % 10 % 2 % 6 % 3 %   O • 2.085 04.04.–07.04.
01.04.2014   41 % 24,5 % 11 % 3 % 9 % 2 % 5 % 4,5 %   O • 2.087 28.03.–31.03.
26.03.2014   41 % 25 % 10 % 4 % 10 % 2 % 5 % 3 %   O • 2.088 21.03.–24.03.
19.03.2014   40,5 % 24,5 % 10 % 4 % 10 % 2 % 5 % 4 %   O • 2.102 14.03.–17.03.
11.03.2014   41 % 25,5 % 10 % 4 % 8,5 % 2 % 5,5 % 3,5 %   O • 2.085 07.03.–10.03.
04.03.2014   41 % 24,5 % 11 % 4 % 9,5 % 2 % 5 % 3 %   O • 2.043 28.02.–03.03.
25.02.2014   40,5 % 25,5 % 10 % 4 % 9 % 2,5 % 5,5 % 3 %   O • 2.100 21.02.–24.02.
17.02.2014   41 % 25 % 10 % 4 % 10 % 2,5 % 5 % 2,5 %   O • 2.080 14.02.–17.02.
11.02.2014   41 % 26 % 9 % 4 % 9,5 % 2 % 5 % 3,5 %   O • 2.102 07.02.–10.02.
03.02.2014   41,5 % 25 % 9,5 % 4 % 9 % 2,5 % 5 % 3,5 %   O • 2.110 31.01.–03.02.
27.01.2014   41 % 26,5 % 9,5 % 4,5 % 8,5 % 2,5 % 4 % 3,5 %   O • 2.079 24.01.–27.01.
22.01.2014   41 % 26 % 9,5 % 4,5 % 9 % 4 % 6 %   O • 2.096 17.01.–20.01.
13.01.2014   41 % 26 % 10 % 4 % 9,5 % 4 % 5,5 %   O • 2.083 10.01.–13.01.
06.01.2014   41,5 % 25 % 9 % 4 % 10 % 5 % 5,5 %   O • 2.067 03.01.–06.01.
17.12.2013   42 % 27 % 9 % 4 % 9 % 4 % 5 %   O • 2.100 13.12.–16.12.
09.12.2013   42 % 25 % 10 % 4 % 9,5 % 4,5 % 5 %   O • 2.090 06.12.–09.12.
03.12.2013   42,5 % 24 % 11 % 3,5 % 9,5 % 4 % 5,5 %   O • 2.093 29.11.–02.12.
27.11.2013   40,5 % 25,5 % 10,5 % 4 % 9 % 4 % 6,5 %   O • 2.095 22.11.–25.11.
20.11.2013   41 % 25 % 10 % 4 % 9,5 % 4,5 % 6 %   O • 2.093 15.11.–18.11.
12.11.2013   42 % 25 % 11 % 4 % 8,5 % 4,5 % 5 %   O • 2.099 06.11.–11.11.
06.11.2013   42 % 26 % 10,5 % 3,5 % 9 % 4 % 5 %   O • 2.086 01.11.–04.11.
30.10.2013   42 % 26,5 % 10 % 3,5 % 9 % 4,5 % 4,5 %   O • 2.097 25.10.–28.10.
21.10.2013   43 % 26 % 10 % 3,5 % 8,5 % 4 % 5 %   O • 2.117 18.10.–21.10.
15.10.2013   42 % 26 % 9 % 4 % 9 % 6 % 4 %   O • 1.998 11.10.–14.10.
10.10.2013   43 % 25 % 9 % 4 % 9 % 2 % 1 % 5 % 2 %   O • 2.030 08.10.–09.10.
22.09.2013   41,5 % 25,7 % 8,4 % 4,8 % 8,6 % 2,2 % 1 % 4,7 % 3,1 %   Bundestagswahl
19.09.2013   38 % 28 % 8 % 6 % 9 % 2 % 1 % 5 % 3 %   O • 2.248 15.09.–18.09.
15.09.2013   38 % 27 % 11 % 4 % 8 % 3 % ? 4 % ?   O • 2.132 ??.09.–??.09.
09.09.2013   39 % 28 % 11 % 4 % 8 % 3 % 1 % 3 % 3 %   O • 2.132 06.09.–09.09.
02.09.2013   39 % 26 % 13 % 5 % 8 % 3 % 1 % 3 % 2 %   O • 2.135 30.08.–02.09.
26.08.2013   39 % 25 % 14 % 6 % 7 % 3 % 2 % 3 % 1 %   O • 2.128 23.08.–26.08.
20.08.2013   38 % 26 % 15 % 5 % 8 % 3 % 1 % 3 % 1 %   O • 2.122 16.08.–19.08.
13.08.2013   39 % 26 % 14 % 5 % 8 % 2 % 1 % 3 % 2 %   O • 2.121 09.08.–12.08.
05.08.2013   39 % 26 % 14 % 5 % 8 % 2 % 1 % 2 % 3 %   O • 2.131 02.08.–05.08.
30.07.2013   39 % 26 % 15 % 4 % 7 % 2 % 1 % 3 % 3 %   O • 2.128 26.07.–29.07.
23.07.2013   38 % 26 % 15 % 5 % 7 % 2 % 1 % 3 % 3 %   O • 2.132 19.07.–22.07.
16.07.2013   38 % 26 % 15 % 5 % 8 % 2 % 1 % 3 % 2 %   O • 2.122 12.07.–15.07.
09.07.2013   39 % 26 % 14 % 5 % 7 % 2 % 1 % 3 % 3 %   O • 2.125 05.07.–08.07.
01.07.2013   40 % 25 % 15 % 4 % 7 % 2 % 2 % 3 % 2 %   O • 2.121 28.06.–01.07.
24.06.2013   39 % 26 % 16 % 4 % 7 % 2 % 1 % 2 % 3 %   O • 2.129 21.06.–24.06.
19.06.2013   40 % 25 % 15 % 4 % 7 % 3 % 1 % 3 % 2 %   O • 2.317 14.06.–17.06.
11.06.2013   39 % 26 % 14 % 5 % 7 % 2 % 1 % 3 % 3 %   O • 2.005 07.06.–11.06.
04.06.2013   39 % 27 % 15 % 4 % 6 % 3 % 1 % 3 % 2 %   O • 2.633 31.05.–03.06.
01.06.2013   39 % 26 % 14 % 4 % 7 % 3 % 1 % 4 % 2 %   O • 1.025 27.05.–29.05.
27.05.2013   39 % 25 % 14 % 4 % 7 % 2 % 2 % 3 % 4 %   O • 2.019 24.05.–27.05.
22.05.2013   38 % 26 % 13 % 5 % 8 % 2 % 2 % 3 % 3 %   O • 2.009 17.05.–20.05.
17.05.2013   37 % 27 % 14 % 4 % 8 % 3 % 2 % 3 % 2 %   O • 1.023 14.05.–15.05.
13.05.2013   37 % 27 % 15 % 4 % 7 % 3 % 1 % 3 % 3 %   O • 2.015 10.05.–13.05.
07.05.2013   37 % 26 % 15 % 5 % 7 % 3 % 1 % 3 % 3 %   O • 2.044 03.05.–06.05.
29.04.2013   38 % 26 % 16 % 5 % 7 % 2 % 1 % 3 % 2 %   O • 2.000 26.04.–29.04.
22.04.2013   38 % 26 % 15 % 5 % 6 % 2 % 1 % 5 % 2 %   O • 2.030 19.04.–22.04.
21.04.2013   39 % 26 % 14 % 5 % 6 % 2 % 1 % 4 % 3 %   O • 1.030 18.04.–19.04.
16.04.2013   39 % 26 % 15 % 5 % 6 % 3 % 1 % 3 % 2 %   O • 2.018 12.04.–15.04.
09.04.2013   39 % 26 % 16 % 5 % 7 % 2 % 2 % 3 %   O • 2.018 05.04.–08.04.
25.03.2013   39 % 27 % 14 % 5 % 8 % 3 % 1 % 3 %   O • 2.006 22.03.–25.03.
22.03.2013   40 % 27 % 15 % 5 % 7 % 2 % 1 % 3 %   O • 2.011 15.03.–18.03.
12.03.2013   40 % 27 % 16 % 5 % 6 % 2 % 2 % 2 %   O • 2.022 08.03.–11.03.
04.03.2013   41 % 26 % 15 % 5 % 7 % 3 % 1 % 2 %   O • 2.006 01.03.–04.03.
26.02.2013   40 % 28 % 15 % 5 % 7 % 2 % 1 % 2 %   O • 2.028 22.02.–25.02.
19.02.2013   40 % 29 % 15 % 5 % 6 % 2 % 1 % 2 %   O • 2.023 15.02.–18.02.
12.02.2013   39 % 29 % 15 % 4 % 6 % 3 % 1 % 3 %   O • 2.011 08.02.–11.02.
04.02.2013   40 % 29 % 15 % 4 % 6 % 2 % 2 % 2 %   O • 2.017 01.02.–04.02.
29.01.2013   40 % 28 % 15 % 5 % 6 % 3 % 1 % 2 %   O • 2.012 25.01.–28.01.
22.01.2013   41 % 27 % 14 % 4 % 7 % 3 % 1 % 3 %   O • 1.997 18.01.–21.01.
15.01.2013   39 % 28 % 15 % 4 % 7 % 3 % 2 % 2 %   O • 2.023 11.01.–14.01.
07.01.2013   39 % 28 % 14 % 4 % 7 % 3 % 2 % 3 %   O • 2.026 04.01.–07.01.
18.12.2012   36 % 29 % 13 % 5 % 7 % 4 % 2 % 4 %   O • 2.012 14.12.–17.12.
11.12.2012   37 % 29 % 14 % 4 % 7 % 3 % 2 % 4 %   O • 2.020 07.12.–10.12.
04.12.2012   35 % 29 % 15 % 5 % 7 % 4 % 2 % 3 %   O • 2.022 30.11.–02.12.
27.11.2012   36 % 29 % 15 % 4 % 7 % 4 % 2 % 3 %   O • 2.041 23.11.–26.11.
19.11.2012   38 % 29 % 14 % 4 % 7 % 4 % 2 % 2 %   O • 2.019 16.11.–19.11.
13.11.2012   38 % 30 % 14 % 5 % 6 % 4 % 1 % 2 %   O • 2.023 09.11.–12.11.
06.11.2012   38 % 30 % 14 % 4 % 6 % 3 % 2 % 3 %   O • 2.003 02.11.–05.11.
30.10.2012   37 % 30 % 13 % 4 % 7 % 4 % 2 % 3 %   O • 2.034 26.10.–29.10.
23.10.2012   35 % 32 % 13 % 4 % 7 % 4 % 2 % 3 %   O • 2.019 19.10.–22.10.
15.10.2012   36 % 31 % 12 % 4 % 7 % 4 % 2 % 4 %   O • 2.013 12.10.–15.10.
09.10.2012   36 % 30 % 11 % 5 % 7 % 5 % 2 % 4 %   O • 2.006 05.10.–08.10.
02.10.2012   36 % 29 % 13 % 4 % 7 % 5 % 2 % 4 %   O • 2.008 28.09.–01.10.
25.09.2012   36 % 30 % 14 % 5 % 6 % 5 % 1 % 3 %   O • 2.030 21.09.–24.09.
20.09.2012   36 % 29 % 13 % 4 % 7 % 6 % 1 % 4 %   O • 2.039 14.09.–17.09.
11.09.2012   37 % 28 % 14 % 4 % 6 % 6 % 2 % 3 %   O • 2.029 07.09.–10.09.
04.09.2012   36 % 29 % 14 % 4 % 6 % 6 % 2 % 3 %   O • 2.014 31.08.–03.09.
28.08.2012   35 % 29 % 15 % 4 % 6 % 6 % 2 % 3 %   O • 2.020 24.08.–27.08.
21.08.2012   36 % 28 % 15 % 4 % 6 % 7 % 1 % 3 %   O • 2.034 17.08.–20.08.
14.08.2012   35 % 30 % 14 % 4 % 6 % 6 % 2 % 3 %   O • 2.031 10.08.–13.08.
07.08.2012   36 % 30 % 13 % 5 % 6 % 6 % 2 % 2 %   O • 2.046 03.08.–06.08.
02.08.2012   35 % 31 % 15 % 4 % 6 % 6 % 1 % 2 %   O • 2.020 27.07.–30.07.
24.07.2012   35 % 30 % 15 % 5 % 6 % 6 % 1 % 2 %   O • 2.037 20.07.–23.07.
17.07.2012   36 % 29 % 14 % 4 % 6 % 7 % 2 % 2 %   O • 2.020 13.07.–16.07.
10.07.2012   35 % 28 % 14 % 4 % 6 % 8 % 2 % ?   O • 2.041 06.07.–09.07.
03.07.2012   35 % 29 % 14 % 4 % 5 % 8 % 2 % 3 %   O • 2.021 29.06.–02.07.
25.06.2012   34 % 31 % 14 % 5 % 6 % 7 % 4 %   O • 1.987 22.06.–25.06.
19.06.2012   35 % 31 % 14 % 5 % 5 % 7 % 3 %   O • 2.023 15.06.–18.06.
12.06.2012   35 % 31 % 13 % 5 % 5 % 7 % 4 %   O • 1.999 08.06.–11.06.
05.06.2012   34 % 32 % 14 % 5 % 4 % 7 % 4 %   O • 2.019 01.06.–04.06.
29.05.2012   33 % 31 % 14 % 5 % 5 % 8 % 4 %   O • 2.027 25.05.–28.05.
22.05.2012   33 % 32 % 14 % 4 % 6 % 8 % 3 %   O • 2.013 18.05.–21.05.
15.05.2012   34 % 29 % 14 % 5 % 6 % 9 % 3 %   O • 2.031 11.05.–14.05.
09.05.2012   35 % 27 % 15 % 5 % 6 % 8 % 4 %   O • 2.015 04.05.–07.05.
01.05.2012   36 % 27 % 13 % 4 % 7 % 9 % 4 %   O • 2.098 27.04.–30.04.
23.04.2012   35 % 26 % 15 % 4 % 6 % 10 % 4 %   O • 2.097 20.04.–23.04.
16.04.2012   36 % 27 % 13 % 4 % 7 % 9 % 4 %   O • 2.075 13.04.–16.04.
11.04.2012   35 % 28 % 13 % 4 % 7 % 9 % 4 %   O • 2.100 06.04.–09.04.
03.04.2012   36 % 29 % 14 % 4 % 6 % 8 % 3 %   O • 2.085 30.03.–02.04.
27.03.2012   36 % 29 % 15 % 4 % 7 % 6 % 3 %   O • 2.099 23.03.–26.03.
27.09.2009   33,8 % 23,0 % 10,7 % 14,6 % 11,9 % 2,0 % 4,0 %   Bundestagswahl

Quellen: INSA-Meinungstrend bzw. (und auch Auftraggeber) bild.de und BILD, außer die Umfragen vom 21. April, 17. Mai, 1. Juni und 15. September 2013 (Quelle und Auftraggeber hier jeweils: FOCUS).
Durchführendes Institut war nach Angaben der INSA-Consulere GmbH bis Oktober 2013 die YouGov Deutschland AG, seitdem ist es nach diesen Angaben die INSA-Consulere GmbH. Erhoben wurden die Daten laut INSA-Consulere in allen Fällen im Online-Panel von YouGov Deutschland.
Das angegebene Datum ist der Tag der Veröffentlichung.


zusammengestellt von Matthias Cantow

Jonas Ohlsson Blog

Jonas Ohlsson Blog

Jonas Ohlsson Aden

Hi! I’m Jonas Ohlsson Aden, a senior frontend engineer living in Paris. I am passionate about the web and tech, and the way we’re making it better every day.

If you want to get in touch, please contact me.

You can find my open source projects on GitHub, and some other front end experiments on CodePen.

Searching in Hugo with lunr.js

Searching in Hugo with lunr.js

In this post I’ll show you how you can add easily add search to your Hugo static site using Hugo’s Scratch feature and the lunr.js JavaScript library on the client.

First we’ll need to create a JSON index of all our documents as part of our Hugo site generation process. Add a new document with hugo new search-index.md and set the type to search-index and the url the index.json in the frontmatter:

---
date: "2017-03-28T00:02:24+01:00"
type: "search-index"
url: "index.json"
---

Then add a new single.html layout to layouts/search-index with the content:

{{- $.Scratch.Add "index" slice -}}
{{- range where .Site.Pages "Type" "not in"  (slice "page" "search-index") -}}
{{- $.Scratch.Add "index" (dict "title" .Title "ref" .Permalink "tags" .Params.tags) -}}
{{- end -}}
{{- $.Scratch.Get "index" | jsonify -}}

If you run hugo you should see an index.json file with a list of all your posts in your public output folder.

Next we’ll need to load our index.json into lunr.js – add the lunr.js dependency to your project and then add some new JavaScript: