Giter Site home page Giter Site logo

personal-website's Introduction

Personal website

This is the code for my personal website. It is a static website with a blog that is generated by a Python script that parses posts from plain Markdown files.

My first approach was to make the Python script an open source static website generator, but I have now decided to begin with making a tailored script for just my own website. The idea is that this will make the development of my own site a lot easier. The script can later on be modified to be available independently from the site.

Dependencies

Uses Python 3.5.1. Install dependencies with:

pip install -r requirements.txt

personal-website's People

Contributors

mhgbrg avatar

Stargazers

5l1v3r1 avatar

Watchers

 avatar

Forkers

5l1v3r1

personal-website's Issues

Design

Fix some better design instead of the current plain templates.

Recursive function for scanning posts folder

Right now only posts that are placed directly in the posts folder will be parsed by the script, all other files will be copied directly to the output folder without modification. It would be better if all markdown files in the posts folder got parsed, regardless of whether they are placed directly in the posts folder or not.

Update the Makefile and README

The Makefile is right now tied to my personal blog project. A new Makefile should be constructed that makes it easier for others to use the script.

The readme of the project should also be updated with some new information. Should the engine be tied to git and make it easy to set up with git repos (like I have it set up with my personal website), or should it not care about such things?

Links to next and previous post

When viewing a post you should have the possibility to navigate to the next and previous posts by links at the end of the post.

Rename functions

Right now the naming of functions is a bit funky. For example the parse_posts function should be named something along the lines of build_blog.

When renaming the functions the documentation should also be rewritten.

Redo url prefixes

The mechanics of url prefixes are pretty messy right now and needs to be redone.

Read entire file before splitting it up into different data segments

Right now the script splits the file into several different data segments (metadata, title, first paragraph, content) directly when reading it. It would probably be easier to just read the entire content of the file and then parse the string instead of splitting things up directly.

Include folders in input folder

In order to be able to link to local files like images, local files and folders need to be included in the parsing.

Maybe all markdown files can be treated specially, and all other files straight copied over?

Nicer urls

Use folders and index.html to make urls without file ending.

Migrate from Mustache to Handlebars

There seems to be some implementations of Handlebars for Python. It could be worth a switch to be able to check if an item is last in a list etc.

Template inheritance

The currently used implementation of mustache (Pystache) doesn't support template inheritance. This is not crucial, as it can be programmed around, but it would be nice to have.

Rename repository to personal-website

When I started this repo I was going to create a general script for generating static blogs. However, I've been thinking of dropping the general part and just focusing on creating a script that works for my personal website. The script for generating the blog could then be refactored and made independent from the rest of the site.

It feels like doing this would increase my productivity, since I wouldn't have to worry about making everything super general from the start.

Parse title and first paragraph separately from the rest of the content

In order to fix a good looking blog index I need to parse the title and the first paragraph of a post separately from the other content, so that I can use it in the templates.

Instead of reading the blog title from the metadata block the script should use the first line of the blog post.

Sort posts by date

Right now posts are sorted by alphabetical order. They should be sorted chronologically with the newest post first.

Make templates less tied to the script

Right now the templates are closely coupled with the generating script. This could be bad, depending on how the script should be used.

Should the script be used just as a blogging engine? If that's the case, you can say that you need templates X, Y and Z for this to work, and they should all be located in the templates folder. But if the script should be more general than that, it would make sense to decouple things a bit.

Better commit message when running make

Running make will create a new commit and push it to the output repository. Right now the message for the commit is just "Site regeneration". This should be updated to include some more relevant information.

Paginate the blog index

Right now I don't have that many blog posts, but for when I do a nice feature would be to have pagination.

Write your own Markdown parser

Right now the script is using Mistune to parse Markdown. To minimise dependencies (and learn more about regex) I should write my own Markdown parser.

The parser wouldn't have to be complete. Only the parts of Markdown that I use would have to be implemented.

Set up comment functionality for blog posts

Comments is a nice feature to have on a blog. Right now the blog is fully static, so the comments would introduce a dynamic feature on the page. The easiest way to do this would probably be to keep the site static, and to introduce comments through client-side JavaScript. I could have a server running somewhere that stores comments in a database and provides a simple REST-api for reading and posting comments.

Show tags in blog posts

You can supply tags to a blog post via metadata. These tags will be parsed to a list that should be displayed both in the blog post and in the blog index.

Ignore hidden files and folders on Windows

Right now the script ignores all files that starts with a dot ('.'). This will work for Mac OS X and Unix, but will break on Windows. Apparently, it is not trivial to perform a cross platform check for whether or not a file is hidden, so it will require some research.

Migrate CSS to Semantic UI

Writing my own CSS turned out to be less interesting than I thought. Since I want to focus more on the logic side of things, I have decided to use a CSS framework for taking care of the visual. A friend of mine recommended Semantic UI instead of Bootstrap or Foundation, so I'm going to try it out.

Refactor CSS

Some CSS rules are duplicated and found both in the index and the post file. This should be redone.

Look at docopt for parsing arguments

Right now I am using getopt from the Python standard library to parse command line arguments to the script. My brother recommended docopt instead.

docopt is a way of defining command line arguments by essentially writing usage instructions. It is a standard, and implementations of it is available for a whole bunch of different programming languages.

Write tests

Research the possibility of making the script testable.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.