Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Trev
Trev

Posted on • Originally published attrevdev.ca on

     

Why I decided to go with Pelican

I tend to get excited when I explore something new and I've gotten into the habit of makingthis website the focus of a new obsession.

When I first wrote this website, it was with the brand new HTML/CSS/JavaScript skills that I had learned. Then I learned Python and re-wrote this website to be more dynamic with the use ofFlask. Months later I started learning reactive JavaScript front-ends and ended up re-working my porfolio into a single-page React application. I was mostly happy with it at that point, but I felt like I was still missing a couple of things.

I wanted a blog and didn't want to write one in JSX or do some sort of hacky markup rendering. The SEO wasn't quite up to snuff and I wanted something that would render really well in older/less accessible browsers. I also wanted something low maintenance and felt like React may have been overkill for a portfolio or a blog. Needless to say, it's easy to get carried away with new things.

Static site generators are fast, simple and secure

I had heard aboutstatic site generators while reading about them on Twitter and Mastodon. It ocurred to me that that static sites in general are wonderful and there are many reasons to use a static site generator:

  • They provide content management (like WordPress), but withoutany of the bloat.
  • They make it easy to write pages and posts in simple document formats (like Markdown).
  • They generatevery secure websites. It's just static content. There are no databases or backends to exploit outside of the web server itself.

After reading a few articles about the various static site generators out there, I decided to go withPelican for a few reasons. Pelican is very mature, written in Python , highly customizable/configurable and has many features included. For example, it generates pages based on category, date, author and tag. You can also leverage custom post/page metadata and pass it to jinja powered templates that are very clear and easy to reason with. To deploy them, all you need is FTP or shell access to a shared host provider. You could also easily deploy a static website forfree using something likeNetlify orGithub Pages.

To boot, there aredozens of plugins for Pelican. Since I enjoy Python, it wasn't all that challenging for me to write my own plugin for a niche situation like my VueJS poweredcomment system.

Pelican is also reallywell documented. This came in super handy while figuring out how to properly write a new theme and create special page templates like my home page and my portfolio category page.

The only drawback that I can think of is that Python is slower than some of the newer static site generators like Hugo. That being said, I'm still able to render this website in under half a second, and that's fast enough for me.

I'm super happy with what I've created with Pelican and am excited to share some of the tips & tricks I learned along the way. I don't think I'll be switching my website up any time soon.

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm a Linux nerd, web developer, gamer, drummer and music lover.
  • Location
    British Columbia, Canada
  • Education
    Self-Taught
  • Pronouns
    Vi/Vim
  • Work
    Full Snack Engineer for my provincial government
  • Joined

Trending onDEV CommunityHot

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp