This is the repository behind NUS Hackers' website https://nushackers.org, built with the Hugo framework.
To get started, you'll need:
- Hugo v0.111.3 (the extended version)
- Yarn v1 with a recent version of NodeJS
Then clone this repository and run
yarn install # install dependencies
yarn dev # start development server
Hugo will now generate the site and watch the directory and update the site when any changes are made. You can access the site at http://localhost:1313.
Most of the data used to populate the site are stored in the data/
folder as
.yaml
files. These includes files that contain information about the coreteam
and upcoming projects/events for the semester.
The current academic year and semester are kept tracked of in the config.toml
under the [params]
section. This is used to automatically determine which
project/event data file to use for the current semester. Project/event data
files are named in the format <project-name>_<academic-year>_<semester>.yml
and are stored in corresponding data/<project-name>
folder.
Coreteam details and introductions are stored in the
/data/coreteam_members.yml
file. Include your
wittiest introductions here and don't be shy to share your contact details and
links!
This file is primarily for active coreteam members, we have a separate file for coreteam alumni in
/data/alumni.yml
.
- Data location:
/data/friday_hacks
- Data Format:
start_date: <date-time-of-first-friday-hack> start_nr: <number-of-first-friday-hack-in-the-list-below> hacks: # each event/hack consists of a venue, blog post and talk topics - venue: <where> blog_post: <blog-post-url> topics: # each topic consists of a speaker name, affiliation and the title of the talk - speaker: <name> from: <affiliation> title: <title> # if there is no friday hack, just put nohack: <reason> - nohack: <reason> # If there is supposed to be a friday hack but no speakers yet: - nospeaker: true
- ❗️Each hack has a date tagged to it implicitly based on the order of the
list. The first hack in the list will have
start_date
as the event date, the second hack will be the next Friday (+7d
) and so on.- This means that there needs to be a entry for every Friday between the start date and the end of the semester!
start_date
: This is used to automatically generate the date for each event in the list.start_nr
: This is used to automatically generate the Friday Hacks number for each event- For example, if
start_nr
is200
, then the first event in the list below is the Friday Hacks #200 and the next event would be Friday Hacks #201 and so on (this is all done automatically)
- For example, if
- Refer to Creating a Post for more details on how to create a new blog post for Friday Hacks
- ❗️Each hack has a date tagged to it implicitly based on the order of the
list. The first hack in the list will have
The data format for Friday Hacks is a little more involved than the others due to legacy reasons
- Data location:
/data/hacker_school
- Data Format:
events: # Each event consists of a topics, venue and date - topic: <what-is-the-workshop-about> venue: <where> date: <when>
- Events are not sorted by date automatically, so do remember to list them in chronological order!
- Data location:
/data/hackers_toolbox
- Data Format: same as Hackerschool
All blog posts are stored under the content/posts
folder.
To create a new post:
- Add a markdown file to the
content/posts
folder - Name the file in the format
YYYY-MM-DD-<post-title>.md
- Add the following frontmatter to the top of the file:
--- title: <post-title> date: <YYYY-MM-DD> url: /<year>/<month>/<day>/<post-tag> ---
- If the post is sponsored, add the following frontmatter:
sponsors: - <sponsor-name>
Sponsors will be added to a post via HTML
partials. These sponsor partials are
stored under the layouts/partials/sponsors
folder. The naming convention for these partials is <sponsor-name>.html
.
To add a new sponsor:
- Create a new
HTML
partial under thelayouts/partials/sponsors
folder - The name of the partial must match the name under the
sponsors
frontmatter in the post - The logo of the sponsor should be stored under the
static/img/sponsors
folder