Skip to content

Commit b19fe9b

Browse files
committed
Merge remote-tracking branch 'origin/dev' into sgratzl/dashboard-prep
2 parents 5306865 + 6b6c889 commit b19fe9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+379
-273
lines changed

.github/workflows/blog.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ on:
55
paths: # run only when an Rmd file changes
66
- "**.Rmd"
77
- "environment.yml"
8+
- "dependencies.R"
89
- ".github/workflows/blog.yaml"
910

1011
jobs:
11-
build:
12+
blog:
1213
runs-on: ubuntu-latest
1314
steps:
1415
- uses: actions/checkout@v2
1516
with:
1617
# submodules: true # Fetch Hugo themes (true OR recursive)
1718
fetch-depth: 3
1819
- name: Cache Conda
19-
uses: actions/[email protected].5
20+
uses: actions/[email protected].6
2021
with:
2122
path: ~/conda_pkgs_dir
2223
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
@@ -42,7 +43,7 @@ jobs:
4243
run: |
4344
Rscript ./dependencies.R
4445
- name: Restore Blogdown Cache
45-
uses: actions/[email protected].5
46+
uses: actions/[email protected].6
4647
with:
4748
path: |
4849
./blogdown
@@ -65,7 +66,7 @@ jobs:
6566
- uses: actions/[email protected]
6667
with:
6768
node-version: "12"
68-
- uses: actions/[email protected].5
69+
- uses: actions/[email protected].6
6970
with:
7071
path: ~/.npm
7172
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/[email protected]
1515
with:
1616
node-version: "14"
17-
- uses: actions/[email protected].5
17+
- uses: actions/[email protected].6
1818
with:
1919
path: ~/.npm
2020
key: ${{ runner.os }}-node3-${{ hashFiles('**/package-lock.json') }}

.github/workflows/release_main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
with:
4848
node-version: "14"
4949
- name: Cache Node.js modules
50-
uses: actions/[email protected].5
50+
uses: actions/[email protected].6
5151
with:
5252
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
5353
key: ${{ runner.OS }}-node2-${{ hashFiles('**/package-lock.json') }}

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"editor.formatOnSave": true,
33
"editor.formatOnPaste": true,
44
"editor.formatOnSaveMode": "modifications",
5+
"prettier.prettierPath": "./node_modules/prettier",
56
"[scss]": {
67
"files.trimTrailingWhitespace": true,
78
"editor.formatOnSave": true,
@@ -16,5 +17,6 @@
1617
"files.trimTrailingWhitespace": true,
1718
"editor.formatOnSave": true,
1819
"editor.defaultFormatter": "esbenp.prettier-vscode"
19-
}
20+
},
21+
"prettier.enableDebugLogs": true
2022
}

README.md

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
7979
1. Activate the environment: `conda activate www-main`
8080
1. Install extra R dependencies: `Rscript ./dependencies.R`
8181

82+
As an alternative you can use Docker and Docker Compose. Then it reduces to `docker-compose up -d` to create a docker container for the current environment. In the following you would need to jump into the container to execute the upcoming command via `docker-compose exec r bash`.
83+
8284
#### Commands
8385

8486
1. Activate the environment: `conda activate www-main`
@@ -93,15 +95,88 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
9395
blogdown also has an integrated server `blogdown::serve_site()` which will render RMarkdown files on the fly and does a similar thing as `hugo server -D`.
9496
A shortcut is available through `npm run start:blog`.
9597

96-
#### Adding a new blog post
98+
## Adding a new blog post
99+
100+
*Prerequisite*: Installed Blog Editor environment from the previous section
101+
102+
### Create new blog file
103+
104+
Create a new file `content/blog` with a naming convention of `YYYY-MM-DD-short-title.Rmd`. The date is the creation date. Copy the template post or another example to start with. *Note*: Starting the file with an underscore (e.g. `_2021-04-20-jj-vaccine.Rmd`), will stop this file from being automatically checked by the Github Action CI. Only do this when the public CI cannot build this post, if for example private data is used.
97105

98106
In case you use new dependencies don't forget to either edit `environment.yml` or `dependencies.R`.
99-
A Github action should runs when Rmd files changes so it will verify that the blog post can be built.
107+
A Github action should run when Rmd files changes so it will verify that the blog post can be built.
100108
However, the converted HTML file along with all generated images are committed to the repository.
101109
This simplifies the deployment and ensures that we have a blog post even when the API or data changes.
102110

111+
### Edit Blog Header
112+
113+
The header of a blog file contains numerous attributes to be defined, including: name, publication date (`date`), tags, a short summary (at most 150 characters), and a list of authors. The author list `authors` is a list of people keys, see below for how to add people.
114+
115+
The `heroImage` is an optional hero image banner. The image is optional but its thumbnail version is not. However, the template post has good default value for this one. The hero image should be a JPG file with 1120x440 pixels. The thumbnail hero image should be a JPG file with 300x300 pixels. The files should be stored in `/content/blog/images`.
116+
117+
The `related` list is a list of related blog links identified by their file name without the Rmd suffix.
118+
119+
### Linking within the blog post
120+
121+
In order to generate links that are relative to the whole website there are two short codes for R Markdown available.
103122

