Category Archives: Projects

Full automated website experimentation with a static site generator

Static Site Generator workflow

Lately, we’ve see a lot of static site generator tools being created by a lot of talented developers. At first sigh, you might be skeptical about the usage you could take of it. Most of the time this is advertise for a blog usage, or just a single page website. But personally, I see a lot of potential in it, you can for example create a ad listing website with a form on each ad submitted by users, you can create a full e-commerce website or you can create a full tube site. For experimentation purpose, I’ve tried to create a full tube site in full static mode + tried to automatise the content generation at it’s maximum.

What really gives all values to static sites are the side online services that could enrich drastically all the power of a single website into a full dynamic and social website.

Also, what I find really amazing with static website are the following benefits that it could bring:

  • Cost effective
  • Crazy speed
  • SEO power that they can provide!
  • (Almost) no hacks possible

How is it possible?

That’s what I’d like to demonstrate into this article as my goal was basically to generate a full tube site without having to maintain anything and put everything on autopilot. I must say that I partially succeed as there are a few features that are missing but most of the work is there yet. In order to show the full potential, I will explain the steps I went through and mention all the tools I’ve been using.

Step 1 – Choose the right static site generator

To find out the most appropriate static site generator, I’ve went through a list of mandatory features I needed. (I won’t mentioned the standard ones that are all already provided in each and everyone static site generator such as post, slug, etc…)

  • Custom collection – This is useful for creating new type of content such as in my case “videos”. We aren’t dealing with posts but with a video collection which has some different attributes (lenght, video-url, etc…)
  • Event driven plugin – This will be really interesting for fetching/scrapping automatically content from another website/API, posting automatically to social networks, minimizing, etc…
  • Sorting of collections
  • Flexible theme system
  • Command line tools

The language didn’t matter a lot but as I was more PHP fluent, I was searching for one that would fit my needs in PHP, so, I went to staticgen website to find out the best generator for my experimental website.

At first, as I’ve been reading a lot about it the time being, I’ve looked toward Sculpin. Unfortunately, what stopped me was the fact that templates weren’t well implemented yet and that custom collection (custom types) was in beta. Another criteria was that the team wasn’t maintaining the project anymore.

Then, I looked into a pretty new one that was active and proposed exactly what I wanted: Spress. I really invite you to take a look at the documentation because it’s simple & easy to read. Then take a look at a few code example on their repository and you’re good to go! Kudo guy’s for the great work!

Step 2 – Creating the template

There was no open-source template for a tube site, I needed to create my own. To speed up the process, I could have gone with a good old standard Bootstrap framework and create my blocks quickly but I wanted to learn a new CSS framework with a more UX approach. In 2015, there was a CSS framework that was making a bit of noise called Semantic-UI as they have bundle not only a lot of UI elements that all made sense but also proposed a very flexible CSS theme system where you basically just set your variables in the config files with your customization and it will change the look & feel of all your UI elements while keeping UX consistency! Same as Spress, go give it a try!

Then a problem, came to me about some dynamic values that I would need to deal with:

  • Publish date and video duration – to get over it, I’ve used the following Javascript library: MomentJS
  • Video – VideoJS is from what I know the best fitted tool for getting videos working smoothly & also responsive.
  • Social Sharing buttons – Found this on Github and works pretty fine. (I could have done this on my own but decided to go with a library that does it)

Step 3 – External services

On a tube website, you usually want users to interact with your visitors by commenting, submitting videos, making some search or simply contact us. Here are the online tools that I’ve been using:

  • CommentingDisqus
  • Search videosTipusearch (a javascript search engine)
  • Video submissionZiggeo an online service where you can simply upload or even record your video.
  • Contact formGetSimpleForm

There is a tool that I’m missing, which is the number of page views per video. If you know any service that does just that, let me know by commenting!

Step 4 – Creating the template for Spress

After getting a fully functional template. I’ve took some examples from Spress templates and started to code my own template with all the static template I’ve been working with initially.

Step 5 – Fetching content

To fetch content & generate markdown files, I’ve used the Vid.me service which provides an API that have a bunch of information related to videos. The only thing I needed to do was the following:

  1. Retrieve from a vid.me channel all videos
  2. Download the videos & related images
  3. Generate the markdown file while injecting all the meta datas in it
  4. Run the command line for generating the website from the markdown files
  5. Put a cronjob on this script

