Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
3412242
build: add prettier
sgratzl Nov 24, 2020
9a20ae0
build: configure prettier
sgratzl Nov 24, 2020
ed95afa
Merge remote-tracking branch 'origin/dev' into sgratzl/prettier
sgratzl Nov 24, 2020
5627d45
refactor: run prettier
sgratzl Nov 24, 2020
e022544
build: lint during build
sgratzl Nov 24, 2020
7a61329
refactor: simplify front matter
sgratzl Nov 24, 2020
5a4dcdd
build: add vscode settings
sgratzl Nov 24, 2020
5ca2320
build: ignore whole directory
sgratzl Nov 24, 2020
7b80ea6
build: ignore full static dir
sgratzl Nov 24, 2020
2a52704
docs: add prettier info to README
sgratzl Nov 24, 2020
97a22ce
build: try to ignore static directory
sgratzl Nov 24, 2020
09051f2
feat: use latest dev
sgratzl Nov 25, 2020
65fcd4e
fix: typo
sgratzl Nov 25, 2020
106d037
fix: api ref and terms-of-use link
sgratzl Nov 25, 2020
b75ef8d
Merge pull request #120 from cmu-delphi/sgratzl/latest-dev
sgratzl Nov 25, 2020
9cbe39c
Merge pull request #121 from cmu-delphi/sgratzl/small_fixes
sgratzl Nov 30, 2020
b204073
Merge branch 'dev' into sgratzl/prettier
sgratzl Nov 30, 2020
1a27ac2
refactor: npm run format
sgratzl Nov 30, 2020
89caf0b
fix: merge errors
sgratzl Nov 30, 2020
ac2bfa3
feat: switch anaconda font package
sgratzl Nov 30, 2020
6e0b11e
fix: rerun with proper font
sgratzl Nov 30, 2020
2b60bcb
Merge pull request #97 from cmu-delphi/sgratzl/prettier
sgratzl Nov 30, 2020
a26a8b1
Merge remote-tracking branch 'origin/dev' into sgratzl/fonts
sgratzl Nov 30, 2020
2e0be15
Merge pull request #125 from cmu-delphi/sgratzl/fonts
sgratzl Nov 30, 2020
ff995b6
Update _index.md
RoniRos Dec 1, 2020
80e3eea
refactor: cleanup setup
sgratzl Dec 1, 2020
dbcc343
refactor: cleanup partials
sgratzl Dec 1, 2020
677cd2c
Use relative paths for loading scripts and css.
tildechris Dec 1, 2020
2eefe39
refactor: landing page
sgratzl Dec 1, 2020
0dde09b
build: switch to lint-staged
sgratzl Dec 1, 2020
c8d9d02
build: test hook
sgratzl Dec 1, 2020
e9e7448
Merge remote-tracking branch 'origin/sgratzl/githook' into tildechris…
tildechris Dec 1, 2020
f47b489
Prettier changes
tildechris Dec 1, 2020
70618b0
Merge pull request #133 from cmu-delphi/sgratzl/githook
sgratzl Dec 1, 2020
3c4a75b
Merge remote-tracking branch 'origin/dev' into sgratzl/cleanup
sgratzl Dec 1, 2020
ef1d882
refactor: inline bibliography
sgratzl Dec 1, 2020
160ae17
build: tune vscode settings
sgratzl Dec 1, 2020
45ccce6
Prettier formatting
tildechris Dec 1, 2020
9e2e0e1
docu: add more text to README about structure
sgratzl Dec 1, 2020
aae0480
Merge pull request #132 from cmu-delphi/tildechris/relativepaths
tildechris Dec 1, 2020
ea4ac4c
refactor: inline covidcast shortcode and restructure
sgratzl Dec 1, 2020
fd1e072
Merge remote-tracking branch 'origin/dev' into sgratzl/cleanup
sgratzl Dec 1, 2020
7ce0f4f
refactor: only one baseof with more hooks
sgratzl Dec 1, 2020
b4c8829
fix: run prettier
sgratzl Dec 1, 2020
7ab6327
style: adapt new single blog style
sgratzl Dec 1, 2020
83073e6
Merge pull request #130 from cmu-delphi/RoniRos-patch-1
tildechris Dec 2, 2020
0f3692f
fix: switch back to directory structure for having a section
sgratzl Dec 2, 2020
58cb3bc
feat: play with menu
sgratzl Dec 2, 2020
1d6f8be
style: navbar style playing
sgratzl Dec 2, 2020
23effac
Merge remote-tracking branch 'origin/dev' into sgratzl/main-dev
sgratzl Dec 3, 2020
98e251e
fix: formatting
sgratzl Dec 3, 2020
b9f3d96
Merge remote-tracking branch 'origin/dev' into sgratzl/cleanup
sgratzl Dec 3, 2020
a658a25
fix: move flu file to have proper section
sgratzl Dec 3, 2020
efd8196
Merge pull request #134 from cmu-delphi/sgratzl/cleanup
sgratzl Dec 3, 2020
fd296ab
build: prettier ignore (R)markdown
sgratzl Dec 4, 2020
a881c9c
refactor: remove global button customization
sgratzl Dec 4, 2020
0b8b8bf
WIP
capnrefsmmat Dec 4, 2020
41ebb43
Clean up surveys page
capnrefsmmat Dec 4, 2020
64a06bf
fix: make mobile headers clickable
sgratzl Dec 4, 2020
46fe1bc
feat: generate team grid pic
sgratzl Dec 4, 2020
94a2823
fix: alt name team pic generation
sgratzl Dec 4, 2020
2b1a765
fix: formatting
sgratzl Dec 4, 2020
945d4b5
Merge pull request #144 from cmu-delphi/sgratzl/prettier_ignore
sgratzl Dec 4, 2020
5c4ec26
Merge pull request #145 from cmu-delphi/sgratzl/global_uikit
sgratzl Dec 4, 2020
37dc04d
Merge pull request #147 from cmu-delphi/sgratzl/mobile-menu
sgratzl Dec 4, 2020
41b9755
Merge remote-tracking branch 'origin/dev' into sgratzl/team_pic
sgratzl Dec 4, 2020
3391b69
fix: empty team
sgratzl Dec 4, 2020
2e0d655
Merge pull request #148 from cmu-delphi/sgratzl/team_pic
sgratzl Dec 4, 2020
bc8b25c
Merge pull request #142 from cmu-delphi/sgratzl/main-dev
sgratzl Dec 4, 2020
a44f488
Merge remote-tracking branch 'origin/dev' into surveys-page
sgratzl Dec 4, 2020
ed9d2f1
fix: typo
sgratzl Dec 7, 2020
5131bbc
Merge pull request #150 from cmu-delphi/sgratzl/typo
sgratzl Dec 7, 2020
9972f4e
Updated draft
capnrefsmmat Dec 7, 2020
124253d
Add new package dependency
capnrefsmmat Dec 7, 2020
66235c6
Merge branch 'dev' into blog/masks
capnrefsmmat Dec 7, 2020
f6df907
Fix math and author
capnrefsmmat Dec 7, 2020
d7156b2
fix: render inline math
sgratzl Dec 8, 2020
4115375
Use recommended link shortcodes
capnrefsmmat Dec 8, 2020
5c334b2
Add some links and fixes
capnrefsmmat Dec 8, 2020
84d7b15
feat: improve template blog post
sgratzl Dec 8, 2020
2f44910
Fixes to plot, typos
capnrefsmmat Dec 8, 2020
d6d5a86
Copyedits
capnrefsmmat Dec 9, 2020
f6de077
Merge remote-tracking branch 'origin/dev' into sgratzl/blog_layout
sgratzl Dec 9, 2020
798e90a
style: left align images in wide settings
sgratzl Dec 9, 2020
52e1e09
feat: add wide flag for figures
sgratzl Dec 9, 2020
9a301b8
fix: formatting
sgratzl Dec 9, 2020
7047f34
Update content/blog/2015-07-23-template-post.Rmd
sgratzl Dec 9, 2020
ad8f9d2
refactor: change covidcast embedding structure
sgratzl Dec 9, 2020
bd98fa3
edit new and changed members of Delphi Team
bweaver-work Dec 9, 2020
e018818
adjust david
bweaver-work Dec 9, 2020
05e79ad
add Daniel, Kari photos
bweaver-work Dec 9, 2020
e866451
add wichada photo
bweaver-work Dec 9, 2020
f670e2a
style: generalize toc styling
sgratzl Dec 9, 2020
d28ac31
Update index.md
bweaver-work Dec 9, 2020
b7b64dd
add george photo
bweaver-work Dec 9, 2020
40ee08a
Update index.md
bweaver-work Dec 9, 2020
de99c5e
Update index.md
bweaver-work Dec 9, 2020
e7d765b
Update index.md
bweaver-work Dec 9, 2020
f1e0f9e
style: create old mobile version
sgratzl Dec 9, 2020
deae44a
Merge remote-tracking branch 'origin/dev' into sgratzl/menu
sgratzl Dec 9, 2020
cccadcb
Update index.md
bweaver-work Dec 9, 2020
b5e07d0
Update index.md
bweaver-work Dec 9, 2020
bbe063a
Update index.md
bweaver-work Dec 9, 2020
7826859
Add files via upload
bweaver-work Dec 9, 2020
bff2226
Fix Daniel's aspect ratio
tildechris Dec 9, 2020
0d23961
Use 500x500 version
tildechris Dec 9, 2020
c3b56f6
Merge from dev
tildechris Dec 9, 2020
b7825a3
Merge from dev
tildechris Dec 9, 2020
1b85fe2
Remove erroneously committed diff orig files
tildechris Dec 9, 2020
0076cb9
Undo changes to package files
tildechris Dec 9, 2020
8465296
refactor: extract variables
sgratzl Dec 10, 2020
86401b6
Update to production signals, improve intro
capnrefsmmat Dec 10, 2020
0cc50b7
Merge from dev
tildechris Dec 10, 2020
daad36c
Re-add team highlights
tildechris Dec 10, 2020
bec5b6d
feat: add cmu logo to header
sgratzl Dec 10, 2020
f564ac0
Revert package files
tildechris Dec 10, 2020
b4da382
feat: simple icon footer
sgratzl Dec 10, 2020
9b54caf
fix: formatting
sgratzl Dec 10, 2020
b02af8a
Merge pull request #146 from cmu-delphi/surveys-page
tildechris Dec 10, 2020
090d443
style: change global page title
sgratzl Dec 10, 2020
e559a63
style: change footer for full wordmark
sgratzl Dec 10, 2020
0ff918f
Update Andrew's affiliation and upgrade google headshot resolution
tildechris Dec 10, 2020
7c26f48
Throw in SafeGraph data as another point of comparison
capnrefsmmat Dec 10, 2020
53a9836
Better plot title
capnrefsmmat Dec 10, 2020
10f8027
Merge pull request #135 from cmu-delphi/sgratzl/blog_layout
sgratzl Dec 10, 2020
c80d649
Merge pull request #156 from cmu-delphi/sgratzl/menu
sgratzl Dec 10, 2020
a230479
Merge pull request #155 from cmu-delphi/team-updates
tildechris Dec 10, 2020
3363bbf
Fix acknowledgements in wave 4 post
capnrefsmmat Dec 11, 2020
3121af3
style: define additional grid option
sgratzl Dec 11, 2020
7c9879f
feat: new favicon
sgratzl Dec 11, 2020
0ebd2bc
fix: formatting
sgratzl Dec 11, 2020
33d0ca7
refactor: team enforce jpg format
sgratzl Dec 11, 2020
e51ed07
Merge pull request #154 from cmu-delphi/sgratzl/blogmain
sgratzl Dec 11, 2020
2081c86
Merge remote-tracking branch 'origin/dev' into sgratzl/covidcast_inte…
sgratzl Dec 11, 2020
e3ea23c
staffing updates
bweaver-work Dec 11, 2020
a9b448e
add nat, shreenath photos
bweaver-work Dec 11, 2020
b4edb77
Update index.md
bweaver-work Dec 11, 2020
b03918a
Update index.md
bweaver-work Dec 11, 2020
90ff14b
Merge branch 'sgratzl/favicon' into sgratzl/covidcast_integration
sgratzl Dec 11, 2020
5364e29
fix: formatting
sgratzl Dec 11, 2020
873200c
Apply suggestions from copyediting
capnrefsmmat Dec 11, 2020
59caf1b
build: upgrade covidcast
sgratzl Dec 11, 2020
1d20212
fix: change forecast formula layout
sgratzl Dec 11, 2020
308130b
Merge pull request #160 from cmu-delphi/team-updates
tildechris Dec 11, 2020
267bf3b
Update index.md
bweaver-work Dec 11, 2020
a8cb785
Merge pull request #162 from cmu-delphi/sgratzl/formula_layout
sgratzl Dec 11, 2020
44a3ea5
Merge remote-tracking branch 'origin/dev' into blog/ack
sgratzl Dec 11, 2020
517c02b
Merge remote-tracking branch 'origin/dev' into blog/masks
sgratzl Dec 11, 2020
8b0aa49
Update index.md
bweaver-work Dec 11, 2020
d945c17
Merge pull request #163 from cmu-delphi/team-updates
tildechris Dec 11, 2020
53fd65c
Add short post summary
capnrefsmmat Dec 11, 2020
4f67ab7
Fix overlapping plot labels and extend date range
capnrefsmmat Dec 11, 2020
424c418
Clarify argument
capnrefsmmat Dec 11, 2020
ee9c49c
Use consistent indentation style
capnrefsmmat Dec 11, 2020
505de37
Don't mention the non-existent diagonal
capnrefsmmat Dec 11, 2020
ef09bec
Rebuild HTML and plots
capnrefsmmat Dec 11, 2020
74da05c
Better heading
capnrefsmmat Dec 11, 2020
b7e5a65
Rewrap code to fit nicely in the narrow column
capnrefsmmat Dec 11, 2020
f38b30b
Link to UMD survey, rebuild HTML
capnrefsmmat Dec 11, 2020
157ec93
Typo fix
capnrefsmmat Dec 11, 2020
7eb50a6
Clarify questions
capnrefsmmat Dec 11, 2020
d078b5a
Add non-breaking character's to Wichada's name
tildechris Dec 11, 2020
55349c1
Merge pull request #158 from cmu-delphi/blog/ack
sgratzl Dec 11, 2020
8fef9fd
Merge pull request #159 from cmu-delphi/sgratzl/favicon
sgratzl Dec 11, 2020
c15a197
Add other non-breaking spaces
tildechris Dec 11, 2020
11b9d20
Merge from dev
tildechris Dec 11, 2020
30afca2
feat: upgrade to covidcast v1.11.1
sgratzl Dec 11, 2020
4f89c5c
Merge pull request #165 from cmu-delphi/sgratzl/covidcast-1.11.1
sgratzl Dec 11, 2020
2c14114
Add images
tildechris Dec 11, 2020
3da3528
Merge pull request #164 from cmu-delphi/team-updates
tildechris Dec 11, 2020
3041848
Typo fix
capnrefsmmat Dec 11, 2020
aa0c126
Rebuild
capnrefsmmat Dec 11, 2020
684796c
Merge remote-tracking branch 'origin/dev' into sgratzl/covidcast_inte…
sgratzl Dec 11, 2020
1fc511e
Merge pull request #161 from cmu-delphi/sgratzl/covidcast_integration
sgratzl Dec 11, 2020
f50ac8f
build(deps): bump ini from 1.3.5 to 1.3.8
dependabot[bot] Dec 13, 2020
fd06c38
Improve graph and describe it more accurately
capnrefsmmat Dec 13, 2020
6d6b177
Copyedits
capnrefsmmat Dec 13, 2020
66659e2
Merge pull request #153 from cmu-delphi/blog/masks
capnrefsmmat Dec 13, 2020
40a22ab
Tweak choro range
ryantibs Dec 14, 2020
46a6ee3
Fix typo and add note
ryantibs Dec 14, 2020
c6a147b
Colon not period
ryantibs Dec 14, 2020
d7125fd
Italicize acknowledgements text
ryantibs Dec 14, 2020
2e0af99
Reorder tags
capnrefsmmat Dec 14, 2020
96af924
feat: remove methodology page
sgratzl Dec 14, 2020
4318181
style: 2nd level toc lower-latin
sgratzl Dec 14, 2020
1eab1f7
style: italic aknowledgements
sgratzl Dec 14, 2020
e2c0144
fix: formatting
sgratzl Dec 14, 2020
ab50338
Merge pull request #170 from cmu-delphi/sgratzl/small_changes
sgratzl Dec 14, 2020
1bccd0f
Merge remote-tracking branch 'origin/dev' into dependabot/npm_and_yar…
sgratzl Dec 14, 2020
2191b84
Merge pull request #166 from cmu-delphi/dependabot/npm_and_yarn/ini-1…
sgratzl Dec 14, 2020
2eadaee
Merge pull request #168 from cmu-delphi/blog/masks
capnrefsmmat Dec 14, 2020
80e4656
Merge from dev
tildechris Dec 14, 2020
843b2e9
style: center and hide on small
sgratzl Dec 14, 2020
141fed7
Merge remote-tracking branch 'origin/dev' into blog-copyedits
sgratzl Dec 14, 2020
bac1bb9
feat: revert ack change and update compiled files
sgratzl Dec 14, 2020
f88e210
Merge pull request #172 from cmu-delphi/sgratzl/landing_arrows
sgratzl Dec 14, 2020
25079ce
Regenerate blogs
tildechris Dec 14, 2020
dd137f6
Fix typo
capnrefsmmat Dec 14, 2020
bec70d2
Merge pull request #167 from cmu-delphi/blog-copyedits
tildechris Dec 14, 2020
c9f74fa
Merge branch 'dev' into release
tildechris Dec 14, 2020
f08ec0e
Add release notes
tildechris Dec 14, 2020
7d85a69
Merge branch 'main' into release
tildechris Dec 14, 2020
00dd122
Merge branch 'dev' into blog/masks
capnrefsmmat Dec 14, 2020
d56ed87
Merge pull request #173 from cmu-delphi/blog/masks
capnrefsmmat Dec 14, 2020
c03c81d
Merge branch 'dev' into release
tildechris Dec 14, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# These settings are for any web project