104-
### Release Process
123+
#### Linking to another page
124+
125+
using the `reflink` shortcode. For example, `r blogdown::shortcode_html("reflink", "2020-09-18-google-survey", "Google")` will generate a relative link to the blog post with the filename `2020-09-18-google-survey` and anchor text `Google`.
126+
127+
#### Linking to the API docs
128+
129+
using the `apireflink` shortcode. For example, `r blogdown::shortcode_html("apireflink", "api/covidcast.html", "COVIDcast API")` will generate a link to the API docs and its sub page `api/covidcast.html` and will look like: [`COVIDcast API`](https://cmu-delphi.github.io/delphi-epidata/).
130+
131+
### Creating wide figures
132+
133+
In case of a wide figure, one can break out of the layout by adding the `out.extra = 'class="wide-figure"'` extra argument to the corresponding R chunk.
134+
135+
e.g.,
136+
```
137+
{r, message = FALSE, warning = FALSE, fig.width = 9, fig.height = 5, out.extra = 'class="wide-figure"'}
138+
ggplot(...)
139+
```
140+
141+
### Adding static images
142+
143+
Static images (e.g. pre-generated plots) should be stored in a `/static/blog/<BLOGFILE_NAME>_files` directory and referenced using something like
144+
145+
```
146+
![](/blog/2021-04-29-vaccine-trends-hispanic_files/hesitancy_over_time_hispanic_and_white_adults.png)
147+
```
148+
149+
### Building the blog file
150+
151+
see before using `Rscript -e 'blogdown::build_site(local=TRUE, run_hugo=FALSE, build_rmd="content/blog/<NAME>.Rmd")'` where `<NAME>` should be replaced by the name of the Rmd file. **The generated files should be committed to this repository to ensure reproducibility.**
152+
153+
154+
## Adding new people (team, blog authors)
155+
156+
People on this website are centrally managed in the `/content/people/index.md` file. Each entry should have the following attributes:
157+
158+
* `key` ... short key to identify this person when referencing them in the blog section
159+
* `firstName`, `lastName`, `affiliation`
160+
* `image` ... name of the head shot image (preferred 500x500px in JPG format) stored in `/content/people/headshots`
161+
* `description` ... used within the blog footer as an about the author text
162+
* `note` ...optional note about past contributors
163+
* `link` ... optional used for linking to a personal website
164+
* `team` ... list of teams this person is part of. used to assign places on the teams page. possible values are:
165+
* `core` ... core member
166+
* `blog` ... blog author
167+
* `highlight` ... highlight person on front page
168+
* `external` ... external person not to be listed in the teams page
169+
* `past` ... past member team section
170+
* `leadership` ... ryan and roni
171+
* `contributors` ... contributor team section
172+
* `google` ... google team section
173+
174+
175+
## Adding new news item
176+
177+
News items are short announcements that should be persistent. The are centrally managed in the `/content/news/headless` directory. Each news item is its own file with content, title, and publication date.
178+
179+
## Release Process
105180

106181
The release consists of multiple steps which can be all done via the GitHub website:
107182

@@ -115,4 +190,3 @@ The release consists of multiple steps which can be all done via the GitHub webs
115190
1. create docker image and the production system will be notified to pull this update
116191
1. Once the jobs are completed the new release should be available at https://delphi.cmu.edu within minutes.
117192
1. Done
118-

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ relativeURLs = false
146146
mission = "Develop the theory and practice of epidemiological forecasting, with a long-term vision of making this technology as universally accepted and useful as weather forecasting is today."
147147
apiUrl = "https://cmu-delphi.github.io/delphi-epidata"
148148
twitter = "CmuDelphi"
149+
contactForm = "https://docs.google.com/forms/d/e/1FAIpQLScqgT1fKZr5VWBfsaSp-DNaN03aV6EoZU4YljIzHJ1Wl_zmtg/viewform"
149150
feedbackForm = "https://docs.google.com/forms/d/e/1FAIpQLSeIeOJtrAhdOriEyiRY7LkpQX8DZBY19dl6De8l56Q9CZhmxw/viewform?usp=pp_url&entry.1245962748="
150151
feedbackLikelihoodMobile = 0.2
151152
feedbackLikelihoodDesktop = 1

content/about/news/headless/2019_10_CenterOfExcellence.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ title: Delphi named 'Center of Excellence'
44
category: accomplishment
55
---
66

7-
[CDC has just named us "National Center of Excellence for Influenza Forecasting"](https://www.ml.cmu.edu/news/news-archive/2019/october/machine-learning-delphi-research-group-funded-by-centers-for-disease-control-cdc.html) (one of two nationally.)
7+
[CDC has just named us "National Center of Excellence for Influenza Forecasting"](https://www.cmu.edu/news/stories/archives/2019/october/cdc-funds-carnegie-mellons-flu-forecasting-center.html) (one of two nationally.)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
date: 2020-12-01
3+
title: COVIDcast enhanced with Change Healthcare COVID-19 de-identified claims data
4+
category: update
5+
---
6+
7+
[Change Healthcare and Carnegie Mellon University’s Delphi Research Group announce the launch of Delphi's enhanced COVIDcast real-time COVID-19 indicators](https://newsroom.changehealthcare.com/press-releases/carnegie-mellon-university-s-delphi-research-group-enhances-covi)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
date: 2021-05-12
3+
title: Delphi Research Group and collaborators honored for COVIDcast
4+
category: update
5+
---
6+
7+
[The American Statistical Association (ASA) presented the 2021 Statistical Partnerships Among Academe, Industry, and Government (SPAIG) Award to Carnegie Mellon University’s Delphi Research Group and their COVIDcast partners](https://www.cmu.edu/dietrich/news/news-stories/2021/may/spaig-covid.html)

content/blog/2015-07-23-template-post.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ authors: # list of team member keys, see /content/about/team/index.md -> team
1111
- frida
1212
# uncomment to enable a big hero image
1313
# heroImage: blog-lg-img_hello-world.jpg # size: 1120x440 jpg format
14-
heroImageThumb: blog-thumb.jpg # size: 300x200 jpg format
14+
heroImageThumb: blog-thumb.jpg # size: 300x300 jpg format
1515
summary: |
1616
Blog summary, the first 150 characters are used for the blog list
1717
acknowledgements: |

0 commit comments

Comments
 (0)