diff --git a/Gemfile b/Gemfile index ff35341..e3aacc5 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ source "https://rubygems.org" # # This will help ensure the proper Jekyll version is running. # Happy Jekylling! -gem "jekyll", "~> 4.0.0" +gem "jekyll", "~> 4.1.0" # This is the default theme for new Jekyll sites. You may change this to anything you like. gem "minima" # To upgrade, run `bundle update github-pages`. diff --git a/Gemfile.lock b/Gemfile.lock index c2272d5..b8aa71f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.1) + activesupport (6.0.3.3) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -10,7 +10,7 @@ GEM addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) colorator (1.1.0) - concurrent-ruby (1.1.6) + concurrent-ruby (1.1.7) em-websocket (0.5.1) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) @@ -18,37 +18,37 @@ GEM execjs (2.7.0) faraday (0.17.3) multipart-post (>= 1.2, < 3) - ffi (1.12.2) + ffi (1.13.1) forwardable-extended (2.6.0) gemoji (3.0.1) - html-pipeline (2.12.3) + html-pipeline (2.14.0) activesupport (>= 2) nokogiri (>= 1.4) http_parser.rb (0.6.0) - i18n (1.8.2) + i18n (1.8.5) concurrent-ruby (~> 1.0) - jekyll (4.0.0) + jekyll (4.1.1) addressable (~> 2.4) colorator (~> 1.0) em-websocket (~> 0.5) - i18n (>= 0.9.5, < 2) + i18n (~> 1.0) jekyll-sass-converter (~> 2.0) jekyll-watch (~> 2.0) kramdown (~> 2.1) kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.3.3) + mercenary (~> 0.4.0) pathutil (~> 0.9) rouge (~> 3.0) safe_yaml (~> 1.0) terminal-table (~> 1.8) - jekyll-feed (0.13.0) + jekyll-feed (0.15.0) jekyll (>= 3.7, < 5.0) jekyll-gist (1.5.0) octokit (~> 4.2) - jekyll-octicons (9.5.0) + jekyll-octicons (11.0.0) jekyll (>= 3.6, < 5.0) - octicons (= 9.5.0) + octicons (= 11.0.0) jekyll-paginate (1.1.0) jekyll-relative-links (0.6.1) jekyll (>= 3.3, < 5.0) @@ -63,9 +63,9 @@ GEM jekyll (>= 3.3, < 5.0) jekyll-sitemap (1.4.0) jekyll (>= 3.7, < 5.0) - jekyll-toc (0.13.1) - jekyll (>= 3.7) - nokogiri (~> 1.9) + jekyll-toc (0.14.0) + jekyll (>= 3.8) + nokogiri (~> 1.10) jekyll-twitter-plugin (2.1.0) jekyll-watch (2.2.1) listen (~> 3.0) @@ -86,34 +86,32 @@ GEM listen (3.2.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_portile2 (2.5.0) + mercenary (0.4.0) + mini_portile2 (2.4.0) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) - minitest (5.14.1) + minitest (5.14.2) multipart-post (2.1.1) - nokogiri (1.11.0) - mini_portile2 (~> 2.5.0) - racc (~> 1.4) - octicons (9.5.0) + nokogiri (1.10.10) + mini_portile2 (~> 2.4.0) + octicons (11.0.0) nokogiri (>= 1.6.3.1) - octokit (4.16.0) + octokit (4.18.0) faraday (>= 0.9) sawyer (~> 0.8.0, >= 0.5.3) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.3) - racc (1.5.2) - rb-fsevent (0.10.3) + public_suffix (4.0.6) + rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) rexml (3.2.4) - rouge (3.16.0) - rubyzip (2.2.0) + rouge (3.23.0) + rubyzip (2.3.0) safe_yaml (1.0.5) - sassc (2.2.1) + sassc (2.4.0) ffi (~> 1.9) sawyer (0.8.2) addressable (>= 2.3.5) @@ -121,20 +119,20 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) - tzinfo (1.2.6) + tzinfo (1.2.7) thread_safe (~> 0.1) - tzinfo-data (1.2019.3) + tzinfo-data (1.2020.1) tzinfo (>= 1.0.0) - unicode-display_width (1.6.1) + unicode-display_width (1.7.0) wdm (0.1.1) - zeitwerk (2.3.0) + zeitwerk (2.4.0) PLATFORMS ruby DEPENDENCIES faraday (< 1.0) - jekyll (~> 4.0.0) + jekyll (~> 4.1.0) jekyll-feed (~> 0.12) jekyll-gist jekyll-octicons diff --git a/Makefile b/Makefile index d8cc6d1..60f5db9 100644 --- a/Makefile +++ b/Makefile @@ -15,15 +15,13 @@ server-detached: .FORCE build: .FORCE chmod 777 Gemfile.lock docker-compose stop || true; docker-compose rm || true; - docker build --no-cache -t hamelsmu/fastpages-nbdev -f _action_files/fastpages-nbdev.Dockerfile . - docker build --no-cache -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile . + docker build --no-cache -t fastai/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile . docker-compose build --force-rm --no-cache # rebuild the services WITH cache quick-build: .FORCE docker-compose stop || true; - docker build -t hamelsmu/fastpages-nbdev -f _action_files/fastpages-nbdev.Dockerfile . - docker build -t hamelsmu/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile . + docker build -t fastai/fastpages-jekyll -f _action_files/fastpages-jekyll.Dockerfile . docker-compose build # convert word & nb without Jekyll services @@ -52,3 +50,4 @@ restart-jekyll: .FORCE docker-compose restart jekyll .FORCE: + chmod -R u+rw . diff --git a/_action_files/Dockerfile b/_action_files/Dockerfile index 1cbaeec..6f82bae 100644 --- a/_action_files/Dockerfile +++ b/_action_files/Dockerfile @@ -1,4 +1,4 @@ -FROM hamelsmu/fastpages-nbdev +FROM fastai/jekyll:2020-12-30 WORKDIR /fastpages COPY . . diff --git a/_action_files/action_entrypoint.sh b/_action_files/action_entrypoint.sh index 7a5be66..4850484 100755 --- a/_action_files/action_entrypoint.sh +++ b/_action_files/action_entrypoint.sh @@ -23,7 +23,7 @@ if [[ "$INPUT_BOOL_SAVE_MARKDOWN" == "true" ]];then # Get user's email from commit history if [[ "$GITHUB_EVENT_NAME" == "push" ]];then - USER_EMAIL=`cat $GITHUB_EVENT_PATH | jq '.commits | .[0] | .author.email'` + USER_EMAIL=$(jq '.commits | .[0] | .author.email' < "$GITHUB_EVENT_PATH") else USER_EMAIL="actions@github.com" fi @@ -38,10 +38,10 @@ if [[ "$INPUT_BOOL_SAVE_MARKDOWN" == "true" ]];then # Optionally save intermediate markdown if [[ "$INPUT_BOOL_SAVE_MARKDOWN" == "true" ]]; then - git pull fastpages-origin ${GITHUB_REF} --ff-only + git pull fastpages-origin "${GITHUB_REF}" --ff-only git add _posts git commit -m "[Bot] Update $INPUT_FORMAT blog posts" --allow-empty - git push fastpages-origin HEAD:${GITHUB_REF} + git push fastpages-origin HEAD:"$GITHUB_REF" fi fi diff --git a/_action_files/check_js.sh b/_action_files/check_js.sh new file mode 100755 index 0000000..61c9936 --- /dev/null +++ b/_action_files/check_js.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# The purpose of this script is to check parity between official hosted third party js libraries, and alternative CDNs used on this site. + +function compare { + printf "=================\ncomparing:\n%s vs. %s\n" "$1" "$2" + wget "$1" -O f1 &> /dev/null + wget "$2" -O f2 &> /dev/null + if ! cmp f1 f2; + then + printf "Files are NOT the same!\n" + exit 1; + else + printf "Files are the same.\n" + fi + } + +compare "https://unpkg.com/@primer/css/dist/primer.css" "https://cdnjs.cloudflare.com/ajax/libs/Primer/15.2.0/primer.css" +#compare "https://hypothes.is/embed.js" "https://cdn.jsdelivr.net/npm/hypothesis/build/boot.js" +compare "https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/contrib/auto-render.min.js" +compare "https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" +compare "https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js" "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.js" +compare "https://cdn.jsdelivr.net/npm/mathjax@2.7.5/MathJax.js" "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" + +# Remove files created for comparison +rm f1 f2 diff --git a/_action_files/fastpages-jekyll.Dockerfile b/_action_files/fastpages-jekyll.Dockerfile index 6b3fb7c..3e10794 100644 --- a/_action_files/fastpages-jekyll.Dockerfile +++ b/_action_files/fastpages-jekyll.Dockerfile @@ -1,10 +1,7 @@ -# Defines https://hub.docker.com/repository/docker/hamelsmu/fastpages-jekyll -# FROM jekyll/jekyll:4.0.0 THIS IS BROKEN RIGHT NOW -FROM hamelsmu/fastpages-jekyll +# Defines https://hub.docker.com/repository/docker/fastai/fastpages-jekyll +FROM jekyll/jekyll:4.1.0 COPY . . - -# Pre-load all gems into the environment RUN chmod -R 777 . RUN gem install bundler -RUN jekyll build \ No newline at end of file +RUN jekyll build diff --git a/_action_files/hide.tpl b/_action_files/hide.tpl index 6f97286..39ac80f 100644 --- a/_action_files/hide.tpl +++ b/_action_files/hide.tpl @@ -24,7 +24,12 @@ {% endblock input_group %} {% block output_group -%} -{%- if cell.metadata.hide_output -%} +{%- if cell.metadata.collapse_output -%} +
+ +

