Make a table of contents for your blog

As far as I know there is no automatic way to keep a table of contents of your blog and present it in a separate page or in your “about” page. So I made a curl-script to get the titles and the links in a html or markdown file. So you have to go to your terminal and make your own command for your blog like this.

curl "[1-3]" | grep "<h2 class=\"post-title\"" | sed 's/<h2 class="post-title" itemprop="name" class="p-name">/   /g' >

If your blog has more pages than two, change the [1-3] accordingly. And change the domain in the url to the domain of your own blog. You will get something like this.

	   <a href="" itemprop="url" class="u-url">Spelen en knoeien met CSS</a>
	   <a href="" itemprop="url" class="u-url"> domein voordelig verhuizen</a>
	   <a href="" itemprop="url" class="u-url">Dialogen in Markdown</a>
	   <a href="" itemprop="url" class="u-url">Versleutel je e-mail dit jaar</a>
	   <a href="" itemprop="url" class="u-url">5G Gevaarlijk of niet?</a>
	   <a href="" itemprop="url" class="u-url">Bookaroo speelt kiekeboe</a>
	   <a href="" itemprop="url" class="u-url"><em>Ok, una</em> pregunta: Waarom nóg een sociaal medium?</a>
	   <a href="" itemprop="url" class="u-url">Een spookaccount bij Amazon</a>
	   <a href="" itemprop="url" class="u-url">Er zijn meer gratis e-books dan je denkt</a>
	   <a href="" itemprop="url" class="u-url">Alternatief nieuws: samen lekker zweren?</a>
	   <a href="" itemprop="url" class="u-url">Edward Snowden: de verrader verraden</a>
	   <a href="" itemprop="url" class="u-url">Bij blijven, of uitvliegen?</a>

You can change this the way you like it. If you want a list, just add a hyphen in the sed command like this: sed 's/<h2 class="post-title" itemprop="name" class="p-name">/ -/g'. You can put this text or list underneath a title like “Contents”, and there you have your table of contents. You have to update this every time you write a new article, though.