The second coding period for GSoC’20 is now over. I am excited to share that the first part of my project is now over. I have finally finished porting kde.org to hugo and am now working on a refresh for the Season of KDE Website

Porting kde.org allowed for easy resuability of code and helped in removing a lot of extra files. This code reusability can be achieved in two ways - shortcodes and layouts.

Shortcodes

Shortcodes are code snippets that can be used in markdown content that can render some predefined content. Simply put, shortcodes are small reusable code snippets that provide some functionality. For instance this is a builtin shortcode to embed a youtube video.

{{< youtube trJ0Q-wsna4 >}}

So much better than using an iframe everytime, right?

Hugo doesn’t restrict us to to the builtin shortcodes. We can have our own custom shortcodes that can themselves some nested shortcodes inside.

I created a simple shortcode for the ability to include a file in a page.

{{- if eq (.Get 1) "markdown" -}}
{{with .Site.GetPage (.Get 0) }}

    {{- .Content | markdownify -}}

{{- end -}}
{{- else -}}

{{with .Site.GetPage (.Get 0) }}

    {{- .Content  -}}

{{- end -}}
{{- end -}}

This simple shortcode allows to include a file in any page and can render it in either html or markdown!

{{% include "/includes/about_kde.html" %}}

Layouts

Layouts are more common in other tools. They basically act as template and can have blocks of content be inserted into them. Layouts were useful to create pages that were only slightly different.


I also managed to automate a lot of work using some simple regex and unix commands like find , sed and awk.

This past week I also started working on the Season of KDE website. I set up the project locally to use mykde (KDE’s WIP OAuth Identity Service) and made some UI improvements.

Current Season of KDE Website
Current Season of KDE Website.


New Season of KDE Website
New Season of KDE Website.


I will continue to add more features and improvements to the website in the coming weeks :)

About my Project

The project involves improving KDE Web Infrastructure. KDE has a lot of websites and some of them like the main website could use an update.

The first part of the project involves porting kde.org to use Hugo- A go based static site generator. kde.org is very old and thus contains a lot of pages. This project would involve porting most of the pages to markdown so as to make the website faster and easier to develop.

The second part of the project involves updating Season of KDE website. The goal is to use more modern tooling and add some new features. This project is a part of the transition of KDE websites from LDAP to OAuth based authentication. OAuth is a much more modern approach to authentication and would solve some headaches with the current authentication system.

Current Working Repository: kde.org repo

If you would to join in, Say Hi at #kde-www on irc or telegram.