# Handle line endings automatically for files detected as text
# and leave all files detected as binary untouched.
* text=auto eol=lf

#
# The above will handle all files NOT found below
#

#
## These files are text and should be normalized (Convert crlf => lf)
#

# source code
*.php text
*.css text
*.sass text
*.scss text
*.less text
*.styl text
*.js text
*.ts text
*.coffee text
*.json text
*.htm text
*.html text
*.xml text
*.txt text
*.ini text
*.inc text
*.pl text
*.rb text
*.py text
*.scm text
*.sql text
*.sh text eof=LF
*.bat text
*.R text

# templates
*.hbt text
*.jade text
*.haml text
*.hbs text
*.dot text
*.tmpl text
*.phtml text

# server config
.htaccess text

# git config
.gitattributes text
.gitignore text

# code analysis config
.jshintrc text
.jscsrc text
.jshintignore text
.csslintrc text

# misc config
*.yaml text
*.yml text
*.editorconfig text
*.toml text

# build config
*.npmignore text
*.bowerrc text
*.prettierignore text
Dockerfile text eof=LF

# Heroku
Procfile text
.slugignore text

# Documentation
*.md text
LICENSE text
AUTHORS text


#
## These files are binary and should be left untouched
#

# (binary is a macro for -text -diff)
*.png binary
*.jpg binary
*.jpeg binary
*.gif binary
*.ico binary
*.mov binary
*.mp4 binary
*.mp3 binary
*.flv binary
*.fla binary
*.swf binary
*.gz binary
*.zip binary
*.7z binary
*.ttf binary
*.pyc binary
*.pdf binary

