diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index cacde65..0000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Bug -about: Use this template for filing bugs -title: "" -labels: bug -assignees: '' - ---- - -## Required Prerequisites for filing a bug - -### You must follow ALL the steps in the [troubleshooting guide](https://github.com/fastai/fastpages/blob/master/_fastpages_docs/TROUBLESHOOTING.md). Not doing so may result in automatic closure of the issue. - - -## Required information - -1. Steps to reproduce the problem -2. A link to the notebook or markdown file where the error is occurring -3. If the error is happening in GitHub Actions, a link to the specific error along with how you are able to reproduce this error. You must provide this **in addition to the link to the notebook or markdown file**. -4. A screenshot / dump of relevant logs or error messages you are receiving from your local development environment. Instructions of running a local development server is provided in the [development guide](https://github.com/fastai/fastpages/blob/master/_fastpages_docs/DEVELOPMENT.md). diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 11fc491..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: enhancement -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/chatops.yaml b/.github/workflows/chatops.yaml deleted file mode 100644 index 89b45b8..0000000 --- a/.github/workflows/chatops.yaml +++ /dev/null @@ -1,195 +0,0 @@ -name: Chatops -on: [issue_comment] - -jobs: - trigger-chatops: - if: (github.event.issue.pull_request != null) && contains(github.event.comment.body, '/preview') && (github.repository == 'fastai/fastpages') - env: - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - CHECK_RUN_NAME: "Draft-Site-Build" - runs-on: ubuntu-latest - steps: - - - name: see payload - run: | - echo "FULL PAYLOAD:\n${PAYLOAD}\n" - echo "PR_PAYLOAD PAYLOAD:\n${PR_PAYLOAD}" - env: - PAYLOAD: ${{ toJSON(github.event) }} - PR_PAYLOAD: ${{ github.event.pull_request }} - - - name: verify env exists - id: get_status - run: | - if [ -z ${NETLIFY_AUTH_TOKEN} ]; then echo "::set-output name=status::public"; else echo "::set-output name=status::private"; fi - - - name: make comment on PR if env does not exist - if: steps.get_status.outputs.status == 'public' - run: | - ./_action_files/pr_comment.sh "Was not able to generate site preview due to absent credentials." - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number }} - - - name: Fetch context about the PR that has been commented on - id: chatops - uses: machine-learning-apps/actions-chatops@master - with: - TRIGGER_PHRASE: "/preview" - env: # you must supply GITHUB_TOKEN - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.6 - - - name: install requests - run: pip3 install requests - - - name: add check run - id: create_check - if: steps.get_status.outputs.status == 'private' - shell: python - run: | - import os, requests - - sha = os.getenv('SHA') - token = os.getenv('GITHUB_TOKEN') - nwo = os.getenv('GITHUB_REPOSITORY') - name = os.getenv('CHECK_RUN_NAME') - - url = f'https://api.github.com/repos/{nwo}/check-runs' - - headers = {'authorization': f'token {token}', - 'accept': 'application/vnd.github.antiope-preview+json'} - - payload = { - 'name': f'{name}', - 'head_sha': f'{sha}', - 'status': 'in_progress', - 'output':{ - 'title': f'Building preview of site for {sha}.', - 'summary': ' ', - 'text': ' ' - }, - } - response = requests.post(url=url, headers=headers, json=payload) - print(response) - id = response.json()['id'] - print(f"::set-output name=id::{id}") - env: - SHA: ${{ steps.chatops.outputs.SHA }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: add label - if: steps.get_status.outputs.status == 'private' - run: | - import os, requests - nwo = os.getenv('GITHUB_REPOSITORY') - token = os.getenv('GITHUB_TOKEN') - pr_num = os.getenv('PR_NUM') - headers = {'Accept': 'application/vnd.github.symmetra-preview+json', - 'Authorization': f'token {token}'} - url = f"https://api.github.com/repos/{nwo}/issues/{pr_num}/labels" - data = {"labels": ["draft build pending"]} - result = requests.post(url=url, headers=headers, json=data) - # assert response.status_code == 201, f"Received status code of {response.status_code}" - print(result) - shell: python - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUM: ${{ steps.chatops.outputs.PULL_REQUEST_NUMBER }} - GITHUB_REPOSITORY: $GITHUB_REPOSITORY - - - name: Copy The PR's Branch Repository Contents - uses: actions/checkout@master - if: steps.get_status.outputs.status == 'private' - with: - ref: ${{ steps.chatops.outputs.SHA }} - - - name: convert notebooks and word docs to posts - uses: ./ # use the code in this repo to instead of fastai/fastpages@master - - - name: setup directories for Jekyll build - if: steps.get_status.outputs.status == 'private' - run: | - rm -rf _site - sudo chmod -R 777 . - - - name: Jekyll build with baseurl as root for netifly - if: steps.get_status.outputs.status == 'private' - uses: docker://hamelsmu/fastpages-jekyll - with: - args: bash -c "gem install bundler && jekyll build" - - - name: deploy to netlify - if: steps.get_status.outputs.status == 'private' - id: py - run: | - sudo npm install netlify-cli -g - netlify deploy --dir _site | tee _netlify_logs.txt - cat _netlify_logs.txt | python _action_files/parse_netlify.py - - - name: make comment on PR - if: steps.get_status.outputs.status == 'private' - run: | - MSG="A preview build of this branch has been generated for SHA: $SHA and can be viewed **live** at: ${URL}\n\nThe current fastpages site built from master can be viewed for comparison [here](https://fastpages.fast.ai/)" - echo "$MSG" - ./_action_files/pr_comment.sh "${MSG}" - env: - URL: ${{ steps.py.outputs.draft_url }} - SHA: ${{ steps.chatops.outputs.SHA }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ISSUE_NUMBER: ${{ github.event.issue.number }} - - - name: remove label - if: always() - run: | - import os, requests - nwo = os.getenv('GITHUB_REPOSITORY') - token = os.getenv('GITHUB_TOKEN') - pr_num = os.getenv('PR_NUM') - headers = {'Accept': 'application/vnd.github.symmetra-preview+json', - 'Authorization': f'token {token}'} - url = f"https://api.github.com/repos/{nwo}/issues/{pr_num}/labels/draft%20build%20pending" - result = requests.delete(url=url, headers=headers) - print(result) - shell: python - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUM: ${{ steps.chatops.outputs.PULL_REQUEST_NUMBER }} - GITHUB_REPOSITORY: $GITHUB_REPOSITORY - - # defensively clear check run each time - - name: clear check run - if: always() - continue-on-error: true - shell: python - run: | - import os, requests - - sha = os.getenv('SHA') - conclusion = os.getenv('WORKFLOW_CONCLUSION').lower() - token = os.getenv('GITHUB_TOKEN') - nwo = os.getenv('GITHUB_REPOSITORY') - check_run_id = os.getenv('CHECK_RUN_ID') - if not check_run_id: - quit() - - url = f'https://api.github.com/repos/{nwo}/check-runs/{check_run_id}' - headers = {'authorization': f'token {token}', - 'accept': 'application/vnd.github.antiope-preview+json'} - - data = { - 'conclusion': f'{conclusion}', - } - response = requests.patch(url=url, headers=headers, json=data) - print(response) - env: - SHA: ${{ steps.chatops.outputs.SHA }} - WORKFLOW_CONCLUSION: ${{ job.status }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECK_RUN_ID: ${{ steps.create_check.outputs.id }} - diff --git a/.github/workflows/docker-nbdev.yaml b/.github/workflows/docker-nbdev.yaml deleted file mode 100644 index 49c7224..0000000 --- a/.github/workflows/docker-nbdev.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: Build-Nbdev-Docker -on: - schedule: - - cron: '0 */12 * * *' - -jobs: - nbdev-docker-fastpages: - if: github.repository == 'fastai/fastpages' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - - name: build container - run: | - docker build -t hamelsmu/fastpages-nbdev -f _action_files/fastpages-nbdev.Dockerfile ./_action_files - - - name: push container - run: | - echo ${PASSWORD} | docker login -u $USERNAME --password-stdin - docker push hamelsmu/fastpages-nbdev - env: - USERNAME: ${{ secrets.DOCKER_USERNAME }} - PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml deleted file mode 100644 index 3478633..0000000 --- a/.github/workflows/docker.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build-Docker -on: - push: - paths: - - Gemfile* - branches: - - master - pull_request: - paths: - - Gemfile* - -jobs: - jekyll-fastpages: - if: github.repository == 'fastai/fastpages' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - - name: setup directories for Jekyll build - run: sudo chmod -R 777 . - - - name: build container - run: | - docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile . - - - name: push container - if: github.event == 'push' - run: | - echo ${PASSWORD} | docker login -u $USERNAME --password-stdin - docker push hamelsmu/fastpages-jekyll - env: - USERNAME: ${{ secrets.DOCKER_USERNAME }} - PASSWORD: ${{ secrets.DOCKER_PASSWORD }} diff --git a/CNAME b/CNAME deleted file mode 100644 index 18a648f..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -fastpages.fast.ai diff --git a/README.md b/README.md index 0415b0c..c4ac49c 100644 --- a/README.md +++ b/README.md @@ -1,500 +1,29 @@ -[//]: # (BADGES SECTION: change `fastai` with your GitHub username and `fastpages` with the name of your repo) +[//]: # (This template replaces README.md when someone creates a new repo with the fastpages template.) -![](https://github.com/fastai/fastpages/workflows/CI/badge.svg) -![](https://github.com/fastai/fastpages/workflows/GH-Pages%20Status/badge.svg) -[![](https://img.shields.io/static/v1?label=fastai&message=nbdev&color=57aeac&labelColor=black&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAjCAYAAABhCKGoAAAGMklEQVR42q1Xa0xTVxyfKExlui9blszoB12yDzPGzJhtyT5s+zBxUxELBQSHm2ZzU5epBF/LclXae29pCxR5VEGgLQUuIOKDuClhm8oUK7S9ve19tLTl/fA5p9MNc/Y/hRYEzGLxJL/87zk9Ob/zf5++NGHMALzYgdDYmWh0Qly3Lybtwi6lXdpN2cWN5A0+hrQKe5R2PoN2uD+OKcn/UF5ZsVduMmyXVRi+jzebdmI5/juhwrgj3mTI2GA0vvsUIcMwM7GkOD42t7Mf6bqHkFry2yk7X5PXcxMVDN5DGtFf9NkJfe6W5iaUyFShjfV1KPlk7VPAa0k11WjzL+eRvMJ4IKQO0dw8SydJL+Op0u5cn+3tQTn+fqTivTbQpiavF0iG7iGt6NevKjpKpTbUo3hj+QO47XB8hfHfIGAelA+T6mqQzFi+e0oTKm3iexQnXaU56ZrK5SlVsq70LMF7TuX0XNTyvi1rThzLST3TgOCgxwD0DPwDGoE07QkcSl/m5ynbHWmZVm6b0sp9o2DZN8aTZtqk9w9b2G2HLbbvsjlx+fry0vwU0OS5SH68Ylmilny3c3x9SOvpRuQN7hO8vqulZQ6WJMuXFAzcRfkDd5BG8B1bpc+nU0+fQtgkYLIngOEJwGt/J9UxCIJg1whJ05Ul4IMejbsLqUUfOjJKQnCDr4ySHMeO1/UMIa3UmR9TUpj7ZdMFJK8yo6RaZjLAF/JqM/rifCO+yP4AycGmlgUaT9cZ0OYP2um5prjBLhtvLhy68Fs7RFqbRvSlf15ybGdyLcPJmcpfIcIuT4nqqt+Sa2vaZaby1FB+JGi1c9INhuiv9fpIysItIh3CVgVAzXfEE1evzse/bwr8bolcAXs+zcqKXksQc5+FD2D/svT06I8IYtaUeZLZzsVm+3oRDmON1Ok/2NKyIJSs0xnj84RknXG6zgGEE1It+rsPtrYuDOxBKAJLrO1qnW7+OpqeNxF4HWv6v4Rql3uFRvL/DATnc/29x4lmy2t4fXVjY+ASGwylm8DBvkSm2gpgx1Bpg4hyyysqVoUuFRw0z8+jXe40yiFsp1lpC9navlJpE9JIh7RVwfJywmKZO4Hkh02NZ1FilfkJLi1B4GhLPduAZGazHO9LGDX/WAj7+npzwUQqvuOBoo1Va91dj3Tdgyinc0Dae+HyIrxvc2npbCxlxrJvcW3CeSKDMhKCoexRYnUlSqg0xU0iIS5dXwzm6c/x9iKKEx8q2lkV5RARJCcm9We2sgsZhGZmgMYjJOU7UhpOIqhRwwlmEwrBZHgCBRKkKX4ySVvbmzQnXoSDHWCyS6SV20Ha+VaSFTiSE8/ttVheDe4NarLxVB1kdE0fYAgjGaOWGYD1vxKrqmInkSBchRkmiuC4KILhonAo4+9gWVHYnElQMEsAxbRDSHtp7dq5CRWly2VlZe/EFRcvDcBQvBTPZeXly1JMpvlThzBBRASBoDsSBIpgOBQV6C+sUJzffwflQX8BTevCTZMZeoslUo9QJJZYTZDw3RuIKtIhlhXdfhDoJ7TTXY/XdBBpgUshwFMSRYTVwim7FJvt6aFyOnoVKqc7MZQDzzNwsmnd3UegCudl8R2qzHZ7bJbQoYGyn692+zMULCfXenoOacTOTBUnJYRFsq+5+a3sjp5BXM6hEz7ObHNoVEIHyocekiX6WIiykwWDd1HhzT8RzY2YqxnK0HNQBJtW500ddiwrDgdIeCABZ4MPnKQdk9xDhUP3wfHSqbBI9v/e9jo0Iy30cCOgAMyVgMMVCMwql/cQxfKp2R1dWWrRm0PzUkrIXC9ykDY+hnJ5DqkE709guriwSRgGzWTQCPABWJZ6vbNHQlgo099+CCEMPnF6xnwynYETEWd8ls0WPUpSWnTrfuAhAWacPslUiQRNLBGXFSA7TrL8V3gNhesTnLFY0jb+bYWVp0i7SClY184jVtcayi7so2yuA0r4npbjsV8CJHZhPQ7no323cJ5w8FqpLwR/YJNRnHs0hNGs6ZFw/Lpsb+9oj/dZSbuL0XUNojx4d9Gch5mOT0ImINsdKyHzT9Muz1lcXhRWbo9a8J3B72H8Lg6+bKb1hyWMPeERBXMGRxEBCM7Ddfh/1jDuWhb5+QkAAAAASUVORK5CYII=)](https://github.com/fastai/nbdev) -[![](https://img.shields.io/static/v1?label=View%20Demo%20Site&message=link&labelColor=2f363d&color=blue&style=flat&logo=github&logoColor=959da5)](https://fastpages.fast.ai/) +![](https://github.com/cspdf-bphc/blog/workflows/CI/badge.svg) +![](https://github.com/cspdf-bphc/blog/workflows/GH-Pages%20Status/badge.svg) +[![](https://img.shields.io/static/v1?label=fastai&message=fastpages&color=57aeac&labelColor=black&style=flat&logo=data:image/png;base64,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)](https://github.com/fastai/fastpages) -[//]: # (END OF BADGES SECTION) +https://cspdf-bphc.github.io/blog/ -# Welcome To `fastpages` +# My Blog -> An easy to use blogging platform, with support for Jupyter notebooks, Word docs, and Markdown. -![](images/diagram.png) +_powered by [fastpages](https://github.com/fastai/fastpages)_ -`fastpages` uses [GitHub Actions](https://github.com/features/actions) to simplify the process of creating [Jekyll blog posts](https://jekyllrb.com/) on [GitHub Pages](https://pages.github.com/) from a variety of input formats. -### `fastpages` provides the following features: +## What To Do Next? -- Create posts containing code, outputs of code (which can be interactive), formatted text, etc directly from [Jupyter Notebooks](https://jupyter.org/); Notebook posts support features such as: - - Interactive visualizations made with [Altair](https://altair-viz.github.io/) remain interactive. - - Hide or show cell input and output. - - Collapsable code cells that are either open or closed by default. - - Define the Title, Summary and other metadata via a special markdown cells - - Ability to add links to [Colab](https://colab.research.google.com/) and GitHub automatically. -- Support for comments, supported natively through GitHub Issues. -- Built-in search. -- Support for customizing the styling of your site. -- Embed Twitter cards and YouTube videos. -- Categorization of blog posts by user-supplied tags for discoverability. -- Create and edit [Markdown](https://guides.github.com/features/mastering-markdown/) posts. -- Create posts, including formatting and images, directly from Microsoft Word documents. -- Write posts on your local machine and [preview them with live reload](#running-the-blog-on-your-local-machine). +Great! You have setup your repo. Now its time to start writing content. Some helpful links: -See below for a more detailed list of features. +- [Writing Blogs With Jupyter](https://github.com/fastai/fastpages#writing-blog-posts-with-jupyter) +- [Writing Blogs With Markdown](https://github.com/fastai/fastpages#writing-blog-posts-with-markdown) -**[See the demo site](https://fastpages.fast.ai/)** +- [Writing Blog Posts With Word](https://github.com/fastai/fastpages#writing-blog-posts-with-microsoft-word) ---- +- [(Optional) Preview Your Blog Locally](_fastpages_docs/DEVELOPMENT.md) - +Note: you may want to remove example blog posts from the `_posts`, `_notebooks` or `_word` folders (but leave them empty, don't delete these folders) if you don't want these blog posts to appear on your site. -- [Welcome To `fastpages`](#welcome-to-fastpages) - - [`fastpages` provides the following features:](#fastpages-provides-the-following-features) - - [Setup Instructions](#setup-instructions) - - [Customizing Blog Posts With Front Matter](#customizing-blog-posts-with-front-matter) - - [Configure Title & Summary](#configure-title--summary) - - [Table of Contents](#table-of-contents) - - [Colab, Binder and GitHub Badges](#colab-binder-and-github-badges) - - [Categories](#categories) - - [Enabling Comments](#enabling-comments) - - [Setting an Image For Social Media](#setting-an-image-for-social-media) - - [Hiding A Blog Post](#hiding-a-blog-post) - - [Pinning A Blog Post](#pinning-a-blog-post) - - [Toggle Search Visibility](#toggle-search-visibility) - - [Site Wide Configuration Options](#site-wide-configuration-options) - - [Syntax Highlighting](#syntax-highlighting) - - [Writing Blog Posts With Jupyter](#writing-blog-posts-with-jupyter) - - [Hide Input/Output Cells](#hide-inputoutput-cells) - - [Collapsable Code Cells](#collapsable-code-cells) - - [Embedded Twitter and YouTube Content](#embedded-twitter-and-youtube-content) - - [Adding Footnotes](#adding-footnotes) - - [Automatically Convert Notebooks To Blog Posts](#automatically-convert-notebooks-to-blog-posts) - - [Writing Blog Posts With Markdown](#writing-blog-posts-with-markdown) - - [Writing Blog Posts With Microsoft Word](#writing-blog-posts-with-microsoft-word) - - [Specifying front-matter for Word documents](#specifying-front-matter-for-word-documents) -- [Running the blog on your local machine](#running-the-blog-on-your-local-machine) -- [Using The GitHub Action & Your Own Custom Blog](#using-the-github-action--your-own-custom-blog) - - [Optional Inputs](#optional-inputs) -- [Contributing To Fastpages](#contributing-to-fastpages) -- [Upgrading Fastpages](#upgrading-fastpages) -- [FAQ](#faq) -- [Customizing Fastpages](#customizing-fastpages) -- [Troubleshooting fastpages](#troubleshooting-fastpages) - - - - -## Setup Instructions - -1. Generate a copy of this repo by clicking [on this link](https://github.com/fastai/fastpages/generate). Name your repo anything you like **except** {your-username}.github.io. - -2. **GitHub Actions will automatically open a PR** on your new repository ~ 30 seconds after the copy is created. Follow the instructions in that PR to continue. - -For a live walk-through of the setup steps (with some additional tips) see this [video tutorial of setting up a fastpages blog](https://youtu.be/L0boq3zqazI) by Abdul Majed. - - -## Customizing Blog Posts With Front Matter - -[Front matter](https://jekyllrb.com/docs/front-matter/) allows you to toggle various options on/off for each blog post, as well as pass metadata to various features of fastpages. - -In a notebook, front matter is defined as a markdown cell at the beginning of the notebook with the following contents: - - ```markdown - # "Title" - > "Awesome summary" - - - toc: false - - branch: master - - badges: true - - comments: true - - categories: [fastpages, jupyter] - - image: images/some_folder/your_image.png - - hide: false - - search_exclude: true - - metadata_key1: metadata_value1 - - metadata_key2: metadata_value2 - ``` - -Similarly, in a markdown document the same front matter would be defined like this at the beginning of the document: - - ```yaml - --- - title: "My Title" - description: "Awesome description" - layout: post - toc: false - comments: true - image: images/some_folder/your_image.png - hide: false - search_exclude: true - categories: [fastpages, jupyter] - metadata_key1: metadata_value1 - metadata_key2: metadata_value2 - --- - ``` - -Additional metadata is optional and allows you to set custom [front matter](https://jekyllrb.com/docs/front-matter/). - -Note that anything defined in front matter must be valid YAML. **Failure to provide valid YAML could result in your page not rendering** in your blog. For example, if you want a colon in your title you must escape it with double quotes like this: - -` - title: "Deep learning: A tutorial"` - -See this [tutorial on YAML](https://rollout.io/blog/yaml-tutorial-everything-you-need-get-started/) for more information. - -### Configure Title & Summary - - Replace `Title`, with your desired title, and `Awesome summary` with your desired summary. - -**Note:** It is recommended to enclose these values in double quotes, so that you can escape colons and other characters that may break the YAML parser. - -### Table of Contents - - `fast_template` will automatically generate a table of contents for you based on [markdown headers](https://guides.github.com/features/mastering-markdown/)! You can toggle this feature on or off by setting `toc:` to either `true` or `false`. - -### Colab, Binder and GitHub Badges - -This option works for **notebooks only** - - - The `branch` field is used to optionally render a link your notebook to Colab and GitHub in your blog post post. It'll default to `master` if you don't specify it in the notebook. - - If you do not want to show Colab / GitHub badges on your blog post (perhaps because your repo is private and the links would be broken) set `badges` to `false`. This defaults to `true` - - By default, when you omit this parameter from your front matter, or you set `badges: true`, **all three badges (GitHub, Binder, Colab)** will appear by default. You can adjust these defaults in with the `default_badges` parameter in [Site Wide Configuration Options](#site-wide-configuration-options). - - If only want to hide a badge on an individual post, you can set the front matter `hide_{github,colab,binder}_badge: true`. For example, if you wanted to hide the Binder badge for an individual notebook but you want the other badges to show up, you can set this in your front matter: - - ```yaml - - badges: true - - hide_binder_badge: true - ``` - - **Note about Binder**: Binder allows you to customize the dependencies and other aspects of the Jupyter Notebook environment for your readers. The easiest way is to add a `requirements.txt` file with common packages you use for all your notebooks at the root of your repository, you can learn more [on the official Binder docs](https://mybinder.readthedocs.io/en/latest/introduction.html). - -### Categories - - You can have a comma seperated list inside square brackets of categories for a blog post, which will make the post visible on the tags page of your blog's site. For example: - - In a notebook: - - ``` - # "My Title" - - categories: [fastpages, jupyter] - ``` - - In a markdown document: - - ``` - --- - title: "My Title" - categories: [fastpages, jupyter] - --- - ``` - - You can see a preview of what this looks like [here](https://fastpages.fast.ai/categories/). - - - - You can toggle the display of tags on/off by setting `show_tags` to `true` or `false` in `_config.yml`: - -```yaml -# Set this to true to display tags on each post -show_tags: true -``` - -### Enabling Comments - -Blog posting is powered by [Utterances](https://github.com/utterance/utterances), an open-source and ad-free way of implementing comments. All comments are stored in issues on your blog's GitHub repo. You can turn this on setting `comments` to `true`. This defaults to `false`. - -To enable comments with [Utterances](https://github.com/utterance/utterances) you will need to do the following: - - - Make sure the repo is public, otherwise your readers will not be able to view the issues/comments. - - Make sure the [utterances app](https://github.com/apps/utterances) is installed on the repo, otherwise users will not be able to post comments. - - If your repo is a fork, navigate to it's settings tab and confirm the issues feature is turned on. - -### Setting an Image For Social Media - -On social media sites like Twitter, an image preview can be automatically shown with your URL. Specifying the front matter `image` provides this metadata to social media sites to render this image for you. You can set this value as follows: - -`- image: images/diagram.png` - -Note: for this setting **you can only reference image files and folders in the `/images` folder of your repo.** - -### Hiding A Blog Post - -You may want to prevent a blog post from being listed on the home page, but still have a public url that you can preview or share discreetly. You can hide a blog post from the home page by setting the front matter `hide` to `true`. This is set to `false` by default. - -It is recommended that you use [permalinks](https://jekyllrb.com/docs/permalinks/) in order to generate a predictable url for hidden blog posts. You can also set the front matter `search_exclude` to `false` if you don't want users to find your hidden post in a search. - -### Pinning A Blog Post - -By default, posts are sorted by date on your homepage. However, you may want one or more blog posts to always appear at the very top of your homepage. In other words, you may want certain posts to be "pinned" or "sticky". To accomplish this, specify the `sticky_rank` front matter in the order you would like your sticky posts to appear. Blog posts that do not set this parameter are sorted in the default way by date after the sticky posts. - -For example, consider these three markdown posts (also works for notebooks). - -`2020-01-01-Post-One.md` -```yaml ---- -title: Post One -sticky_rank: 1 ---- -``` - -`2020-02-01-Post-Two.md` -```yaml ---- -title: Post Two -sticky_rank: 2 ---- -``` - -`2020-04-01-Post-Three.md` -```yaml ---- -title: Post Three ---- -``` - -However, since `sticky_rank` is specified, blog posts will **first be sorted by sticky_rank in ascending order, then by date in descending order**, so the order of these posts will appear like so: - -- Post One -- Post Two -- Post Three - -_Without `sticky_rank` the above posts would actually be sorted in reverse order due to the dates associated with each post._ - -_Note: pinning also works for notebooks:_ - -``` -# "My cool blog post" -> "Description of blog post" - -- sticky_rank: 2 -``` - -### Toggle Search Visibility - -fastpages comes with built in keyword search powered by [lunr.js](https://lunrjs.com/). You can prevent a blog post or page from appearing in search results by setting the front matter `search_exclude` to `false`. This is set to `true` by default. - - -## Site Wide Configuration Options - -**It is recommended that everyone personalizes their blogging site by setting site-wide configration options**. These options can be found in `/_config.yml`. Below is a description of various options that are available. - -- `title`: this is the title that appears on the upper left hand corner on the header of all your pages. -- `description`: this description will show up in various places when a preview for your site is generated (for example, on social media). -- `github_username`: this allows your site to display a link to your GitHub page in the footer. -- `github_repo`: this allows your site to render links back to your repository for various features such as links to GitHub and Colab for notebooks. -- `url`: This does not need to be changed unless you have a custom domain. **Note: leave out the trailing / from this value.** -- `baseurl`: See the comments in `/_config.yml` for instructions ( "Special Instructions for baseurl" on setting this value properly. If you do not have a custom domain, then you can likely ignore this option. -- `email`: this is currently unused. Ignore. -- `twitter_username`: creates a link in your footer to your twitter page. -- `use_math`: Set this to `true` to get LaTeX math equation support. This is off by default as it otherwhise loads javascript into each page that may not be used. -- `show_description`: This shows a description under the title of your blog posts on your homepage that contains a list of your blog posts. Set to `true` by default. -- `google_analytics`: Optionally use a [Google Analytics](http://www.google.com/analytics/) ID for tracking if desired. -- `show_image`: If set to true, this uses the `image` parameter in the front matter of your blog posts to render a preview of your blogs as shown below. This is set to `false` by default. - When show_image is set to `true` your homepage will look like this: - - ![home page](/_fastpages_docs/_show_image_true.png) - -- `show_tags`: You can toggle the display of tags on your blog posts on or off by setting this value to `false`. This is set to `true` by default, which which renders the following links for tags on your blog posts like this: - - ![tags](_fastpages_docs/_post_tags.png) - -- `pagination`: This is the maximum number of posts to show on each page of your home page. Any posts exceeding this amount will be paginated onto another page. This is set to `15` by default. When this is triggered, you will see pagination at the bottom of your home page appear like this: - - ![paginate](_fastpages_docs/_paginate.png) - - Note: if you are using an older version of fastpages, **you cannot use the automated upgrade process** to get pagination. Instead you must follow these steps: - - 1. Rename your index.md file to index.html - > mv index.md index.html - 2. Replace the `Gemfile` and `Gemfile.lock` in the root of your repo with the files in this repo. - 3. Edit your `_config.yml` as follows (look at [_config.yml](_config.yml) for an example): - ```yaml - gems: - - jekyll-paginate - - paginate: 10 - paginate_path: /page:num/ - ``` - - _Alternatively, you can copy all of your posts over to a newly created repository created from the fastpages template._ - -- `default_badges`: By default GitHub, Binder, and Colab badges will show up on notebook blog posts. You can adjust these defaults by setting the appropriate value in `default_badges` to false. For example, if you wanted to turn Binder badges off by default, you would change `default_badges` to this: - - ```yaml - default_badges: - github: true - binder: false - colab: true - ``` - -- `html_escape`: this allows you to toggle escaping of HTML in various components of blog posts on or off. At this moment, you can only toggle this for the `description` field in your posts. -This is set to `false` by default. - -## Syntax Highlighting - -`fastpages` overrides the default syntax highlighting of minima with the [Dracula theme](https://draculatheme.com/). - -- The default highlighting in fastpages looks like this: - - ![default-highlighting](_fastpages_docs/highlight_dracula.png) - -- However, you can make the syntax highlighting to look like this, if you choose: - - ![default-highlighting](_fastpages_docs/highlight_original.png) - - If you wish to revert to the light theme above, you can remove the below line in [_sass/minima/custom-styles.scss](_sass/minima/custom-styles.scss) - - ```scss - @import "minima/fastpages-dracula-highlight"; - ``` -- If you don't like either of these themes, you can add your own CSS in [`_sass/minima/custom-styles.scss`](_sass/minima/custom-styles.scss). See [customizing fastpages](#customizing-fastpages) for more details. - -## Writing Blog Posts With Jupyter - -### Hide Input/Output Cells - -Place the comment `#hide` at the beginning of a code cell and it wil **hide both the input and the output** of that cell. - -A `#hide_input` comment at the top of any cell will **only hide the input**. - -Furthermore, the `hide input` [Jupyter Extension](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/nbextensions/hide_input/readme.html) can be used to hide cell inputs or outputs, which will be respected by fastpages. - -### Collapsable Code Cells - -You may want some code to be hidden in a collapsed element that the user can expand, rather than completely hiding the code from the reader. - -- To include code in a collapsable cell that **is collapsed by default**, place the comment `#collapse` at the top of the code cell. -- To include code in a collapsable cell that **is open by default**, place the comment `#collapse_show` or `#collapse-show` at the top of the code cell. - -### Embedded Twitter and YouTube Content -In a markdown cell in your notebook, use the following markdown shortcuts to embed Twitter cards and YouTube Videos. - - - ```markdown - > youtube: https://youtu.be/your-link - > twitter: https://twitter.com/some-link - ``` -### Adding Footnotes - -Adding footnotes in notebooks is a bit different than markdown. Please the [Detailed Guide To Footnotes in Notebooks](https://github.com/fastai/fastpages/blob/master/_fastpages_docs/NOTEBOOK_FOOTNOTES.md). - -### Automatically Convert Notebooks To Blog Posts - -1. Save your notebook with the naming convention `YYYY-MM-DD-*.` into the `/_notebooks` or `/_word` folder of this repo, respectively. For example `2020-01-28-My-First-Post.ipynb`. This [naming convention is required by Jekyll](https://jekyllrb.com/docs/posts/) to render your blog post. - - Be careful to name your file correctly! It is easy to forget the last dash in `YYYY-MM-DD-`. Furthermore, the character immediately following the dash should only be an alphabetical letter. Examples of valid filenames are: - - ```shell - 2020-01-28-My-First-Post.ipynb - 2012-09-12-how-to-write-a-blog.ipynb - ``` - - - If you fail to name your file correctly, `fastpages` will automatically attempt to fix the problem by prepending the last modified date of your file to your generated blog post, however, it is recommended that you name your files properly yourself for more transparency. - - -2. [Commit and push](https://help.github.com/en/github/managing-files-in-a-repository/adding-a-file-to-a-repository-using-the-command-line) your file(s) to GitHub in your repository's master branch. - -3. GitHub will automatically convert your files to blog posts. **It will take ~5 minutes for the conversion process to take place**. You can click on the Actions tab of your repo to view the logs of this process. There will be two workflows that are triggered with each push you make to your master branch: (1) "CI" and (2) "GH Pages Status". Both workflows must complete with a green checkmark for your latest commit before your site is updated. - -4. If you wish, you can preview how your blog will look locally before commiting to GitHub. See [this section](#running-the-blog-on-your-local-machine) for a detailed guide on running the preview locally. - - -## Writing Blog Posts With Markdown - -If you are writing your blog post in markdown, save your `.md` file into the `/_posts` folder with the same naming convention (`YYYY-MM-DD-*.md`) specified for notebooks. - -## Writing Blog Posts With Microsoft Word - -Save your Microsoft Word documents into the `/_word` folder with the same naming convention (`YYYY-MM-DD-*.docx`) specified for notebooks. - -_Note:_ [alt text](https://support.office.com/en-us/article/add-alternative-text-to-a-shape-picture-chart-smartart-graphic-or-other-object-44989b2a-903c-4d9a-b742-6a75b451c669) in Word documents are not yet supported by fastpages, and will break links to images. - -### Specifying front-matter for Word documents - -`fastpages` does not have a robust way to specify [front matter](https://jekyllrb.com/docs/front-matter/) for Word documents. At the moment, you can only specify front matter globally for all Word documents by editing [_action_files/word_front_matter.txt](_action_files/word_front_matter.txt). - -To specify unique front matter per Word document, you will need to convert Word to markdown files manually. You can follow the steps in this [blog post](https://www.fast.ai/2020/01/18/gitblog/), which walk you through how to use [pandoc](https://pandoc.org/installing.html) to do the conversion. Note: If you wish to customize your Word generated blog post in markdown, make sure you delete your Word document from the _word directory so your markdown file doesn’t get overwritten! - -_If your primary method of writing blog posts is Word documents, and you plan on always manually editing markdown files converted from Word, you are probably better off using [fast_template](https://github.com/fastai/fast_template) instead of fastpages._ - -# Running the blog on your local machine - -See the [development guide](_fastpages_docs/DEVELOPMENT.md). - - -# Using The GitHub Action & Your Own Custom Blog - -The `fastpages` action allows you to convert notebooks from `/_notebooks` and word documents from `/_word` directories in your repo into [Jekyll](https://jekyllrb.com/) compliant blog post markdown files located in `/_posts`. **Note: This directory structure is currently inflexible** for this Action, as it is designed to be used with Jekyll. - -If you already have sufficient familiarity with [Jekyll](https://jekyllrb.com/) and wish to use this automation in your own theme, you can use this GitHub Action by referencing `fastai/fastpages@master` as follows: - -```yaml -... - -uses: fastai/fastpages@master - -... -``` -An illustrative example of what a complete workflow may look like: - - - -```yaml -jobs: - build-site: - runs-on: ubuntu-latest - ... - - - name: convert notebooks and word docs to posts - uses: fastai/fastpages@master - - ... - - - name: Jekyll build - uses: docker://jekyll/jekyll - with: - args: jekyll build - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.event_name == 'push' - with: - deploy_key: ${{ secrets.SSH_DEPLOY_KEY }} - publish_branch: gh-pages - publish_dir: ./_site -``` - -Note that this Action **does not have any required inputs, and has no output variables**. - -### Optional Inputs - - - `BOOL_SAVE_MARKDOWN`: Either 'true' or 'false'. Whether or not to commit converted markdown files from notebooks and word documents into the _posts directory in your repo. This is useful for debugging. _default: false_ - - `SSH_DEPLOY_KEY`: a ssh deploy key is required if BOOL_SAVE_MARKDOWN = 'true' - -See the API spec for this action in [action.yml](action.yml) - -Detailed instructions on how to customize this blog are beyond the scope of this README. ( We invite someone from the community to contribute a blog post on how to do this in this repo! ) - -# Contributing To Fastpages - -Please see the [contributing guide](_fastpages_docs/CONTRIBUTING.md). - -# Upgrading Fastpages - -Please see the [upgrading guide](_fastpages_docs/UPGRADE.md). - -# FAQ - -- **Q:** Where are the markdown files in `_posts/` that are generated from my Jupyter notebooks or word documents? **A:** The GitHub Actions workflow in this repo converts your notebook and word documents to markdown on the fly before building your site, but never commits these intermediate markdown files to this repo. This is in order to save you from the annoyance of your local environment being constantly out of sync with your repository. You can optionally see these intermediate markdown files by setting the `BOOL_SAVE_MARKDOWN` and `SSH_DEPLOY_KEY` inputs to the fastpages action in your `.github/workflows/ci.yaml` file as follows: - -```yaml - ... - - - name: convert notebooks and word docs to posts - uses: fastai/fastpages@master - with: - BOOL_SAVE_MARKDOWN: true - SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} - - ... -``` - -- **Q:** Can I use `fastpages` for Jekyll docs sites or for things that are not Jekyll blog posts? **A:** At the moment, `fastpages` is a highly opinionated solution that works only for Jekyll blog posts. If you want to write documentation for your module or library with Jupyter notebooks, we suggest you use [fastai/nbdev](https://github.com/fastai/nbdev) which is expressly built for this purpose. - -- **Q:** What is the difference between [fast_template](https://github.com/fastai/fast_template) and fastpages? Which one should I use? **A:** Because `fastpages` is more flexible and extensible, we recommend using it where possible. `fast_template` may be a better option for getting folks blogging who have no technical expertise at all, and will only be creating posts using Github's integrated online editor. - -# Customizing Fastpages - -fastpages builds upon the [minima theme](https://github.com/jekyll/minima). If you want to customize the styling or layout of fastpages, you can find instructions [in minima's README](https://github.com/jekyll/minima/blob/master/README.md). It is a good idea to read the full contents of the README to understand the directory structure. Furthermore, it is a good idea to have a basic understanding of Jekyll before customizing your theme. For those new to Jekyll, [the official docs](https://jekyllrb.com/docs/) are a good place to start. Concretely, you can override css in fastpages in `_sass/minima/custom-styles.scss`. - -**If you choose to make customizations to fastpages** It is possible that customizations you make could collide with current or future versions of fastpages and we recommend doing so only if you feel sufficiently comfortable with HTML and CSS. - -# Troubleshooting fastpages - -Please see the [troubleshooting guide](https://github.com/fastai/fastpages/blob/master/_fastpages_docs/TROUBLESHOOTING.md). +Please use the [nbdev & blogging channel](https://forums.fast.ai/c/fastai-users/nbdev/48) in the fastai forums for any questions or feature requests. diff --git a/_action_files/settings.ini b/_action_files/settings.ini index 415570d..1f80094 100644 --- a/_action_files/settings.ini +++ b/_action_files/settings.ini @@ -7,7 +7,7 @@ description = Writing a library entirely in notebooks keywords = jupyter notebook author = Sylvain Gugger and Jeremy Howard author_email = info@fast.ai -baseurl = +baseurl = /blog title = nbdev copyright = fast.ai license = apache2 @@ -41,3 +41,4 @@ custom_sidebar = False cell_spacing = 1 monospace_docstrings = False jekyll_styles = note,warning,tip,important,youtube,twitter + diff --git a/_config.yml b/_config.yml index c86c4e6..39d3609 100644 --- a/_config.yml +++ b/_config.yml @@ -8,13 +8,13 @@ title: fastpages description: An easy to use blogging platform with support for Jupyter Notebooks. -github_username: fastai +github_username: cspdf-bphc # you can comment the below line out if your repo name is not different than your baseurl -github_repo: "fastpages" +github_repo: "blog" # OPTIONAL: override baseurl and url if using a custom domain # Note: leave out the trailing / from this value. -url: "https://fastpages.fast.ai" # the base hostname & protocol for your site, e.g. http://example.com +url: "https://cspdf-bphc.github.io" # the base hostname & protocol for your site, e.g. http://example.com ########################################################### ######### Special Instructions for baseurl ############### @@ -34,7 +34,7 @@ url: "https://fastpages.fast.ai" # the base hostname & protocol for your site, e # # 3. You must replace the parameter `baseurl` in _action_files/settings.ini with the same value as you set here but WITHOUT QUOTES. # -baseurl: "" # the subpath of your site, e.g. "/blog". +baseurl: "/blog" # the subpath of your site, e.g. "/blog". # Github and twitter are optional: minima: @@ -55,7 +55,7 @@ show_image: false show_tags: true # Add your Google Analytics ID here if you have one and want to use it -google_analytics: UA-57531313-5 +google_analytics: exclude: - docker-compose.yml diff --git a/_fastpages_docs/_setup_pr_template.md b/_fastpages_docs/_setup_pr_template.md index ee71d2e..aaac024 100644 --- a/_fastpages_docs/_setup_pr_template.md +++ b/_fastpages_docs/_setup_pr_template.md @@ -1,25 +1,25 @@ -Hello :wave: @{_username_}! Thank you for using fastpages! +Hello :wave: @cspdf-bphc! Thank you for using fastpages! ## Before you merge this PR 1. Create an ssh key-pair. Open this utility. Select: `RSA` and `4096` and leave `Passphrase` blank. Click the blue button `Generate-SSH-Keys`. -2. Navigate to this link and click `Add a new secret`. Copy and paste the **Private Key** into the `Value` field. This includes the "---BEGIN RSA PRIVATE KEY---" and "--END RSA PRIVATE KEY---" portions. In the `Name` field, name the secret `SSH_DEPLOY_KEY`. +2. Navigate to this link and click `Add a new secret`. Copy and paste the **Private Key** into the `Value` field. This includes the "---BEGIN RSA PRIVATE KEY---" and "--END RSA PRIVATE KEY---" portions. In the `Name` field, name the secret `SSH_DEPLOY_KEY`. -3. Navigate to this link and click the `Add deploy key` button. Paste your **Public Key** from step 1 into the `Key` box. In the `Title`, name the key anything you want, for example `fastpages-key`. Finally, **make sure you click the checkbox next to `Allow write access`** (pictured below), and click `Add key` to save the key. +3. Navigate to this link and click the `Add deploy key` button. Paste your **Public Key** from step 1 into the `Key` box. In the `Title`, name the key anything you want, for example `fastpages-key`. Finally, **make sure you click the checkbox next to `Allow write access`** (pictured below), and click `Add key` to save the key. ![](https://raw.githubusercontent.com/fastai/fastpages/master/_fastpages_docs/_checkbox.png) ### What to Expect After Merging This PR -- GitHub Actions will build your site, which will take 2-3 minutes to complete. **This will happen anytime you push changes to the master branch of your repository.** You can monitor the logs of this if you like on the [Actions tab of your repo](https://github.com/{_username_}/{_repo_name_}/actions). +- GitHub Actions will build your site, which will take 2-3 minutes to complete. **This will happen anytime you push changes to the master branch of your repository.** You can monitor the logs of this if you like on the [Actions tab of your repo](https://github.com/cspdf-bphc/blog/actions). - Your GH-Pages Status badge on your README will eventually appear and be green, indicating your first sucessfull build. -- You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/{_username_}/{_repo_name_}/settings). +- You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/cspdf-bphc/blog/settings). If you are not using a custom domain, your website will appear at: -#### https://{_username_}.github.io/{_repo_name_} +#### https://cspdf-bphc.github.io/blog ## Optional: Using a Custom Domain diff --git a/_notebooks/2020-02-21-introducing-fastpages.ipynb b/_notebooks/2020-02-21-introducing-fastpages.ipynb deleted file mode 100644 index b457874..0000000 --- a/_notebooks/2020-02-21-introducing-fastpages.ipynb +++ /dev/null @@ -1,564 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# Introducing fastpages\n", - "> An easy to use blogging platform with extra features for Jupyter Notebooks.\n", - "\n", - "- toc: true \n", - "- badges: true\n", - "- comments: true\n", - "- sticky_rank: 1\n", - "- author: Jeremy Howard & Hamel Husain\n", - "- image: images/diagram.png\n", - "- categories: [fastpages, jupyter]" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "![](https://github.com/fastai/fastpages/raw/master/images/diagram.png \"https://github.com/fastai/fastpages\")\n", - "\n", - "We are very pleased to announce the immediate availability of [fastpages](https://github.com/fastai/fastpages). `fastpages` is a platform which allows you to create and host a blog for free, with no ads and many useful features, such as:\n", - "\n", - "- Create posts containing code, outputs of code (which can be interactive), formatted text, etc directly from [Jupyter Notebooks](https://jupyter.org/); for instance see this great [example post](https://drscotthawley.github.io/devblog3/2019/02/08/My-1st-NN-Part-3-Multi-Layer-and-Backprop.html) from Scott Hawley. Notebook posts support features such as:\n", - " - Interactive visualizations made with [Altair](https://altair-viz.github.io/) remain interactive.\n", - " - Hide or show cell input and output.\n", - " - Collapsable code cells that are either open or closed by default.\n", - " - Define the Title, Summary and other metadata via a special markdown cells\n", - " - Ability to add links to [Colab](https://colab.research.google.com/) and GitHub automatically.\n", - "- Create posts, including formatting and images, directly from Microsoft Word documents.\n", - "- Create and edit [Markdown](https://guides.github.com/features/mastering-markdown/) posts entirely online using GitHub's built-in markdown editor.\n", - "- Embed Twitter cards and YouTube videos.\n", - "- Categorization of blog posts by user-supplied tags for discoverability.\n", - "- ... and [much more](https://github.com/fastai/fastpages)\n", - "\n", - "[fastpages](https://github.com/fastai/fastpages) relies on Github pages for hosting, and [Github Actions](https://github.com/features/actions) to automate the creation of your blog. The setup takes around three minutes, and does not require any technical knowledge or expertise. Due to built-in automation of fastpages, you don't have to fuss with conversion scripts. All you have to do is save your Jupyter notebook, Word document or markdown file into a specified directory and the rest happens automatically. Infact, this blog post is written in a Jupyter notebook, which you can see with the \"View on GitHub\" link above.\n", - "\n", - "[fast.ai](https://www.fast.ai/) have previously released a similar project called [fast_template](https://www.fast.ai/2020/01/16/fast_template/), which is even easier to set up, but does not support automatic creation of posts from Microsoft Word or Jupyter notebooks, including many of the features outlined above.\n", - "\n", - "**Because `fastpages` is more flexible and extensible, we recommend using it where possible.** `fast_template` may be a better option for getting folks blogging who have no technical expertise at all, and will only be creating posts using Github's integrated online editor." - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Setting Up Fastpages\n", - "\n", - "[The setup process](https://github.com/fastai/fastpages#setup-instructions) of fastpages is automated with GitHub Actions, too! Upon creating a repo from the fastpages template, a pull request will automatically be opened (after ~ 30 seconds) configuring your blog so it can start working. The automated pull request will greet you with instructions like this:\n", - "\n", - "![Imgur](https://i.imgur.com/JhkIip8.png)\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "All you have to do is follow these instructions (in the PR you receive) and your new blogging site will be up and running!" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Jupyter Notebooks & Fastpages\n", - "\n", - "In this post, we will cover special features that fastpages provides has for Jupyter notebooks. You can also write your blog posts with Word documents or markdown in fastpages, which contain many, but not all the same features. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Options via FrontMatter\n", - "\n", - "The first cell in your Jupyter Notebook or markdown blog post contains front matter. Front matter is metadata that can turn on/off options in your Notebook. It is formatted like this:\n", - "\n", - "```\n", - "# Title\n", - "> Awesome summary\n", - "\n", - "- toc: true\n", - "- branch: master\n", - "- badges: true\n", - "- comments: true\n", - "- author: Hamel Husain & Jeremy Howard\n", - "- categories: [fastpages, jupyter]\n", - "```\n", - "\n", - "**All of the above settings are enabled in this post, so you can see what they look like!**\n", - "\n", - "- the summary field (preceeded by `>`) will be displayed under your title, and will also be used by social media to display as the description of your page.\n", - "- `toc`: setting this to `true` will automatically generate a table of contents\n", - "- `badges`: setting this to `true` will display Google Colab and GitHub links on your blog post.\n", - "- `comments`: setting this to `true` will enable comments. See [these instructions](https://github.com/fastai/fastpages#enabling-comments) for more details.\n", - "- `author` this will display the authors names. \n", - "- `categories` will allow your post to be categorized on a \"Tags\" page, where readers can browse your post by categories.\n", - "\n", - "\n", - "_Markdown front matter is formatted similarly to notebooks. The differences between the two can be [viewed on the fastpages README](https://github.com/fastai/fastpages#front-matter-related-options)._" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Code Folding" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "put a `#collapse-hide` flag at the top of any cell if you want to **hide** that cell by default, but give the reader the option to show it:" - ] - }, - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "#collapse-hide\n", - "import pandas as pd\n", - "import altair as alt" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "put a `#collapse-show` flag at the top of any cell if you want to **show** that cell by default, but give the reader the option to hide it:" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "#collapse-show\n", - "cars = 'https://vega.github.io/vega-datasets/data/cars.json'\n", - "movies = 'https://vega.github.io/vega-datasets/data/movies.json'\n", - "sp500 = 'https://vega.github.io/vega-datasets/data/sp500.csv'\n", - "stocks = 'https://vega.github.io/vega-datasets/data/stocks.csv'\n", - "flights = 'https://vega.github.io/vega-datasets/data/flights-5k.json'" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "If you want to completely hide cells (not just collapse them), [read these instructions](https://github.com/fastai/fastpages#hide-inputoutput-cells)." - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, - "outputs": [], - "source": [ - "# hide\n", - "df = pd.read_json(movies) # load movies data\n", - "genres = df['Major_Genre'].unique() # get unique field values\n", - "genres = list(filter(lambda d: d is not None, genres)) # filter out None values\n", - "genres.sort() # sort alphabetically" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Interactive Charts With Altair\n", - "\n", - "Interactive visualizations made with [Altair](https://altair-viz.github.io/) remain interactive! \n", - "\n", - "We leave this below cell unhidden so you can enjoy a preview of syntax highlighting in fastpages, which uses the [Dracula theme](https://draculatheme.com/)." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "
\n", - "" - ], - "text/plain": [ - "alt.LayerChart(...)" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "# select a point for which to provide details-on-demand\n", - "label = alt.selection_single(\n", - " encodings=['x'], # limit selection to x-axis value\n", - " on='mouseover', # select on mouseover events\n", - " nearest=True, # select data point nearest the cursor\n", - " empty='none' # empty selection includes no data points\n", - ")\n", - "\n", - "# define our base line chart of stock prices\n", - "base = alt.Chart().mark_line().encode(\n", - " alt.X('date:T'),\n", - " alt.Y('price:Q', scale=alt.Scale(type='log')),\n", - " alt.Color('symbol:N')\n", - ")\n", - "\n", - "alt.layer(\n", - " base, # base line chart\n", - " \n", - " # add a rule mark to serve as a guide line\n", - " alt.Chart().mark_rule(color='#aaa').encode(\n", - " x='date:T'\n", - " ).transform_filter(label),\n", - " \n", - " # add circle marks for selected time points, hide unselected points\n", - " base.mark_circle().encode(\n", - " opacity=alt.condition(label, alt.value(1), alt.value(0))\n", - " ).add_selection(label),\n", - "\n", - " # add white stroked text to provide a legible background for labels\n", - " base.mark_text(align='left', dx=5, dy=-5, stroke='white', strokeWidth=2).encode(\n", - " text='price:Q'\n", - " ).transform_filter(label),\n", - "\n", - " # add text labels for stock prices\n", - " base.mark_text(align='left', dx=5, dy=-5).encode(\n", - " text='price:Q'\n", - " ).transform_filter(label),\n", - " \n", - " data=stocks\n", - ").properties(\n", - " width=700,\n", - " height=400\n", - ")" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "### Data Tables\n", - "\n", - "You can display tables per the usual way in your blog:" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - " | Title | \n", - "Worldwide_Gross | \n", - "Production_Budget | \n", - "IMDB_Rating | \n", - "
---|---|---|---|---|
0 | \n", - "The Land Girls | \n", - "146083.0 | \n", - "8000000.0 | \n", - "6.1 | \n", - "
1 | \n", - "First Love, Last Rites | \n", - "10876.0 | \n", - "300000.0 | \n", - "6.9 | \n", - "
2 | \n", - "I Married a Strange Person | \n", - "203134.0 | \n", - "250000.0 | \n", - "6.8 | \n", - "
3 | \n", - "Let's Talk About Sex | \n", - "373615.0 | \n", - "300000.0 | \n", - "NaN | \n", - "
4 | \n", - "Slam | \n", - "1087521.0 | \n", - "1000000.0 | \n", - "3.4 | \n", - "