From 75f0d296284e4b86ed5d536f89d90f453d77c19a Mon Sep 17 00:00:00 2001 From: Vicky Steeves Date: Fri, 14 Jul 2017 17:22:07 -0500 Subject: [PATCH] updated naming schema for posts, converted august 2016 post to html --- posts/{2014-oct23.html => 2014-10-23.html} | 2 +- posts/{2014-nov10.html => 2014-11-10.html} | 2 +- posts/{2014-dec18.html => 2014-12-18.html} | 2 +- posts/{2015-jan14.html => 2015-01-14.html} | 2 +- posts/{2015-feb12.html => 2015-02-12.html} | 2 +- posts/{2015-mar24.html => 2015-03-24.html} | 4 +- posts/{2015-apr14.html => 2015-04-14.html} | 2 +- posts/{2015-may1.html => 2015-05-01.html} | 2 +- posts/{2015-jun2.html => 2015-06-02.html} | 2 +- posts/{2015-aug14.html => 2015-08-14.html} | 2 +- posts/{2015-sep21.html => 2015-09-21.html} | 2 +- posts/{2015-oct10.html => 2015-10-10.html} | 2 +- posts/{2015-nov20.html => 2015-11-20.html} | 2 +- posts/{2015-dec16.html => 2015-12-16.html} | 2 +- posts/{2016-jan15.html => 2016-01-15.html} | 2 +- posts/{2016-feb16.html => 2016-02-16.html} | 3 +- posts/{2016-mar20.html => 2016-03-20.html} | 2 +- posts/{2016-apr20.html => 2016-04-20.html} | 2 +- posts/{2016-may15.html => 2016-05-15.html} | 2 +- posts/{2016-jun27.html => 2016-06-27.html} | 2 +- posts/{2016-jul30.html => 2016-07-30.html} | 2 +- posts/2016-08-17.html | 146 +++++++++++++++++++++ posts/{2016-oct22.html => 2016-10-22.html} | 2 +- posts/{2016-nov3.html => 2016-11-03.html} | 2 +- posts/2016-aug17.rst | 133 ------------------- posts/{2017-may26.html => 2017-05-26.html} | 2 +- posts/{2017-jul14.html => 2017-07-14.html} | 2 +- 27 files changed, 172 insertions(+), 160 deletions(-) rename posts/{2014-oct23.html => 2014-10-23.html} (99%) rename posts/{2014-nov10.html => 2014-11-10.html} (99%) rename posts/{2014-dec18.html => 2014-12-18.html} (99%) rename posts/{2015-jan14.html => 2015-01-14.html} (99%) rename posts/{2015-feb12.html => 2015-02-12.html} (99%) rename posts/{2015-mar24.html => 2015-03-24.html} (98%) rename posts/{2015-apr14.html => 2015-04-14.html} (99%) rename posts/{2015-may1.html => 2015-05-01.html} (99%) rename posts/{2015-jun2.html => 2015-06-02.html} (99%) rename posts/{2015-aug14.html => 2015-08-14.html} (99%) rename posts/{2015-sep21.html => 2015-09-21.html} (99%) rename posts/{2015-oct10.html => 2015-10-10.html} (99%) rename posts/{2015-nov20.html => 2015-11-20.html} (99%) rename posts/{2015-dec16.html => 2015-12-16.html} (99%) rename posts/{2016-jan15.html => 2016-01-15.html} (99%) rename posts/{2016-feb16.html => 2016-02-16.html} (98%) rename posts/{2016-mar20.html => 2016-03-20.html} (98%) rename posts/{2016-apr20.html => 2016-04-20.html} (98%) rename posts/{2016-may15.html => 2016-05-15.html} (99%) rename posts/{2016-jun27.html => 2016-06-27.html} (98%) rename posts/{2016-jul30.html => 2016-07-30.html} (99%) create mode 100644 posts/2016-08-17.html rename posts/{2016-oct22.html => 2016-10-22.html} (99%) rename posts/{2016-nov3.html => 2016-11-03.html} (98%) delete mode 100644 posts/2016-aug17.rst rename posts/{2017-may26.html => 2017-05-26.html} (99%) rename posts/{2017-jul14.html => 2017-07-14.html} (99%) diff --git a/posts/2014-oct23.html b/posts/2014-10-23.html similarity index 99% rename from posts/2014-oct23.html rename to posts/2014-10-23.html index f4b21d7..99e6d39 100644 --- a/posts/2014-oct23.html +++ b/posts/2014-10-23.html @@ -4,7 +4,7 @@ .. date: 2014-10-23 14:08:25 UTC-04:00 .. tags: ndsr, digital preservation .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-oct23.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-10-23.html .. description: .. type: text --> diff --git a/posts/2014-nov10.html b/posts/2014-11-10.html similarity index 99% rename from posts/2014-nov10.html rename to posts/2014-11-10.html index 8bca30a..b7752c2 100644 --- a/posts/2014-nov10.html +++ b/posts/2014-11-10.html @@ -4,7 +4,7 @@ .. date: 2014-11-10 14:08:25 UTC-04:00 .. tags: ndsr, assessment, professional development .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-nov10.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-11-10.html .. description: .. type: text --> diff --git a/posts/2014-dec18.html b/posts/2014-12-18.html similarity index 99% rename from posts/2014-dec18.html rename to posts/2014-12-18.html index 7d62c55..162263e 100644 --- a/posts/2014-dec18.html +++ b/posts/2014-12-18.html @@ -4,7 +4,7 @@ .. date: 2014-12-18 14:08:25 UTC-04:00 .. tags: ndsr, amnh, personal .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-dec18.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2014-12-18.html .. description: .. type: text --> diff --git a/posts/2015-jan14.html b/posts/2015-01-14.html similarity index 99% rename from posts/2015-jan14.html rename to posts/2015-01-14.html index bac1f97..4db71ec 100644 --- a/posts/2015-jan14.html +++ b/posts/2015-01-14.html @@ -4,7 +4,7 @@ .. date: 2015-01-14 14:08:25 UTC-04:00 .. tags: ndsr, advocacy .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-jan14.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-01-14.html .. description: .. type: text --> diff --git a/posts/2015-feb12.html b/posts/2015-02-12.html similarity index 99% rename from posts/2015-feb12.html rename to posts/2015-02-12.html index 767d606..25e2477 100644 --- a/posts/2015-feb12.html +++ b/posts/2015-02-12.html @@ -4,7 +4,7 @@ .. date: 2015-02-12 14:08:25 UTC-04:00 .. tags: conference report, professional development, ndsr .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-feb12.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-02-12.html .. description: .. type: text --> diff --git a/posts/2015-mar24.html b/posts/2015-03-24.html similarity index 98% rename from posts/2015-mar24.html rename to posts/2015-03-24.html index dd9570f..58ee771 100644 --- a/posts/2015-mar24.html +++ b/posts/2015-03-24.html @@ -4,7 +4,7 @@ .. date: 2015-03-24 14:08:25 UTC-04:00 .. tags: ndsr, publication .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-mar24.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-03-24.html .. description: .. type: text --> @@ -13,8 +13,6 @@ - - diff --git a/posts/2015-apr14.html b/posts/2015-04-14.html similarity index 99% rename from posts/2015-apr14.html rename to posts/2015-04-14.html index 34f833e..676550f 100644 --- a/posts/2015-apr14.html +++ b/posts/2015-04-14.html @@ -4,7 +4,7 @@ .. date: 2015-04-14 14:08:25 UTC-04:00 .. tags: ndsr, amnh .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-apr14.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-04-14.html .. description: .. type: text --> diff --git a/posts/2015-may1.html b/posts/2015-05-01.html similarity index 99% rename from posts/2015-may1.html rename to posts/2015-05-01.html index 62cebc4..715cea1 100644 --- a/posts/2015-may1.html +++ b/posts/2015-05-01.html @@ -4,7 +4,7 @@ .. date: 2015-05-01 14:08:25 UTC-04:00 .. tags: ndsr .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-may1.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-05-01.html .. description: .. type: text --> diff --git a/posts/2015-jun2.html b/posts/2015-06-02.html similarity index 99% rename from posts/2015-jun2.html rename to posts/2015-06-02.html index d1964e6..ce64aa2 100644 --- a/posts/2015-jun2.html +++ b/posts/2015-06-02.html @@ -4,7 +4,7 @@ .. date: 2015-06-02 14:08:25 UTC-04:00 .. tags: ndsr .. category: NDSR-Blog -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-jun2.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-06-02.html .. description: .. type: text --> diff --git a/posts/2015-aug14.html b/posts/2015-08-14.html similarity index 99% rename from posts/2015-aug14.html rename to posts/2015-08-14.html index 9ad5af5..0fd37cb 100644 --- a/posts/2015-aug14.html +++ b/posts/2015-08-14.html @@ -4,7 +4,7 @@ .. date: 2015-08-14 14:08:25 UTC-04:00 .. tags: ndsr, digital preservation, amnh, publication .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-aug14.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-08-14.html .. description: .. type: text --> diff --git a/posts/2015-sep21.html b/posts/2015-09-21.html similarity index 99% rename from posts/2015-sep21.html rename to posts/2015-09-21.html index d402d36..3b9cc36 100644 --- a/posts/2015-sep21.html +++ b/posts/2015-09-21.html @@ -4,7 +4,7 @@ .. date: 2015-09-21 14:08:25 UTC-04:00 .. tags: nyu, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-sep21.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-09-21.html .. description: .. type: text --> diff --git a/posts/2015-oct10.html b/posts/2015-10-10.html similarity index 99% rename from posts/2015-oct10.html rename to posts/2015-10-10.html index 2fcdff0..2ae40e0 100644 --- a/posts/2015-oct10.html +++ b/posts/2015-10-10.html @@ -4,7 +4,7 @@ .. date: 2015-10-10 14:08:25 UTC-04:00 .. tags: conference report, nyu .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-oct10.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-10-10.html .. description: .. type: text --> diff --git a/posts/2015-nov20.html b/posts/2015-11-20.html similarity index 99% rename from posts/2015-nov20.html rename to posts/2015-11-20.html index 7f27701..389d746 100644 --- a/posts/2015-nov20.html +++ b/posts/2015-11-20.html @@ -4,7 +4,7 @@ .. date: 2015-11-20 14:08:25 UTC-04:00 .. tags: conference report, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-nov20.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-11-20.html .. description: .. type: text --> diff --git a/posts/2015-dec16.html b/posts/2015-12-16.html similarity index 99% rename from posts/2015-dec16.html rename to posts/2015-12-16.html index e07bffd..b0d9830 100644 --- a/posts/2015-dec16.html +++ b/posts/2015-12-16.html @@ -4,7 +4,7 @@ .. date: 2015-12-16 14:08:25 UTC-04:00 .. tags: presentation, conference report, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-dec16.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2015-12-16.html .. description: .. type: text --> diff --git a/posts/2016-jan15.html b/posts/2016-01-15.html similarity index 99% rename from posts/2016-jan15.html rename to posts/2016-01-15.html index 33bab62..4813e0e 100644 --- a/posts/2016-jan15.html +++ b/posts/2016-01-15.html @@ -4,7 +4,7 @@ .. date: 2016-01-15 14:08:25 UTC-04:00 .. tags: nyu, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-jan15.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-01-15.html .. description: .. type: text --> diff --git a/posts/2016-feb16.html b/posts/2016-02-16.html similarity index 98% rename from posts/2016-feb16.html rename to posts/2016-02-16.html index 49429fc..e5161a9 100644 --- a/posts/2016-feb16.html +++ b/posts/2016-02-16.html @@ -4,7 +4,7 @@ .. date: 2016-02-16 14:08:25 UTC-04:00 .. tags: nyu .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-feb16.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-02-16.html .. description: .. type: text --> @@ -12,6 +12,7 @@ +