# Source files
# ============
*.pxd text
*.py text
*.py3 text
*.pyw text
*.pyx text
*.sh text eol=lf
*.json text

# Binary files
# ============
*.db binary
*.p binary
*.pkl binary
*.pyc binary
*.pyd binary
*.pyo binary

# Note: .db, .p, and .pkl files are associated
# with the python modules ``pickle``, ``dbm.*``,
# ``shelve``, ``marshal``, ``anydbm``, & ``bsddb``
# (among others).
*.rda binary
16 changes: 9 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
paths: # run only when an Rmd file changes
- '**.Rmd'
- 'environment.yml'
- '.github/workflows/ci.yaml'
- "**.Rmd"
- "environment.yml"
- ".github/workflows/ci.yaml"

name: ci

Expand All @@ -17,7 +17,7 @@ jobs:
fetch-depth: 3
- name: Cache Conda
uses: actions/cache@v1
with:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda6-${{ hashFiles('environment.yml') }}
restore-keys: |
Expand Down Expand Up @@ -50,20 +50,22 @@ jobs:
restore-keys: |
${{ runner.os }}-blogdown2-
- name: Build site
shell: bash -l {0}
shell: bash -l {0}
run: |
npm run build:blog

- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: "12"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build

Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/ci_fast.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
on:
push:
paths-ignore: # don't run the fast version when an Rmd file changes
- '**.Rmd'
- 'environment.yml'
- '.github/workflows/ci.yaml'
- "**.Rmd"
- "environment.yml"
- ".github/workflows/ci.yaml"

