1.47.0 • Published 2 years ago

@mitodl/ocw-to-hugo v1.47.0

Weekly downloads
20
License
MIT
Repository
github
Last release
2 years ago

ocw-to-hugo

Installation

These examples demonstrate installing ocw-to-hugo globally, as it is designed to be a command line utility that can be run from anywhere in the system. However, you may omit the global flag if you wish to install it into another project.

From source

$ cd ~/path/to/temp/dir
$ git clone git@github.com:mitodl/ocw-to-hugo.git
$ cd ocw-to-hugo
$ npm install -g .

From npm

$ npm install -g @mitodl/ocw-to-hugo

Usage

$ ocw-to-hugo -c <courses.json location> --download -i <input directory> -o <output directory>

This utility optionally takes a JSON file of OCW course ID's. Various examples of this can be found in the course_json_examples folder, but generally it is formatted as:

{
    "courses": [
        "12-001-introduction-to-geology-fall-2013",
        "14-01sc-principles-of-microeconomics-fall-2011"
    ]
}

If the -c option has been specified, processing will be filtered by the courses specified in the format above. If the --download flag is set, the courses listed will first be downloaded from AWS to the input directory specified with -i. When downlading courses, ocw-to-hugo automatically determines if it needs to re-download a file by comparing dates. If --download is not set, the source for the courses specified in the JSON must already exist in the input directory. If any of the courses are not there, an error will be thrown. If you wish to simply process an input directory of courses without downloading or filtering, use only the -i and -o arguments.

Arguments

ArgumentRequired?Valid valuesDescription
-i, --inputYes/path/to/open-learning-course-dataInput folder of OCW course folders containing parsed.json files and optionally static content
-o, --outputYes/path/to/hugo-markdown-outputOutput path to place processed courses in
-c, --coursesOnly if download flag is true/path/to/courses.jsonIf enabled, courses processed will be filtered based on the format above
--downloadNotrue or falseDownload parsed.json files from a configured S3 bucket and a list of courses passed in with -c
--strips3Notrue or falseStrip the s3 base URL from all OCW resources
--staticPrefixNo/path/to/static/assetsWhen --strips3 is set to true, replace the s3 base URL with this string
--rmNotrue or falseClear the contents of the path passed with -o before the conversion run

Environment Variables

VariableDescription
AWS_REGIONThe AWS region to connect to, i.e. us-east-1
AWS_BUCKET_NAMEThe bucket to use, i.e. open-learning-course-data-ci
AWS_ACCESS_KEYYour AWS Access Key with access to said bucket
AWS_SECRET_ACCESS_KEYThe secret access key that pairs with your access key
1.47.0

2 years ago

1.46.0

2 years ago

1.44.2

2 years ago

1.44.4

2 years ago

1.44.3

2 years ago

1.42.0

2 years ago

1.44.0

2 years ago

1.44.1

2 years ago

1.43.0

2 years ago

1.39.0

2 years ago

1.40.0

2 years ago

1.36.1

2 years ago

1.38.0

2 years ago

1.41.0

2 years ago

1.35.1

2 years ago

1.35.2

2 years ago

1.35.0

2 years ago

1.35.4

2 years ago

1.36.0

2 years ago

1.34.2

2 years ago

1.34.1

2 years ago

1.33.3

3 years ago

1.33.2

3 years ago

1.33.1

3 years ago

1.32.0

3 years ago

1.33.0

3 years ago

1.31.1

3 years ago

1.31.0

3 years ago

1.30.3

3 years ago

1.30.2

3 years ago

1.30.0

3 years ago

1.30.1

3 years ago

1.29.1

3 years ago

1.29.0

3 years ago

1.28.1

3 years ago

1.28.0

3 years ago

1.27.0

3 years ago

1.26.1

3 years ago

1.26.0

3 years ago

1.25.1

3 years ago

1.25.0

3 years ago

1.24.3

3 years ago

1.24.2

3 years ago

1.24.0

3 years ago

1.23.0

3 years ago

1.22.0

3 years ago

1.21.0

3 years ago

1.20.0

3 years ago

1.19.1

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.9.0

3 years ago

1.7.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago