Skip to content

nwspk/web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

newspeak.house

Static content

We have auto-deployment through GitHub Actions from this repository, so we can make changes to the website directly from here.

  • master branch deploys to production
  • staging branch deploys to the staging environment

Texts

To change texts:

  1. Locate view in the views directory
  2. Say, one wants to change the text under the "News" section. Locate that in the index.html.haml file:
%h2 News
%p
  Lorem ipsum dolor sit amet consectetur, adipisicing elit. Maiores quo cupiditate iste labore fugiat beatae illum corporis incidunt exercitationem magni. Enim error, id at nam mollitia dolores odit nostrum animi.
  1. Change it into:
%h2 News
%p
  We have survived the pandemic.

Images

To add images:

  1. Upload new image file in /app/assets/images/.
  2. Figure out which one is the page/view in the views directory that will display the new image.
  3. Add an image tag like below. NB, the image tag should be on its own line:
= image_tag('book-logo-black-2.png')

Add new page

To add a new page, say newspeak.house/newproject, one needs to:

  1. Create the new file in /app/views/home/. Say /app/views/home/newproject.html.haml
  2. Add a route entry in /config/routes.rb for the home controller. At the top the routes.rb file:
get 'api/events',               to: 'api#events'
get 'about',                    to: 'home#about', as: :about
get 'fellowship',               to: 'home#fellowship', as: :fellowship
post 'webhooks',                to: 'webhooks#index'

Add a new line just under the last home controller line (the fellowship one in our example). The new line will look like so:

get 'newproject',               to: 'home#newproject', as: :newproject

Styling

The main CSS styling file is /app/assets/stylesheets/application.css.

Development

With Docker

Using Docker:

docker compose up --build

Set up database:

docker compose exec web bundle exec rake db:setup db:migrate

Without Docker

Prerequisites:

  • rbenv
  • ruby 3.1.3
bundle install
rails server
redis-server &
sidekiq -e development -q default -q mailers

Deployment

Check out the Server Playbook document.