This past week, February 8-12th, was Love Your Data Week!! Is there a more perfect holiday for data librarians, especially right before Valentine's Day??

#LYD16 was a social media event coordinated officially by 27 academic and research institutions, of which both NYU Data Services and NYU Health Sciences Library were a part. The idea behind this social media blitz was to raise awareness of research data management and the support/resources for RDM at each individual institution.

diff --git a/posts/2016-mar20.html b/posts/2016-03-20.html similarity index 98% rename from posts/2016-mar20.html rename to posts/2016-03-20.html index 5b36e4f..238882f 100644 --- a/posts/2016-mar20.html +++ b/posts/2016-03-20.html @@ -4,7 +4,7 @@ .. date: 2016-03-20 14:08:25 UTC-04:00 .. tags: nyu, ReproZip .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-mar20.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-03-20.html .. description: .. type: text --> diff --git a/posts/2016-apr20.html b/posts/2016-04-20.html similarity index 98% rename from posts/2016-apr20.html rename to posts/2016-04-20.html index 862819b..a3f038e 100644 --- a/posts/2016-apr20.html +++ b/posts/2016-04-20.html @@ -4,7 +4,7 @@ .. date: 2016-04-20 14:08:25 UTC-04:00 .. tags: conference report, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-apr20.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-04-20.html .. description: .. type: text --> diff --git a/posts/2016-may15.html b/posts/2016-05-15.html similarity index 99% rename from posts/2016-may15.html rename to posts/2016-05-15.html index cd00e0a..0c59083 100644 --- a/posts/2016-may15.html +++ b/posts/2016-05-15.html @@ -4,7 +4,7 @@ .. date: 2016-05-15 14:08:25 UTC-04:00 .. tags: conference report, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-may15.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-05-15.html .. description: .. type: text --> diff --git a/posts/2016-jun27.html b/posts/2016-06-27.html similarity index 98% rename from posts/2016-jun27.html rename to posts/2016-06-27.html index d94d5a1..8e43914 100644 --- a/posts/2016-jun27.html +++ b/posts/2016-06-27.html @@ -4,7 +4,7 @@ .. date: 2016-06-27 14:08:25 UTC-04:00 .. tags: personal .. category: Personal Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-jun27.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-06-27.html .. description: .. type: text --> diff --git a/posts/2016-jul30.html b/posts/2016-07-30.html similarity index 99% rename from posts/2016-jul30.html rename to posts/2016-07-30.html index d19d41d..432ab2c 100644 --- a/posts/2016-jul30.html +++ b/posts/2016-07-30.html @@ -4,7 +4,7 @@ .. date: 2016-07-30 14:08:25 UTC-04:00 .. tags: conference report, professional development .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-jul30.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-07-30.html .. description: .. type: text --> diff --git a/posts/2016-08-17.html b/posts/2016-08-17.html new file mode 100644 index 0000000..3b1f2d6 --- /dev/null +++ b/posts/2016-08-17.html @@ -0,0 +1,146 @@ + + + + + + + + +