{{ super() }}

+
+{%- elif cell.metadata.hide_output -%} {%- else -%} {{ super() }} {%- endif -%} diff --git a/_action_files/nb2post.py b/_action_files/nb2post.py index 038064c..6edfdae 100755 --- a/_action_files/nb2post.py +++ b/_action_files/nb2post.py @@ -2,7 +2,7 @@ from datetime import datetime import re, os, logging from nbdev import export2html -from nbdev.export2html import Config, Path, _re_digits, _to_html, _re_block_notes +from nbdev.export2html import Config, Path, _to_html, _re_block_notes from fast_template import rename_for_jekyll warnings = set() @@ -19,4 +19,4 @@ def _nb2htmlfname(nb_path, dest=None): ## apply monkey patches export2html._nb2htmlfname = _nb2htmlfname -export2html.notebook2html(fname='_notebooks/*.ipynb', dest='_posts/', template_file='/fastpages/fastpages.tpl') +export2html.notebook2html(fname='_notebooks/*.ipynb', dest='_posts/', template_file='/fastpages/fastpages.tpl', execute=False) diff --git a/_action_files/word2post.sh b/_action_files/word2post.sh index 47b81f7..54260b7 100755 --- a/_action_files/word2post.sh +++ b/_action_files/word2post.sh @@ -8,21 +8,21 @@ fi # Loops through directory of *.docx files and converts to markdown # markdown files are saved in _posts, media assets are saved in assets/img//media -for FILENAME in ${GITHUB_WORKSPACE}/_word/*.docx; do +for FILENAME in "${GITHUB_WORKSPACE}"/_word/*.docx; do [ -e "$FILENAME" ] || continue # skip when glob doesn't match NAME=${FILENAME##*/} # Get filename without the directory - NEW_NAME=`python3 "/fastpages/word2post.py" "${FILENAME}"` # clean filename to be Jekyll compliant for posts + NEW_NAME=$(python3 "/fastpages/word2post.py" "${FILENAME}") # clean filename to be Jekyll compliant for posts BASE_NEW_NAME=${NEW_NAME%.md} # Strip the file extension if [ -z "$NEW_NAME" ]; then echo "Unable To Rename: ${FILENAME} to a Jekyll complaint filename for blog posts" exit 1 fi - + echo "Converting: ${NAME} ---to--- ${NEW_NAME}" - cd ${GITHUB_WORKSPACE} + cd ${GITHUB_WORKSPACE} || { echo "Failed to change to Github workspace directory"; exit 1; } pandoc --from docx --to gfm --output "${GITHUB_WORKSPACE}/_posts/${NEW_NAME}" --columns 9999 \ - --extract-media="assets/img/${BASE_NEW_NAME}" --standalone "${FILENAME}" + --extract-media="assets/img/${BASE_NEW_NAME}" --standalone "${FILENAME}" # Inject correction to image links in markdown sed -i.bak 's/!\[\](assets/!\[\]({{ site.url }}{{ site.baseurl }}\/assets/g' "_posts/${NEW_NAME}" diff --git a/_fastpages_docs/DEVELOPMENT.md b/_fastpages_docs/DEVELOPMENT.md index af7065d..1d08b73 100644 --- a/_fastpages_docs/DEVELOPMENT.md +++ b/_fastpages_docs/DEVELOPMENT.md @@ -100,9 +100,3 @@ make bash-nb _Note: you can use `docker-compose run` instead of `make bash-nb` or `make bash-jekyll` to start a service and then attach to it. Or you can run all your services in the background, `make server-detached`, and then use `make bash-nb` or `make bash-jekyll` as in the examples above._ -## Running A Jupyter Server - -The fastpages development environment does not provide a Jupyter server for you. This is intentional so that you are free to run Jupyter Notebooks or Jupyter Lab in a manner that is familiar to you, and manage dependencies (requirements.txt, conda, etc) in the way you wish. Some tips that may make your life easier: - -- Provide instructions in your README and your blog posts on how to install the dependencies required to run your notebooks. This will make it easier for your audience to reproduce your notebooks. -- Do not edit the Dockerfile in `/_action_files`, as that may interfere with the blogging environment. Furthermore, any changes you make to these files may get lost in future upgrades, if [upgrading automatically](UGPRADE.md). Instead, if you wish to manage your Jupyter server with Docker, we recommend that you maintain a seperate Dockerfile at the root of your repository. diff --git a/_fastpages_docs/TROUBLESHOOTING.md b/_fastpages_docs/TROUBLESHOOTING.md index 43f0961..80df35e 100644 --- a/_fastpages_docs/TROUBLESHOOTING.md +++ b/_fastpages_docs/TROUBLESHOOTING.md @@ -29,7 +29,7 @@ See the [Upgrading guide](https://github.com/fastai/fastpages/blob/master/_fastp - [ ] In your GitHub repository, you will have a tab called **Actions**. To find build errors, click on the `Event` dropdown list and select `push`. Browse through tthe logs to see if you can find an error. If you receive an error, read the error message and try to debug. -## Step 5: Once you have performed all the above steps, post your issue in the fastai formus or a GitHub Issue. +## Step 5: Once you have performed all the above steps, post your issue in the fastai forums or a GitHub Issue. - [ ] Use the [nbdev & blogging category](https://forums.fast.ai/c/fastai-users/nbdev/48) to specify your problem if posting on the fastpages forums. - [ ] If you cannot find a similar issue create a new thread instead of commenting on an unrelated one. diff --git a/_fastpages_docs/_setup_pr_template.md b/_fastpages_docs/_setup_pr_template.md index 3cd88d4..3e9c522 100644 --- a/_fastpages_docs/_setup_pr_template.md +++ b/_fastpages_docs/_setup_pr_template.md @@ -4,7 +4,7 @@ Hello :wave: @mani2106! Thank you for using fastpages! 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 `New repository 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. @@ -14,7 +14,7 @@ Hello :wave: @mani2106! Thank you for using fastpages! ### 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/mani2106/Blog-Posts/actions). -- Your GH-Pages Status badge on your README will eventually appear and be green, indicating your first sucessfull build. +- Your GH-Pages Status badge on your README will eventually appear and be green, indicating your first successful build. - You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/mani2106/Blog-Posts/settings). If you are not using a custom domain, your website will appear at: diff --git a/_fastpages_docs/annotate.png b/_fastpages_docs/annotate.png new file mode 100644 index 0000000..56fd6a4 Binary files /dev/null and b/_fastpages_docs/annotate.png differ diff --git a/_fastpages_docs/enable_actions.png b/_fastpages_docs/enable_actions.png new file mode 100644 index 0000000..b01aea5 Binary files /dev/null and b/_fastpages_docs/enable_actions.png differ diff --git a/_fastpages_docs/fastapges-setup.gif b/_fastpages_docs/fastapges-setup.gif new file mode 100644 index 0000000..2c392c5 Binary files /dev/null and b/_fastpages_docs/fastapges-setup.gif differ diff --git a/_fastpages_docs/version.txt b/_fastpages_docs/version.txt index ac12784..0ff80a4 100644 --- a/_fastpages_docs/version.txt +++ b/_fastpages_docs/version.txt @@ -1 +1 @@ -2.1.30 +2.1.44 diff --git a/_includes/custom-head.html b/_includes/custom-head.html index 25f4c4e..1842575 100644 --- a/_includes/custom-head.html +++ b/_includes/custom-head.html @@ -7,19 +7,18 @@ {%- include favicons.html -%} -{% seo %} - - -{%- feed_meta -%} -{%- if jekyll.environment == 'production' and site.google_analytics -%} - {%- include google-analytics.html -%} + + + +{%- if site.annotations -%} + {%- endif -%} {% if site.use_math %} - - - - + + + +