Git Product home page Git Product logo

stack-web's Introduction

STACK Website

This repository generates the main website for the STACK online assessment system, and makes it available on https://www.stack-assessment.org. Additions and modifications are welcomed.

What is covered in this document

  • The framework of the main STACK website
  • Updating the website
  • Testing the website locally

What is not covered in this document

Instructions for updating the docs website docs.stack-assessment.org. The online docs are generated directly from the main STACK repo, so that is also where you will find the STACK online Docs instructions.

Website framework

The website is built using MkDocs, a static site generator. The site pages are written in a mixture of Markdown and html within the website_files directory. When the site is deployed, MkDocs will convert these files into HTML and push them to the gh-pages branch.

The website structure mirrors the file structure: the file website_files/Legal/Accessibility.md will be available on www.stack-assessment.org/Legal/Accessibility. Every sub-folder has an index.md file that will take that folder's name on the website: website_files/CaseStudies/index.md will be available on www.stack-assessment.org/CaseStudies/.

MkDocs is configured in the mkdocs.yml file. MkDocs has a full list of available configuration options. MkDocs can either generate the navigation bar automatically, or accept a custom navigation configuration in the nav variable. The main STACK website uses the second option. When new pages are added, they must be manually specified under the nav variable. Any files that are not specified in nav will be "hidden", that is, they cannot be accessed from the navigation bar, only from a direct link.

MkDocs cannot display MathJax out-of-the-box, so we use the markdown extension mdx_math, specified in mkdocs.yml, with the variable extra_javascript set to include MathJax.

MkDocs can accept a third-party theme, and the main STACK website uses the Bootstrap Theme, which uses all the website building tools of Bootstrap. This includes Bootstraps responsive grid system and its card styling. Parts of the theme can be overridden in the overrides folder. The main.html file is set up to extend the base Bootstrap theme, to for example, add a custom footer. A custom stylesheet is also added, under website_files/custom.css.

The site is hosted by GitHub Pages from the gh-pages branch. An workflow under .github ensures that MkDocs runs its command mkdocs gh-deploy every time the repository is pushed to, which rebuilds the website and pushes the built HTML piles to the gh-pages branch. This overrides all the files currently in the gh-pages branch, so you must never edit files directly in the gh-pages branch.

Updating the website

You can make small changes directly and push the changes. You do not need to download MkDocs or any of the extensions to update the website.

Adding a page

Only pages in the website_files directory will be included. You can write your page in markdown, and include html code. To include your page in the main navigation, remember to specify it in mkdocs.yml.

Linking

Links between pages are relative. If a link starts with / it will be taken relative to the root of the website, i.e. /CaseStudies/ always link to stack-assessment.org/CaseStudies/, while CaseStudies/ is a relative link that appends CaseStudies/ to the end of the current url. Absolute links to other websites must start with https://

Accessibility

When adding new content, please try to adhere to the WCAG 2.1 Accessibility Guidelines as much as possible. Please:

  • Add alternative text to all non-text objects, in particular images. This can be done using the alt="" tag.
  • Making sure elements are responsive to different page sizes.
  • Never use colour as the sole way of conveying a message.
  • Use colours with contrast levels of at least 4:5:1.

Some work has already been done to make the website automatically be accessible. In particular, tables will collapse when the screen is small.

We keep track of the current state of Accessibility in our Accessibility document, which is available on the website to all users. Please ensure "Steps taken" is always up to date. You are invited to fix some of the "Known issues".

Testing the website locally

Before adding major changes to the website, you are encouraged to test your changes locally. For this, you will need to install MkDocs and all the required extensions.

  1. Install MkDocs, including its requirements.
  2. Install Bootstrap with pip install mkdocs-bootstrap
  3. Install the markdown extension with pip install https://github.com/mitya57/python-markdown-math/archive/master.zip
  4. Install the include_dir_to_nav plugin with pip install mkdocs-include-dir-to-nav

You can run a local version of the website with the command mkdocs serve. This will make your local version available on the IP http://127.0.0.1:8000/.

Please test your changes work on:

  • The following browsers: Chrome, Firefox, Safari, Edge.
  • The following sizes: Computer, tablet, mobile. Chrome's "inspect" tool works well for this.

stack-web's People

Contributors

adriandom avatar anst-i avatar georgekinnear avatar jcopado avatar kzerva avatar malthefogsporring avatar malthesporring avatar mtmatuszewski avatar muhsala avatar samfearn avatar sangwinc avatar smborio avatar speedyjwc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.