Giter VIP home page Giter VIP logo

reichlab.github.io's Introduction

reichlab.github.io

site build

Home page source code. Source lies in branch source. Github build goes to master.

Building

  1. Install bundle and project dependencies

    bundle install

  2. Add content. See here for details.

  3. Collect updates from github repositories mentioned in files.

    bundle exec rake collect

    Running this uses unauthenticated requests to Github's API. The limit is 60 per hour. Recommended way is to generate a personal token (https://github.com/settings/tokens) and run collect command as

    env GH_TOKEN='<token-here>' bundle exec rake collect

  4. Serve/build with jekyll

    bundle exec jekyll serve
    bundle exec jekyll build

Contributing / adding content

The website uses jekyll and most of the pages get their content directly using the markdown/html template, except a few pages for which the data source is a kept in separate files and then is injected to the template via plugins kept in _plugins.

  • Team members data go in _data/team.yml
  • Publications go in _data/publications.yml
  • New sections for 'research' and 'teaching' page go in _research and _teaching directory respectively.

Pull requests should go to source branch (not master) since travis builds the website from there.

A short description of the data files follow:

publications.yml

This contains publications that get displayed on the /publications page. A full featured entry for a publication looks something like the following:

title: Title of the publication
doi: >
  [Optional] doi like 10.1371/journal.pone.0035564. This adds the links for
  'Open doi link' and 'Save to mendeley'.
slug: >
  Unique identifier which also maps to a pdf in ./pdfs/publications/<slug>.pdf
  (in case a pdf link is not provided) and an image in
  ./images/publications/<slug>.png
journal: [Optional] Journal name
year: year
volume: [Optional] volume
pages: [Optional] pages
authors: Name of authors (this should be a yaml list but is just a string right now)
keywords: >
  [Optional] Comma separated keywords (this also should be a list but is string
  as of now)
abstract: Abstract
preprint: [Optional] Link to a preprint
pdf: >
  [Optional] Link to pdf. This takes priority over
  ./pdfs/publications/<slug>.pdf
github: [Optional] Github repository identifier like <user>/<repo>

team.yml

This contains information about lab members. An entry looks like this:

