Skip to content

veandco/sdl2.veand.co

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdl2.veand.co

This is the source code repository for the unofficial SDL2 website. It is a static website that is generated by Zola. Changes applied to the master branch is almost immediately live on the website thanks to Netlify! It currently has only Go-related tutorials but the plan is to eventually have other languages as well.

Development

To develop this website, one would want to download the zola executable so the result can be previewed locally. It can be installed using the instructions here. Personally, I download the executable directly from the [Github releases page] and put it where discoverable by my $PATH (for me, I put it under $HOME/.local/bin).

Once zola has been installed, the project can be cloned by running git clone https://github.com/veandco/sdl2.veand.co. Once it has been cloned, go into the sdl2.veand.co directory and run zola serve. It can then be reached locally via http://localhost:1111!

However, it is certainly possible to make small changes such as fixing small typos without touching the command-line. One could simply use Github's file editing feature to make the changes straight on the browser!

Structure

Creating single-page tutorial

To create a single-page tutorial, first go to content/tutorials/go and create a directory with slugified title such as hello-world. Then create a _index.md file and put the following content:

+++
title = "Hello World!"
template = "section-tutorials-lang-snippet.html"
sort_by = "weight"
weight = 50
+++

The content of the page goes here!

Creating multi-page tutorial

To create multi-page tutorial, first go to content/tutorials/go and create a directory with slugified title such as snake. Then create a _index.md file and put the following content:

+++
title = "Snake"
template = "section-tutorials-lang-project.html"
page_template = "page-tutorials-lang-project.html"
sort_by = "weight"
weight = 200
+++

After that, you can create the first page by creating another file e.g. setup.md with the following content:

+++
title = "First page"
weight = 0

[taxonomies]
categories = ["go"]
tags = ["snake"]
+++

Content of the first page here!

You can create the following pages with the similar set up but increment the weight. So the next page would contain something like this:

title = "Second Page"
weight = 1

[taxonomies]
categories = ["go"]
tags = ["snake"]
+++

Content of the second page here!

The links for the previous and next page will be generated on the HTML page based on the weight value.

About

An unofficial website for SDL2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published