Okta developer site (developer.okta.com) is a custom Jekyll site deployed on GitHub pages.
All documentation submissions are welcome. To submit a change, please follow the contribution process detailed below.
Most of the content of the developer site is written in a format called Kramdown which is a flavor of Markdown with some enhanced features like the ability to do footnote notations. We use Kramdown because the markup is both human readable and convertible in to fully fledged HTML. If there's some functionality you can't implement in Kramdown you can always drop down into HTML as a last resort.
Though Kramdown gives us benefits of readability it comes at the cost of requiring a build step to preview the changes to the site. Jekyll, handles this nicely by detecting changes to the file system and refreshing automatically. To setup Jekyll to be able to build and view the site, follow the steps below:
- Install RVM if you don't already have it. On OSX install the stable version or on Linux
yum install rvm
. To ensure you have rvm installed properly runrvm list
and ensure that there is a version marked as 'current'. - Clone repository
git clone [email protected]:okta/okta.github.io.git
- Go into project directory
cd okta.github.io
- You may be told that the version of ruby needed by this project isn't installed, follow the given instruction to
install the correct version of ruby for RVM. If you did have to install a new version of ruby re-enter the directory
you're in:
cd ..;cd okta.github.io
then verify that the current gemset you're using is called "okta.github.io" by runningrvm gemset list
. This project specifies a gemset so that the build of this project isn't affected by global gems on your system. - Now install gems needed by this project into the projects gemset with
gem install bundler
and thenbundle install
. This will essentially read the Gemfile in the root directory and install all packages required to run the site. - Install NPM if you don't alreayd have it. On OSX, if you are a brew user,
brew install node
, otherwise see this guide. - Run
npm install
- Start the site
npm start
- Visit
http://localhost:4000
in your browser - To stop serving the site hit
ctrl+c
in the terminal
- _source: this is where the source files live. If you're editing content, or adding assets like images or CSS, they belong in here
- dist: this directory is ignored in GitHub. It contains the local version of each of the built files in the site
- almost everything else: most of the other directories in the root are the checked in versions of the built site.
These files should not be edited directly. Find the corresponding version of the file in the
_source
directory, modify that and then re-run the build.
If you are making changes in a fork, here is how to make a clean Pull Request against "upstream":
- Sync your fork to https://github.com/okta/okta.github.io/
The command
git remote add upstream [email protected]:okta/okta.github.io.git
is the key part of this step. - After running
git fetch upstream
in the guide above, run this command to pull down changes from upstream:git merge -s recursive -X theirs upstream/master
Okta uses the GitHub Flow workflow for contributions. The process varies depending on what sort of change you are making:
All commits will go through the weekly
branch. They will be deployed once a week after the preview release.
-
Fetch latest from origin, and create a new topic branch off of
weekly
:[okta.github.io master]$ git fetch origin [okta.github.io master]$ git checkout -b my-topic-branch origin/weekly
-
Make your changes inside the
_source
directory. -
Confirm that Jekyll still builds properly by running
npm start
and then navigating to http://localhost:4000. -
Once you are happy with your changes, commit them.
-
Push your topic branch:
[okta.github.io my-topic-branch]$ git push origin my-topic-branch:my-topic-branch
-
Create a Pull Request. Set "base" to "weekly" (Important!)
-
Get it reviewed. When it passes the Travis tests and has an approval, merge.
-
After it's been merged into
weekly
, it will be deployed to the staging site - this usually takes a couple minutes. Verify that your changes show up correctly on the live version of the site. Note - you can tell exactly when it's been pushed by looking at the bacon publish task for the okta.github.io artifact. -
You're done! Your changes will go out with the weekly release, which happens after preview is deployed.
Verify that the change makes sense. Verify that the changed files are all in _source
- there should be no production build files (which would show up outside of _source
).
Blog commits will be merged into the master
branch. They should include the production build - once it's merged, it's live on developer.okta.com.
-
Fetch latest from origin, and create a new topic branch off of
master
. If you're working off a fork, follow these instructions.# After synced with latest from upstream [okta.github.io master]$ git checkout -b my-blog-branch
-
Make your changes inside the
_source
directory. -
Confirm that Jekyll still builds properly by running
npm start
and then navigating to http://localhost:4000. -
Once you are happy with your changes, commit them.
-
Run the command to build the production files:
# Important! You must use this command to generate the build version. [okta.github.io my-blog-branch]$ npm run build-prod
-
Verify that only the intended files were copied over. If this is correct, create a new commit to your branch with the message "Production build".
-
Create a new Pull Request. Leave the base branch as
master
. -
Once the Travis tests have passed, send a HipChat message to the current DevEx EEP in the DevEx-Public HipChat room. They'll be responsible for reviewing and merging your PR into
master
.# Easy way to ping the current EEP - do this in DevEx-Public > @Nomy guardian-devex please review my blog pr: https://github.com/okta/okta.github.io/pull/{{ID}}
Verify that the only changed files are blog files:
- The main blog post under
_source/_posts
- Any assets that are added to the blog -
_source/_assets
- The production versions of these:
assets/{{the same images, but with a sha in the url}}
- The generated blog files (the post,
feed.xml
,sitemap.xml
, and the list fileblog/index.html
)
An example of a correct PR is here.
Only approved Okta employees can deploy the site. In most cases this will be the DevEx EEP.
Create a production build of the weekly
branch, merge it, then reset weekly
.
-
Create a new topic branch based off of
weekly
. Name itweekly-{year}.{release}
, i.e.weekly-2017.25
[okta.github.io master]$ git fetch origin [okta.github.io master]$ git checkout -b weekly-2017.25 origin/weekly
-
Rebase to pull in any commits that have been merged to
master
directly[okta.github.io weekly-2017.25] git rebase -i origin/master
-
Run the command to build the production files:
# Important! You must use this command to generate the build version. [okta.github.io weekly-2017.25]$ npm run build-prod
-
Verify that only the intended files were copied over. If this is correct, create a new commit to your branch with the message "Production build".
-
Push the branch to
weekly-{year}.{release}
, and create a new Pull Request. The base branch should be set tomaster
.[okta.github.io weekly-2017.25] git push origin weekly-2017.25:weekly-2017.25
-
After it's been approved and passes the Travis tests, merge it into
master
. The changes are live! Don't merge intoweekly
before the next step! -
Reset the
weekly
branch with the latestmaster
changes.[okta.github.io master]$ git fetch origin # Note: The following command overwrites any new changes to the weekly branch! Before running this, # make sure there are no new commits that have been merged in since you merged into master. # If there have been merges since step 6, you must rebase before pushing master to weekly. [okta.github.io master]$ git push -f origin origin/master:weekly
Hotfix commits will be merged into the master
branch. They should include the production build - once it's merged, it's live on developer.okta.com.
-
Fetch latest from origin, and create a new topic branch off of
master
:[okta.github.io master]$ git fetch origin [okta.github.io master]$ git merge origin/master [okta.github.io master]$ git checkout -b my-hotfix-branch
-
Make your changes inside the
_source
directory. -
Confirm that Jekyll still builds properly by running
npm start
and then navigating to http://localhost:4000. -
Once you are happy with your changes, commit them.
-
Run the command to build the production files:
# Important! You must use this command to generate the build version. [okta.github.io my-hotfix-branch]$ npm run build-prod
-
Verify that only the intended files were copied over. If this is correct, create a new commit to your branch with the message "Production build".
-
Push the branch, and create a new Pull Request. Leave the base branch as
master
. -
Get it reviewed. When it passes the Travis test and is approved, it can be merged.
Verify that the only changed files are the files in _source
, and the files that have been copied to root as a result of the _source
changes.
Pages are single purpose HTML or Markdown (.md
) files
- Create a folder with
index.html
file. (e.g.pricing/index.html
) - Author front matter as follows:
---
layout: page
title: YOUR_TITLE
css: CSS_FILENAME.css (optional page specific css file)
---
- Put HTML or CSS content under front matter
- Expose link to page in header or elsewhere. URL will be the folder
name,
index.html
is not necessary (e.g. /pricing)
- Create
PAGE_NAME.md
indocs/FOLDER_NAME
(e.g.docs/api/rest/users.md
) - Filenames are underscore separated and all lowercase. (e.g.
my_cool_doc_page.md
) - Author front matter:
---
layout: docs_page
title: Title Case Name of Page
---
- The content under the front matter should not have any
h1
s - this will be set by thetitle
property - All
h2
s in the content will be rendered as a link in the table of contents - Create placement entry in manifest at
_data/docs.yml
in appropriatepages
section. - The
pages
name must match the filename without extension. (e.g.users.md
=>users
) - To create a new section in the manifest
section: NAME_OF_FOLDER
title: TITLE_CASE_NAME_OF_SECTION
- The sections structure should follow the folder names
- The ordering of sections and pages in the manifest determines the order in which they appear in the leftnav
- Create an
index.md
folder incustomers/CUSTOMER_NAME
(e.g.customers/box/index.md
) - Create the images:
`index_image`: 220px x 165px @144dpi // image used on index page
`header_image`: 1080px x 220px @144dpi // title bar image on story page
`diagram_image`: 694px x <n>px @144dpi // information graphic at bottom of story page
- Author front matter
`index_blurb` will be clipped over three lines of text
`sidebar_copy` will be markdownified. Newlines should be doubled.
- Create an entry in
_source/_data/authors.yml
- Put avatar image in
_source/assets/img
. Make sure aspect ratio of image is square.
- Create a file in
_source/_posts/
with the formYYYY-mm-dd-the-title.md
- The header should look something like:
---
layout: blog_post
title: Productionalizing ActiveMQ
author: okta_generic_blogger
tags: [activemq, jvm]
---
- Supporting images should be placed in
_source/assets/img
and should follow the convention:<name_of_post>-image-name.extension
where name of the post doesn't include the.md
extension. This will allow us to know which images are referenced by which post. - Look at other posts for examples.