name: ci_fast

Expand All @@ -14,18 +14,20 @@ jobs:
- uses: actions/checkout@v2
with:
# submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 3 # Fetch all history for .GitInfo and .Lastmod
fetch-depth: 3 # Fetch all history for .GitInfo and .Lastmod

- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: "12"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Lint
run: npm run lint
- name: Build
run: npm run build

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/public
/resources/_gen
*.exe
/.vscode
/blogdown
/.Rhistory
*_cache
Expand Down
30 changes: 30 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
*.toml
*.jpg
*.png
*.rda
*.rdx
*.RData
*.svg
/blogdown
/.htaccess
/.Rhistory
.gitignore
.prettierignore
/.gitattributes
/LICENSE
/package-lock.json
/content/blog/**/*.html
/static
/public
/Dockerfile
/resources
/assets
*.woff
*.ttf
*.woff2
*.R
*.xml
*.Rmd
*.md
*.jpeg
*.ico
14 changes: 14 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
printWidth: 120,
semi: true,
trailingComma: "es5",

overrides: [
{
files: ["*.html"],
options: {
parser: "go-template",
},
},
],
};
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["esbenp.prettier-vscode"]
}
20 changes: 20 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnSaveMode": "modifications",
"[scss]": {
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[js]": {
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"files.trimTrailingWhitespace": true,
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
61 changes: 57 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,54 @@

Delphi's homepage at https://cmu-delphi-main.netlify.app/

This site is based on [Hugo](https://gohugo.io).
This site is based on [Hugo](https://gohugo.io) and uses [Prettier](https://prettier.io) for formatting.

## Structure

The main content is in the `/content` directory written in Markdown or RMarkdown for blog posts.
In addition to the Markdown content frontmatter with YAML syntax is used at the beginning of the file to customize and describe the content. Common fields include `title` and `description`.
However, depending on the file it can have additional fields. For example for blog posts additional fields are used to list the authors, hero images, summaries, tags, and so on.

### Linking

Hugo uses so called shortcodes for embedding logic into Markdown files. A good example is linking to other pages.

A relative reference to another page can be created using the `relref` shortcode. The argument is the filename with an optional `#` anchor to jump to a specific section.

**Examples**

```
national daily survey]({{< relref "surveys">}})
[syndromic COVID-19 indicator based on doctor visits]({{< relref "2020-10-14-dv-signal" >}})
[self-reported symptoms]({{< relref "2020-08-26-fb-survey#whats-in-the-survey" >}})
```

Instead of a direct link to the API reference there is the `apiref` shortcode. The advantage is that it is easy to later change the API base URL without changing each appearance. The argument is the path segment to point to.

**Examples**

```
[public API]({{< apiref "api/covidcast.html" >}})
[Epidata API]({{< apiref "/" >}})
```

In RMarkdown things are slightly more different since the R Markdown parser is used before Hugo takes over. Blogdown has a special function for handling shortcodes: `blogdown::shortcode_html`.

**Examples**

```
[Facebook](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey")`)
[previous exploratory investigations](`r blogdown::shortcode_html("ref", "2020-08-26-fb-survey#some-interesting-examples")`)
[public API](`r blogdown::shortcode_html("apiref", "api/covidcast.html")`)

```

### Data

In addition, there in the `/data` directory there are the following listings in YAML syntax

- `authors.yaml` list of blog authors referenced in the `authors` field in blog posts. This list is used to generated the author information at the end of a blog post
- `supporters.yaml` list of supporters/collaborators

## Development Environment

Expand All @@ -13,8 +60,9 @@ This site is based on [Hugo](https://gohugo.io).

#### Commands

1. run `npm start` to create a development Hugo server
1. run `npm build` to build a minified build in `/public`
1. run `npm start` to create a development Hugo server running at http://localhost:1313
1. run `npm run format` to run prettier and format files
1. run `npm run build` to build a minified build in `/public`

### Blog Editor

Expand All @@ -38,10 +86,15 @@ In order to convert the Rmd files to HTML files for Hugo you also need to:
- `local=TRUE` similar to `-D` to process draft files
- `run_hugo=FALSE` to manually run hugo
- `build_rmd=TRUE` force a (re)build of the Rmd pages
1. Alternatively, run `npm run build:blog`
1. Run Hugo server as usual

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`
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`.
A shortcut is available through `npm run start:blog`.

#### Adding a new blog post

In case you use new dependencies don't forget to either edit `environment.yml` or `dependencies.R`.
A Github action should runs when Rmd files changes so it will verify that the blog post can be built.
However, the converted HTML file along with all generated images are committed to the repository.
This simplifies the deployment and ensures that we have a blog post even when the API or data changes.
2 changes: 1 addition & 1 deletion _output.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
blogdown::html_page:
# force svglite device, since cairo is a mess
dev: "svglite"
dev: svglite
Loading