Think About Your Audience

Think About Your Audience

Hi everyone!! Welcome back to the third article in my series of articles as an Outreachy intern with Wagtail.

The Wagtail Community

Wagtail is a free and open-source Content Management System (CMS) written in Python and built on the Django framework. The CMS can be used to create beautiful websites which can be edited and customized to suit your needs. It is great for creating blogs, marketing websites, etc. Wagtail is used by top organizations like Google, NASA and MIT.

A screenshot of NASA website built with Wagtail CMS

The Wagtail community has people from different backgrounds and expertise that contribute to making the CMS better. If you're interested in contributing to the project, there is always something for you to work on regardless of your skills and level. You could be a frontend developer like me or a backend developer that uses Django or a technical writer. There is always something you can help with. The community is very friendly and welcoming that once you join, you'll definitely want to stay😃

How is Wagtail different from other CMS

Wagtail gives the users (developers or non-developers) the ability to build accessible, beautiful and responsive websites that are simple to maintain.

It's different from other CMSs because:

  1. It is more secure and that's because it's built upon the Django framework and adheres to strict security standards.

  2. It gives developers the flexibility to build websites with complex features.

  3. It is lightweight which increases its performance.

With all these advantages, Wagtail is the great whether when you're building a simple blog website or you're building something as complex as a TechEd website. Here is a link to different websites built with Wagtail CMS.

How to join Wagtail as a new contributor

Wagtail has a large community of contributors who are passionate about open-source and making Wagtail one of the best CMS. Communication is mostly done on Slack. As a new contributor, after joining the Wagtail Slack channel, you are to join the #new_contributors channel. This is where useful information and links are being posted for those that just joined. You can check the pinned messages on the channel for links for guides on installing the Wagtail CMS and Wagtail Bakerydemo on your local pc.

For Windows setup, Juliet Adeboye wrote an article on how to setup bakerydemo on your Windows local machine. When you're done with the setup, you can take a look at the issues on the Wagtail GitHub repository or the Wagtail.org repository. There are other Wagtail repositories you can check out but you'll just need to ask after joining the Slack channel.

My project

I'm working on the project called Introduce Stimulus for Interactive widgets in Wagtail. Stimulus is a Javascript framework that is designed to enhance static or server-rendered HTML by connecting JavaScript objects to HTML elements by simple annotations such as the data attributes.

Why is this project important in Wagtail?

In Wagtail, the Document Object Model (DOM) elements are being manipulated in different ways such as creating and attaching data attributes to the DOM elements, using an inline script to simulate action, creating functions and calling them globally, etc. These are all different ways that are used just to achieve a common purpose which is manipulating the DOM. They are very complicated and cumbersome which makes it difficult for new developers to decide on which of the methods they should adopt when contributing to the Wagtail repository.

Adopting the Stimulus framework in Wagtail solves all these problems and even more. Every HTML DOM element that uses Stimulus must have a data-controller attribute, target and either or both actions and value attributes.

This code below shows a simple example of a Stimulus Controller. Here is a link to one of my pull request if you want to learn more.

<div data-controller="hello">
  <input type="text">
  <button data-action="click->hello#greet">Greet</button>
</div>

This means that consistency is guaranteed. There won't be any confusion on whether to use inline scripts or data attributes or other methods anymore. Using the Stimulus controller in the DOM has a similar approach which would make it easier for both new and old contributors to use effectively. It would also make it easier to refactor and maintain Javascript/Typescript codes without the fear of breaking things because that's a nightmare 😅

Conclusion

Contributing to the Stimulus project in Wagtail has been a huge learning phase to me. I've learnt a lot of things and I've also improved on my communication skills. I don't get so shy anymore when on video calls😅

Thank you so much for reading till the end. I hope you have learnt something useful. See you in my next article!!