Unfortunately, I haven’t been able to create a proper plugin for Spress with it, but it’s something that I have in my plans.

Step 6 – Wrap everything up

Once the fetcher put in place, I just needed to create a neat bash script for executing everything on a regular basis to fetch, generate and move created website to the appropriate server.

I’ve also included a plugin to minimize the HTML pages in order to speed up the delivery of the pages.

The result: Loopion Me which is a tube site dedicated to Funny Fails Videos.

Known issues:

  • Everything is currently hosted on a shared hosting called DreamHost which doesn’t allow to use enough RAM & CPU usage for generating all the pages (more than a thousands). So, either I increase my DremaHost hosting performance or Spress team needs to do efforts to reduce the amount of resources used by the page generation
  • In relation with above issue, Spress regenerate everything from start to end, which of course has the consequence to take longer to generate the full site. It would have been nice if like Hugo it was generating per update pages. They call it “partial builds”.
  • Ziggeo is providing the video through the API and I have a few submission but they aren’t published yet as I haven’t created a script to transform those incoming videos into a markdown file
  • Tags & Categories aren’t implemented

Conclusion

It was interesting to see how we can make a full website on autopilot, without any dynamic code and with a minimum security risk. Of course, the moderation is drastically missing there as you can see. But in a nutshell, the potential of delegation all dynamic work to others and not maintaining it almost at all. (I just receive a report of correct importation)

Few improvements that could bring a lot of value to your site:

  • Implement categories & tags
  • After each generated video page, send a Tweet and a Facebook post
  • Get a script to validate in one click the submitted videos on Ziggeo
  • Minimize CSS
  • Improve SEO semantics (by using Google guidelines for example)
  • Provide an authenticated (Basic Auth with SSL) API for creating native mobile apps
  • Compress images

 

Don’t hesitate to share your thoughts about this experiment. Or if you have any other suggested static site generator.

What I’ve learned by being more than 2 years a SCRUM master

In my previous company, I’ve been a SCRUM master (in addition to my main job: project manager) for more than 2 years and as you know, we always learn from our own errors and success. That’s why I started to list of few thoughts and things that I’d like to avoid in similar situation/role:

  • Setup tools as soon as possible early in the project in order to automatize a lot of development process. The more you do before starting, the better it will be.
  • Force your team to have some pause during your sprint in order to cool down on stuff that are important to team eyes (update continuous environment, upgrade a library, research, etc.).
  • Team must justify the need of this time and not only in front of SCRUM master but also to product owner and even beyond to stakeholders.
  • When working with a deported team, meet as soon as possible the team in order to give them a perfect vision of the project and share PO & SCRUM Master charisma.
  • Give visibility with transparency to stakeholders on a sprint or release basis by giving:
    • Budget status
    • Global vision of the project (no features! Otherwise it’s taken as granted) usually give business value
    • Milestone /sprints
    • Backlog priorities
    • Risks
  • Challenge stories without bringing your knowledge but by confronting the stories from previous sprints
  • Get a commitment from the team
  • Resolve impediments as soon as possible
    • Anticipate backup plans (ex: someone working on another story) at the same time
  • Give as much as possible visibility to all the team on the upcoming sprints
  • Give time to SCRUM team for reading/studying PO stories
  • If building an online application, have at least 1 x UI/UX designer in the team
  • Don’t rush on cutting edge technology or if it’s required, team needs training on those new technologies or simply change the whole team

So far this is what I’ve encountered along my experience and personal suggestion. I can possibly update the list in the future.

If you’d like me to develop a specific topic enunciated above, please shoot a comment and I will do my best to have a post on it.

Memegif share and create meme based on existing gif

The buzzing world around meme gif are going crazy and creativity provided by users are also pretty impressive. One of my friend recently launched a great website for sharing and creating memes based on existing gif that could be easily found on the internet.

In france we have a few famous websites that is getting more and more welknown by geeks and nerds called les joies du code who provide daily fun sentences attached to gifs.

In a different maner, Memegif let you take back those existing memes and suggest new sentences to match those gifs.
Currently, it’s only in French but I know it will be released soon in English and with couples of new features.

Go submit your meme gif on memegif.com and share it with your friends.