Skip to content

Commit

Permalink
add permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Feb 12, 2016
1 parent 6845413 commit 7353da6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div id="post">
<div class="title">
<h1 id="learning-javascript">Learning Javascript</h1>
<div class="date">February 2016, <a href="https://twitter.com/mafintosh">Mathias Buus</a></div>
<div class="date"><a href="/learning-javascript.html">February 2016, Mathias Buus</a></div>
</div>
<div><p>I am a big believer in learning by doing. Basically the best way to learn a new programming language, or any other skill for that matter, is to dive in, find a project you are interested in building and just start. Sure you&#39;ll get plenty of things wrong but everytime you do you&#39;ll have a better understanding of why things failed and be better equipped to not make the same mistakes later on.</p>
<p>Compared to other people I know I started out programming relatively late. Before starting university in 2006 I hadn&#39;t really done any kind of programming. The language of choice at my university was Java so that was the first language I started programming in.</p>
Expand Down
2 changes: 1 addition & 1 deletion learning-javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div id="post">
<div class="title">
<h1 id="learning-javascript">Learning Javascript</h1>
<div class="date">February 2016, <a href="https://twitter.com/mafintosh">Mathias Buus</a></div>
<div class="date"><a href="/learning-javascript.html">February 2016, Mathias Buus</a></div>
</div>
<div><p>I am a big believer in learning by doing. Basically the best way to learn a new programming language, or any other skill for that matter, is to dive in, find a project you are interested in building and just start. Sure you&#39;ll get plenty of things wrong but everytime you do you&#39;ll have a better understanding of why things failed and be better equipped to not make the same mistakes later on.</p>
<p>Compared to other people I know I started out programming relatively late. Before starting university in 2006 I hadn&#39;t really done any kind of programming. The language of choice at my university was Java so that was the first language I started programming in.</p>
Expand Down
2 changes: 1 addition & 1 deletion posts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ marked.setOptions({

posts.forEach(function (post, i) {
var source = marked(fs.readFileSync(path.join(__dirname, post.source), 'utf-8'))
var page = template.replace('{source}', source).replace('{date}', post.date).replace('{title}', post.title)
var link = post.source.replace('.md', '.html')
var page = template.replace('{source}', source).replace('{permalink}', '<a href="/' + link + '">' + post.date + ', Mathias Buus</a>').replace('{title}', post.title)

fs.writeFileSync(path.join(__dirname, '..', link), page)
if (i === 0) fs.writeFileSync(path.join(__dirname, '../index.html'), page)
Expand Down
2 changes: 1 addition & 1 deletion posts/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<div id="post">
<div class="title">
<h1 id="learning-javascript">{title}</h1>
<div class="date">{date}, <a href="https://twitter.com/mafintosh">Mathias Buus</a></div>
<div class="date">{permalink}</div>
</div>
<div>{source}</div>
</div>
Expand Down

0 comments on commit 7353da6

Please sign in to comment.