Tobacco Control Playbook
While the tobacco industry and its allies have always opposed tobacco control measures, their strategies have now become more determined, focussed, misleading, aggressive and sophisticated.
Until now there has been no single source explaining how tobacco industry players act and how governments and the public health community can respond to their arguments.
The Tobacco Control Playbook is a living collection of evidence-based arguments and responses, developed by tobacco control leaders to counteract and succeed against the tobacco industry.
Technical overview
The Master branch of this repository holds the publishing system, and the gh-pages branch holds the live website.
The domain name tobaccoplaybook.net
points to cloudfront.com, who provides a cache and the https rewrite service.
The website is a static site, generated by the custom builder (src/build.js
) run by node.js.
Configure settings in config.js
.
Authoring
All content is expressed in Markdown files, located in the following directories below config > contentSource
:
Dir | Description |
---|---|
/en, /ru | available languages. Subdirs structure is expected to match. |
front | content for the index page |
pages | content for auxiliary pages, e.g. About |
arguments | main content files |
Frontmatter
All files accept YAML frontmatter
Key | Example | Description |
---|---|---|
Title | Title | the title of the argument |
Authors | John Doe, Michael Smith | one or all document authors |
ApprovedBy | John Doe | the name (and position?) of the person who has approved the publishing of this document |
ApprovedDate | 2016-09-20 | date, used internally for version control |
Revision | 1 | version number (please increment each time the document is updated/changed) |
PublicDate | 2016-09-23 | date on which this document will be published on the website (and displayed across the website) |
HeaderImage | https://unsplash.com/photos/8-o4p16GzSc | the URL to an image you like from unsplash.com |
Tags | Tag, Another tag, One more | keywords for this document |
Short | A 140 char summary | twitter-friendly super condensed summary |
SourceFile | test.docx | original filename of this document |
ReferenceAccessDate | 2016-09-20 | date, when the references was last checked |
ArgumentId | 001 | informal ID, displayed in the index listing |
Naming convention
langugage
/arguments/000
_name_of_this_page.md, where:
language
is a directory containing all content files for a given language (e.g. 'en')000
denotes a unique page ID
Examples:
/en/arguments/001_page_number_one.md
/en/arguments/002_page_number_two.md
/no/arguments/001_side_nummer_en.md
/no/arguments/002_side_nummer_to.md
Installing the system
Make sure your system has a working installation of node, npm, sh and git.
First obtain the source code:
$ git clone git@github.com:tobaccoplaybook/site.git
Then, install its dependencies:
$ cd site/ && npm install
Building the site
$ node index.js (or npm start)
This will start the dev server, which
- Rebuilds the site into
build/
- Starts a live-reload server (so you can browse the result) at http://127.0.0.1:8181/
- Starts a file wathcer, that rebuilds when sourcefiles change.
Publishing the site
The website is hosted with the free "github pages" feature, that makes everything published to the repo's gh_pages branch available on the website domain (tobaccoplaybook.net).
To publish the changes to the live site, copy the generated html files to _site/, commit- and push it.
Git Setup:
We follow the "gh-pages as a submodule of master" pattern from http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html
so,
- work in master,
- generate the public files to _site/
- commit and push _site:
$ cd _site; git add .; git commit -m "site update"; git push origin gh-pages
- commit and push master:
$ cd ../; git commit -a -m "site update"; git push origin master
The git workflow is automated in deploy.sh
, so simply run $ ./deploy.sh
(in repo root) to publish the content of build/
to gh-pages.
License
Code is licensed under MIT
Content is licensed under CC-BY-4.0