Giter Site home page Giter Site logo

twc-site-berlin's Introduction

Berlin TWC

This repository is responsible for most content visible on the website TechWorkersBerlin.com. The site is made with a static site generator called Jekyll in a language called Ruby.

Getting Started

With Docker (recommended)

We use Docker to have a reproducible development environment. Before proceeding, install Docker Compose on your system.

  1. Start the application with the command: docker-compose up
  2. Access the application in a browser at localhost:4000
  3. Execute other commands in the Docker container: docker-compose run --rm --service-ports jekyll bash

Without Docker

  1. Install dependencies: bundle install
  2. Start a local server: bundle exec jekyll serve
  3. Verify all internal links are valid: bundle exec rake

Open a browser to localhost:4000

Add an event

Add a file inside the _events directory. Copy a previous file as a template, and make sure to include the right time zone for Berlin!

Add a blog post (inside /news)

Add a file inside the _news directory. Copy a previous file as a template. If an author does not exist, add one inside _data/authors.yml. A name is the only thing necessary, but photo is optional too.

Add a press mention

Inside _data/press.yml file, add a media entry, with date format in YYYY-MM-DD.

Translation

I18n (internationalization) is made available with the jekyll-multiple-languages-plugin. When a page has a translated version available, a link will show up on the top right if you use the default_translate layout. English is the default language, while other languages have their two letter ISO code prefixed, for example TechWorkersCoalition.org/ru for Russian.

Localise date

Normally displaying a date is done using native liquid templates {{ page.date | date: '%-d %B %Y' }}, but for localisation, we need to pass it a language which can be done using our custom _plugins/i18n_filter.rb, and translation keys. We would replace our liquid template with the following:

{{ page.date | localize: site.lang, '%-d %B %Y' }}

Adding new language

  1. Add new language key to en.yml
  2. Add two letter iso code in config. The order here determines the order shown on the page. English must be first.
  3. Inside the i18n directory create a
  • LANGUAGE.yml with the language key and value in its own language, for example es: Español

Note, only the default en.yml must contain the names of each language. The other language yaml files contain just their own language key. To include only certain languages, specify the exact language keys you want. For example languages: ["en", 'ja']

Screen Shot 2019-07-21 at 14 48 46

Supported Pages

Supported Languages

  • English
  • German
  • Russian
  • Polish (except for join.md/press_mentions.md)

Adding Netlify Build Plugins

Netlify is both our server and continuous integration. It offers plugins which can be ran before deploying the site, to either perform some checks or optimizations. Check out our [netlify.toml], it has some build plugins installed. To test them locally on your own machine run:

# Ensure that you have the netlify build command available
# (in future this will be provided via the CLI)
npm install @netlify/build -g

# In the project working directory, run the build as netlify would with the build bot
netlify-build

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.