Skip to content

Latest commit

 

History

History
145 lines (99 loc) · 4.89 KB

CONTRIBUTING.md

File metadata and controls

145 lines (99 loc) · 4.89 KB

Contribution Guidelines

As all source{d} projects, this project follows the source{d} Contributing Guidelines.

Additional Contribution Guidelines

In addition to the source{d} Contributing Guidelines, this project follows the guidelines described below.

Architecture

The landing contains 2 parts:

  • The static site itself: a webpack app,
  • a Go API to serve the latest blog posts and job offers.

In production, each part lives in a separated container.

Static site

The static site is built with:

  • webpack: javascript (with some REACT components) and css (from SASS stylesheets)
  • hugo: for the HTML from Go templates and YAML data

Its source code is under:

  • hugo directory: for hugo sources:
    • content directory: contains one .md per landing page that defines each page metadata,
    • data directory: contains the landing variable content like titles, captions, descriptions, projects...
    • layout directory: contains the HTML templates.
  • src directory: for js and sass code,
  • static/img directory: for site images,

External Dependents

There are some external applications loading resources from http://sourced.tech/ so they should be preserved between different landing versions or considered as cross-project issues.

Salesforce Pardot Landing Pages

Dependent Files

  • https://sourced.tech/css/bundle.css
  • https://sourced.tech/js/bundle.js
  • https://sourced.tech/img/home_separator_3.png
  • https://sourced.tech/img/logo_footer.svg
  • https://sourced.tech/img/logos/favicon.png

Linked pages

  • https://sourced.tech/engine
  • https://sourced.tech/lookout
  • https://sourced.tech/open-source
  • https://sourced.tech/community
  • https://sourced.tech/company

API

The API serves (a cached version of):

  • the 3 latest blog posts tagged as technical, and the 3 latest blog posts tagged as culture for the home page,
  • all the opened positions at Lever,

Its source code is under api directory.

Development

Requirements

You should already have Go installed, and properly configured the $GOPATH

go version; # prints your go version
go env GOPATH; # prints your $GOPATH path

The project must be under the $GOPATH, following the Go import conventions, what means you can install and cd to its directory running:

go get github.com/src-d/landing/...
cd $GOPATH/src/github.com/src-d/landing

You also need Yarn v1 installed

yarn --version; # prints your Yarn version

Install and build

You need to satisfy all project requirements, and then to run:

make build

Development and running the landing locally

You need to satisfy all project requirements, and then to run:

LANDING_URL=//localhost PORT=8081 make serve

It runs everything you need to get the site working at http://localhost:8081

Alternatively, you can start hugo, the api-server and webpack in a "three window mode", just running:

make project-dependencies
LANDING_URL=//localhost PORT=8081 yarn start

With this command, each window runs a command, that can be also ran by you in case you need to control the output of each command or in any other special case:

  • yarn run webpack-watcher To start webpack watcher, that will rebuild the assets when you change its sources
  • make hugo-server To serve the landing locally using hugo server
  • yarn run api-run To start the landing API at http://localhost:8080

Preview the documentation site

Since the Landing repository is used as a blueprint for every documentation site as served by src-d/docs, the Landing can be used to generate a "documentation like" site; To do so, it is needed to run:

make develop-documentation

And then, go to http://localhost:8081

To rollback the changes, and see the landing as usual, just run:

make develop-documentation-destroy

Configuration

The following envars are available for API configuration

envar | default *

  • | - ADDR | :8080 FEED_BASE_URL | http://blog.sourced.tech/json/ POSITIONS_BASE_URL | https://api.lever.co/v0/postings/sourced?mode=json

* The default values are defined by api/config/config.go