This might be a shock to many of you (except my boyfriend and his roommate, who have been giving me sh*t about this forever), but before today I actually hard-coded my website. This meant that every time I updated a post, changed my resume, etc., I had to hard code the changes and the ripple effects.

+ +

What was I thinking. Honestly. You can look at how painful it was here on GitLab. I kept it as a reminder and in case I severely messed up this whole Nikola thing, which I'm going to explain in the bulk of this post.

+ + + +

I actually made a lot of changes, starting with dumping my old website host, Bluehost. I had decided to register my domain names on Google Domains, which was not only half the cost of Bluehost -- $50/year on Bluehost for 2 domains, and $24/year on Google Domains for the same -- but it provided an easier interface to fix settings, play with email stuff (you can get at me via vicky[AT]vickysteeves[DOT]com so cool!!), and have domains connected to a Google account, which is just convenient. It's all around really great. If Google retires this, I will honestly throw a fit.

+ +

So after I had made the change from Bluehost to Google Domains, I made the switch from Bluehost's servers to GitLab. I exported my site (which was still just hard-coded, even back then) and uploaded to a private GitLab repository. I wanted to make it look pretty before I made it public, as I was pretty embarrassed that I still hard-coded my site, especially given I have a C.S. degree... shame.

+ +

So I also knew that I couldn't hard-code forever. It was such a hassle to update everything manually every time I wanted to write a post. Rémi pointed me towards static site generators, which I had never really heard of before. This introduction to SSGs was really helpful to me as I decided to go with this option. Some of the most obvious advantages are:

+ + + +

I eventually opened up an issue in my GitLab repo that put pressure on me to make this change happen. Static Gen was an invaluable resource to me as I narrowed my choices down to eventually include Nikola. Nikola is actually #26 on this list, which ranks SSGs by the number of stars it has on GitLab, but it was a really obvious choice for me. I had a few requirements for a site generator:

+ + + +

I narrowed it down to Pelican, Hugo, Lektor, and Nikola. Each had their obvious advantages: Pelican is really simple to build, Hugo is really fast and allows users to define their own metadata, Lektor has built-in dependency tracking, but Nikola stood out to me for a few reasons: built-in Boostrap & Bootswatch support, amazing plugins (including one to send your posts to the Internet Archive!), a really active user and development community, translatable (like French for my boyfriend's parents, who like to Google me :P), python 2 and 3 compatiable, and beyond easy to build.

+ +

The next step was to actually take the plunge and develop it. Because Nikola was developed with a "blog first" mentality, I had to do some interesting things with the configuration file to make sure I could my homepage and resume page, and THEN my blog on it's own separate page. Nikola's developers have a good guide for doing this. The default setup for pages and posts in Nikola's conf.py file is::

+ +
POSTS = (
+	("posts/*.rst", "posts", "post.tmpl"),
+	("posts/*.txt", "posts", "post.tmpl"),
+	("posts/*.html", "posts", "post.tmpl"),
+	)
+
+	PAGES = (
+	    ("stories/*.rst", "stories", "story.tmpl"),
+	    ("stories/*.txt", "stories", "story.tmpl"),
+	    ("stories/*.html", "stories", "story.tmpl"),
+	)
+

We have to modify this to look like::

+
POSTS = ()
+
+	PAGES = (
+	("stories/*.rst", "", "story.tmpl"),
+	("stories/*.txt", "", "story.tmpl"),
+	("stories/*.html", "", "story.tmpl"),
+	)
+
+	INDEX_PATH = "blog"
+ +

And then add the pages in the folder called "stories" which is basically Nikola-speak for just regular web pages. After I was done adding the pages I wanted (basically a home page and a resume page, basically copy-pasting what I had on my original site), I reviewed the POSTS to look like this::

+ +
POSTS = (
+	    ("posts/*.rst", "blog", "post.tmpl"),
+	    ("posts/*.txt", "blog", "post.tmpl"),
+	    ("posts/*.html", "blog", "post.tmpl"),
+	)
+ +

And all the posts would be indexed on a new page called "Blog" which I then added to my navigation, along with my recently added pages.

+ +

After getting the navigation and blog configured the way I wanted, the most labour-intensive part of the process began: porting over all my blog posts. Another amazing thing about Nikola, and another reason I chose it, is because users can write blog posts in whatever they want. This is my list from my conf.py file::

+ +
COMPILERS = {
+	"rest": ('.rst', '.txt'), #reStructured Text
+	"markdown": ('.md', '.mdown', '.markdown'), 
+	"textile": ('.textile',),
+	"txt2tags": ('.t2t',),
+	"bbcode": ('.bb',),
+	"wiki": ('.wiki',),
+	"ipynb": ('.ipynb',), #iPython notebooks
+	"html": ('.html', '.htm'),
+	)
+ +

This worked out excellently for me because all my previous posts were written in HTML (again, I was being a n00b and hard-coding these all myself). I could literally copy and paste the body of the post, and clean up what needed to be cleaned. This included: fixing links to images and other parts of my website, and adding in the metadata that Nikola required. I had to fix my posts to follow this structure, which was super easy::

+ +
<!--
+	.. title: Title of the Post!
+	.. slug: pretty-url-slug
+	.. date: 20XX-XX-XX
+	.. tags: 
+	.. category: 
+	.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/{POST FILE NAME}
+	.. description: 
+	.. type: text
+	-->
+	<!DOCTYPE html>
+	<html lang="en">
+	  <body>
+	      <!--POST BODY-->
+	  </body>
+	</html>`
+ +

After the posts were all successfully modified to the Nikola schema, it was a simple matter of cleaning up the aesthetics. This was done by copy-pasting the templates from Nikola into my site's directory, and then editing them -- the same as creating a child-theme in WordPress. By doing this, I could modify the way my site rendered dynamically. My favourite modification I made (and again, thanks to Rémi for the suggestion) was adding the GitLab source link on each of my blog posts. Each of my posts has this cute little GitLab image

+ +

image

+ +

at the far-right to the title, that, if clicked, brings the user to the source hosted on GitLab.

+ +

This allows my readers to go directly to the source of my post to make corrections, pull requests, etc. I did this by editing the post_header.tmpl file. I copied it into a folder in my site's directory called "templates" which has a long file path: personal-website/themes/custom/templates. Before editing, it just asked the post for it's metadata after displaying the title::

+ +
<%def name="html_post_header()">
+	    <header>
+		${html_title()}
+		<div class="metadata">
+

After editing, the image was added to the right of the title. The code looks like this::

+
<%def name="html_post_header()">
+	<header>
+	{* GITLAB IMAGE WITH SOURCE LINK *}
+	<a href="${post.meta('link')}" id="sourcelink"><img src="../../images/gitlab.png" height="5%" width="5%" style="float:right;"></a>
+	    ${html_title()}
+	    <div class="metadata">
+ +

This works by querying the post's metadata (which you saw above in the HTML template snippet) for the "link," which goes back to the GitLab source. I added some inline CSS (the style="") which isn't the cleanest, but hey -- it works, and if you want to fix it, make a pull request ;)

+ +

After adding this feature and cleaning up the aesthetics, Rémi made the excellent point that I should use Travis CI to make sure my site updated every time a commit was made, either through Git or on GitLab natively (PR or in-browser editing). He actually ended up writing my build file because engineers and he's super smart and did it in 2 seconds when it would have taken me a day.

+ +

This is my first post written and published using pure Nikola. I wrote it in reStructured Text format, which honestly seems like the biggest challenge in switching. After writing HTML for so long, it's an easy habit to get into. This is much nicer because it doesn't require tags for literally everything.

+ +

I hope this helps anyone else looking to make the switch into static site generators!

+ + + diff --git a/posts/2016-oct22.html b/posts/2016-10-22.html similarity index 99% rename from posts/2016-oct22.html rename to posts/2016-10-22.html index da3e5d8..106b550 100644 --- a/posts/2016-oct22.html +++ b/posts/2016-10-22.html @@ -4,7 +4,7 @@ .. date: 2016-10-22 14:08:25 UTC-04:00 .. tags: conference report, ndsr, personal, presentation, publication .. category: Professional Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-oct22.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-10-22.html .. description: .. type: text --> diff --git a/posts/2016-nov3.html b/posts/2016-11-03.html similarity index 98% rename from posts/2016-nov3.html rename to posts/2016-11-03.html index cfcd85f..3183559 100644 --- a/posts/2016-nov3.html +++ b/posts/2016-11-03.html @@ -4,7 +4,7 @@ .. date: 2016-11-03 14:08:25 UTC-04:00 .. tags: personal .. category: Personal Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-nov3.html +.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-11-03.html .. description: .. type: text --> diff --git a/posts/2016-aug17.rst b/posts/2016-aug17.rst deleted file mode 100644 index af456ab..0000000 --- a/posts/2016-aug17.rst +++ /dev/null @@ -1,133 +0,0 @@ -.. title: Switching to Nikola! -.. slug: switching-to-nikola -.. date: 2016-08-17 17:10:00 UTC-04:00 -.. tags: development, metapost -.. category: Personal Life -.. link: https://gitlab.com/VickySteeves/personal-website/blob/master/posts/2016-aug17.rst -.. description: -.. type: text - -This might be a shock to many of you (except my boyfriend and his roommate, who have been giving me sh*t about this forever), but before today I actually hard-coded my website. This meant that every time I updated a post, changed my resume, etc., I had to hard code the changes and the ripple effects. - -What was I thinking. Honestly. You can look at how painful it was `here `_ on GitLab. I kept it as a reminder and in case I severely messed up this whole Nikola thing, which I'm going to explain in the bulk of this post. - -.. TEASER_END - -I actually made a lot of changes, starting with dumping my old website host, Bluehost. I had decided to register my domain names on Google Domains, which was not only half the cost of Bluehost -- \$50/year on Bluehost for 2 domains, and \$24/year on Google Domains for the same -- but it provided an easier interface to fix settings, play with email stuff (you can get at me via `vicky[AT]vickysteeves[DOT]com `_! so cool!!), and have domains connected to a Google account, which is just convenient. It's all around really great. If Google retires this, I will honestly throw a fit. - -So after I had made the change from Bluehost to Google Domains, I made the switch from Bluehost's servers to GitLab. I exported my site (which was still just hard-coded, even back then) and uploaded to a private GitLab repository. I wanted to make it look pretty before I made it public, as I was pretty embarrassed that I **still** hard-coded my site, especially given I have a C.S. degree... *shame*. - -So I also knew that I couldn't hard-code forever. It was such a hassle to update everything manually every time I wanted to write a post. Rémi pointed me towards static site generators, which I had never really heard of before. `This introduction to SSGs `_ was really helpful to me as I decided to go with this option. Some of the most obvious advantages are: - -* Completely open-source development - + The static site generators I considered are fully open source, which lets people not only develop great themes and plugins, but support each other in building/using/customizing the generator. - + Anyone can file an issue on my site or blog posts (or help me do development -- shoutout to `Rémi `_ for that already) when something is wrong or to add a correction with a pull request. -* Easy version control and integration with GitLab, which I had already chosen to host my website. -* Speed: static generators are usually much faster than a full-blown content mangement system (CMS) like WordPress or the like, because it doesn't rely on a database and server configuration. -* Ease of Use: I don't have to deal with a server, which I don't really need. I just need to serve up my HTML pages! And if need be, I can migrate the site to something else -- as a data management librarian, I always have to have an exit strategy ;) - -I eventually opened up an `issue `_ in my GitLab repo that put pressure on me to make this change happen. `Static Gen `_ was an invaluable resource to me as I narrowed my choices down to eventually include Nikola. Nikola is actually #26 on this list, which ranks SSGs by the number of stars it has on GitLab, but it was a really obvious choice for me. I had a few requirements for a site generator: - -* Support `Bootstrap `_ themes/JS, which I love and already had been using. -* Simple blogging framework -* Preferably python based - -I narrowed it down to `Pelican `_, `Hugo `_, `Lektor `_, and `Nikola `_. Each had their obvious advantages: Pelican is really simple to build, Hugo is really fast and allows users to define their own metadata, Lektor has built-in dependency tracking, but Nikola stood out to me for a few reasons: built-in Boostrap & `Bootswatch `_ support, amazing plugins (including one to `send your posts to the Internet Archive `_!), a really active user and development community, translatable (like French for my boyfriend's parents, who like to Google me :P), python 2 and 3 compatiable, and beyond easy to build. - -The next step was to actually take the plunge and develop it. Because Nikola was developed with a "blog first" mentality, I had to do some interesting things with the configuration file to make sure I could my homepage and resume page, and THEN my blog on it's own separate page. Nikola's developers have a `good guide `_ for doing this. The default setup for pages and posts in Nikola's conf.py file is::: - - POSTS = ( - ("posts/*.rst", "posts", "post.tmpl"), - ("posts/*.txt", "posts", "post.tmpl"), - ("posts/*.html", "posts", "post.tmpl"), - ) - - PAGES = ( - ("stories/*.rst", "stories", "story.tmpl"), - ("stories/*.txt", "stories", "story.tmpl"), - ("stories/*.html", "stories", "story.tmpl"), - ) - -We have to modify this to look like::: - - POSTS = () - - PAGES = ( - ("stories/*.rst", "", "story.tmpl"), - ("stories/*.txt", "", "story.tmpl"), - ("stories/*.html", "", "story.tmpl"), - ) - - INDEX_PATH = "blog" - -And then add the pages in the folder called "stories" which is basically Nikola-speak for just regular web pages. After I was done adding the pages I wanted (basically a home page and a resume page, basically copy-pasting what I had on my original site), I reviewed the POSTS to look like this::: - - POSTS = ( - ("posts/*.rst", "blog", "post.tmpl"), - ("posts/*.txt", "blog", "post.tmpl"), - ("posts/*.html", "blog", "post.tmpl"), - ) - -And all the posts would be indexed on a new page called "Blog" which I then added to my navigation, along with my recently added pages. - -After getting the navigation and blog configured the way I wanted, the most labour-intensive part of the process began: porting over all my blog posts. Another amazing thing about Nikola, and another reason I chose it, is because users can write blog posts in whatever they want. This is my list from my conf.py file::: - - COMPILERS = { - "rest": ('.rst', '.txt'), #reStructured Text - "markdown": ('.md', '.mdown', '.markdown'), - "textile": ('.textile',), - "txt2tags": ('.t2t',), - "bbcode": ('.bb',), - "wiki": ('.wiki',), - "ipynb": ('.ipynb',), #iPython notebooks - "html": ('.html', '.htm'), - ) - -This worked out *excellently* for me because all my previous posts were written in HTML (again, I was being a n00b and hard-coding these all myself). I could literally copy and paste the body of the post, and clean up what needed to be cleaned. This included: fixing links to images and other parts of my website, and adding in the metadata that Nikola required. I had to fix my posts to follow this structure, which was super easy::: - - - - - - - - ` - -After the posts were all successfully modified to the Nikola schema, it was a simple matter of cleaning up the aesthetics. This was done by copy-pasting the templates from Nikola into my site's directory, and then editing them -- the same as creating a child-theme in WordPress. By doing this, I could modify the way my site rendered dynamically. My favourite modification I made (and again, thanks to Rémi for the suggestion) was adding the GitLab source link on each of my blog posts. Each of my posts has this cute little GitLab image - -.. image:: ../../images/gitlab.png - -at the far-right to the title, that, if clicked, brings the user to the source hosted on GitLab. - -This allows my readers to go directly to the source of my post to make corrections, pull requests, etc. I did this by editing the post_header.tmpl file. I copied it into a folder in my site's directory called "templates" which has a long file path: personal-website/themes/custom/templates. Before editing, it just asked the post for it's metadata after displaying the title::: - - <%def name="html_post_header()"> -
- ${html_title()} -