name: Member name
role: Role
description: Blurb
image: >
  A full url to an image (like https://example.com/image.png) or path to local
  image file (like /images/people/foo.png)
# Links is a list of links the member wants to show under his/her description
# In case of no links, put '[]' (empty list) here.
links:
  - name: Link name
    url: Url
  - name: Link 2
    url: Url
type: >
  [Optional] The type of member. This is different than role and is used to
    categorize list of members in sections like 'Alumni'.

research and teaching sections

Both the research and teaching page are organized in terms of sections or themes which map to a set of markdown files in the directories _research and _teaching respectively. Each files contains metadata in its yaml front matter and the section's summary as its main text. Here is an example markdown file:

---
title: Section title text
image: /images/research/foo.png # The image for the section
# A list of projects which can either be a github identifier or a dictionary
# with title and description keys
projects:
  - user/repo
  - group/repo
  - title: Project title
    description: Project description
publications: >
  [Optional] Comma separated keywords mapping to that of _data/publications.yml
---
Here goes the section summary.

Developing

Overall, the source code follows the usual jekyll structure. We use a few additional custom scripts/plugins to work with data files like _data/team.yml. This section documents the peripheral tooling involved.

1. Plugins

Plugins in ./_plugins read in the data from ./_data, ./_research and ./_teaching and provide them as variables in the corresponding pages (like ./teaching.html for _teaching).

Since the plugin and html file for research and teaching look very similar, we generate both of them from a single source file using ribosome. We call these pages (research and teaching) thematic pages. The ruby plugin file is generated from ./_scripts/theme-gen-gen.rb.dna and the html file from ./_scripts/theme-page.html.dna. The process is scripted in the rakefile and is described in the next section.

2. Rake tasks

We use rake for specifying and running tasks.. The main tasks are collect and build.

collect

Before building the website, we need to collect some metadata (last commit information etc.) about github repositories listed in the files ./_research/*.md and ./_teaching/*.md. This involves using the github api and running the script ./_scripts/collect-repos.rb. The following command runs this task and produces an updated ._data/repositories.yml file with all the metadata required:

bundle exec rake collect

Since github api has limits, we need to pass a token so that the task can finish successfully:

env GH_TOKEN='<token-here>' bundle exec rake collect

build

This is the main build task which just wraps around jekyll's own build.

bundle exec rake build

tpgen

This task generates a thematic page template (the html file). It needs two extra arguments,

  1. The name of the theme page (like 'research' or 'teaching')
  2. Short text (divider text) which goes over the list of projects (like 'LINKS' in teaching and 'PROJECTS' in research)

The command below will produce a page ./teaching.html with a divider text 'ITEMS'.

bundle exec rake tpen[teaching,items]

ggen

This produces a ruby plugin for corresponding (html of the same name) thematic page. It needs one extra argument which is the name of the theme page.

The command below produces a plugin ./_plugins/teaching.rb and works with the template page ./teaching.html using data from _/teaching directory.

bundle exec rake ggen[teaching]

3. Travis

We use travis to run the website build process every time commits are pushed on github. Travis also rebuilds the website each night so that the information collected about the github repositories stays fresh.

The main file for travis is ./build.sh which checks for a few things (like which branch are we building for) and runs the rake tasks collect and build. Once done, it pushes the generated static html files to the repository's master branch. For pushing, it needs an authentication key which is kept encrypted in the file ./deploy_key.enc.

reichlab.github.io's People

Contributors

aaronger avatar annakrystalli avatar apurvshah007 avatar benwrogers87 avatar bsweger avatar darbetter avatar dasuni-j avatar donga0223 avatar eycramer avatar gcgibson avatar hannanabdul55 avatar harleyjean avatar justin-st avatar katiehouse3 avatar khoale1096 avatar lepisma avatar lshandross avatar matthewcornell avatar micokoch avatar mmkerr avatar mzorn-58 avatar nickreich avatar sakrejda avatar salauer avatar serena-wang avatar shv38339 avatar starkari avatar tomcm39 avatar trustchi avatar vrushti-mody avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

reichlab.github.io's Issues

create machine account for integration

A step in our build script requires bulk GitHub API access and thus an access token is required. Such a token can only be associated with a user account (and not an organization) so a machine account must be created for such a purpose. Right now I have created a token using my personal account but we should move the aforementioned approach.

minor updates to citation style for website publications

  • remove space before the colon in vol(num) : pages
  • add year to text citation (redundant with year headers, but makes the citation itself complete and cut/pasteable), as (YYYY) before journal name.
  • add period at end of citation.
  • check recent papers and add updated volume/number info for those missing it.

add new images to index page carousel.

This is a placeholder issue for us to tackle at some point - seems like a nice, fairly straightforward one.

@katiehouse3 when you are ready to tackle this, could you put out a call to the entire lab for image nominations? Then we can go through and pick out a few to add...

more changes to people page

A few items for making the people page more easily maintainable and simpler for readers...

  • make alumni section different format (perhaps a grid of faces, with names/info underneath?). smaller images?
  • reduce the amount of info we have for alumni. should just contain role, year(s) with lab, and current (?) position. (Don't love the "current" position as it makes it more for us to maintain, but also is more relevant.) remove links to resources.

add flusight to statcounter

When I look at the statcounter site, I see all of the website pages, but not the flusight page. Is it as simple as copying over the existing reichlab.io script to the flusight page to make that happen?

add link for alumni on people page

Have come around to wanting to be able to include a single, user-specified "permalink" of sorts (e.g. researchgate, google scholar, linkedin, github, etc...) for lab alumni. Not sure how to include it on the page but maybe we can make the photo or the entire square for an individual clickable? Or include a little "url" icon? open to suggestions on that.

disqus links don't show up right for blog posts

Does this only happen when I pre-load the site on my desktop/laptop to look at the new post, then push to github? See, e.g. http://reichlab.github.io/2016/11/23/introducing-flusight.html
which, when shared via disqus gives this link
http://disq.us/t/2g3kghf
which redirects to
http://127.0.0.1:4000/2016/11/23/introducing-flusight.html#disqus_thread
which was the link on my computer prior to committing the post.

Will try next time to push before checking locally. but it would be nice if this didn't happen. @lepisma this is the issue we were disussing yesterday.

reclaim twitter space

maybe we could make the "recent news" section a bit wider now that the twitter integration is gone?

image

Fix Github Pages DNS issue

he page build completed successfully, but returned the following warning for the gh-pages branch:

The custom domain for your GitHub Pages site is pointed at an outdated IP address. You must update your site's DNS records if you'd like it to be available via your custom domain. For more information, see https://help.github.com/en/articles/using-a-custom-domain-with-github-pages.

For information on troubleshooting Jekyll see:

https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

option to link to paper PDF directly

If a PDF of a published paper can be linked to directly through the journal website, having a local copy is either redundant, potentially in violation of copyright, or, if we load up an older version of the paper so it's not in copyright infringement, then it's out of date.

Could we add an option for a pdf: entry in the .yml file that, if present with a url, would override the looking for the slug.pdf file?

Fix gaps in blog posts

Being converted from pure markdown, the blog posts are not picking up style classes from the main css and so have poor gaps between divs and table items. Example:

image

Two solutions:

  1. Add the required classes in the markdown files themselves.
  2. Add css for blog posts (preferred)

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.