Performance Badges

Badges will be issued by the HoD of the Department of Computer Engineering, to the students to appreciate their performance and contribution to the Department/Faculty/University.

The following guideline is for the site maintainers. Students may not try to create Badges for themself, without approval from the HoD.

To create a new badge, it is required to
  1. Create an image for the badge (Template) and save it in the folder, /images/badges/
  2. Create a JSON file in the folder, /badges/. (Template can be found below)

JSON Template

You need to create a JSON file in the folder, /badges/ to define a new Badge. The template is as below:

    
{
    "title": "Title of the Badge",
    "tag": "Tag of the Badge, need to be link compatible",
    "description": "A short description about the badge",
    "criteria": "The criteria considered to issue the badge",
    "image": "images/badges/{image_name_with_extension}",
    "show_in_profile": "true",
    "students":[
    {
        "eNumber": "E/YY/XX",
        "name": "Name of the Student",
        "position": "Position, designation or the Subtitle to be shown in the student profile",
        "link": "The link to the certificate, if exists (optional)"
    },
    ...
    ]
}
    


How this works

  1. There is a python script in here, which will be executed through GitHub Action at a scheduled time or can be executed manually the action, Update Profile Details from here. (After you visit the Actions page, you need to expand the 'Run workflow', and select the 'main' branch and click on Run workflow button)
  2. Within that Python script, JSON files will be read and populate the other required infromation from the APIs available in the api.ce.pdn.ac.lk. Pre-processed details will be stored in /_data/badges.json as a JSON file. (The data structure was specially designed to help the Liquid Syntax used in Jekyll to easily generate the HTML content)
  3. Additionally, the script will generate pages for each Badge in the folder, /pages/badges/pages/ .
  4. When Jekyll is building the website, the Badge information will be added to the student profiles.