diff --git a/.github/workflows/check_config.yaml b/.github/workflows/check_config.yaml index 3d6070fbc..f88940941 100644 --- a/.github/workflows/check_config.yaml +++ b/.github/workflows/check_config.yaml @@ -53,4 +53,26 @@ jobs: }) env: ERROR_STRING: "You have not configured your baseurl correctly, please read the instructions in _config.yml carefully." - RUN_ID: ${{ github.run_id }} \ No newline at end of file + RUN_ID: ${{ github.run_id }} + + - name: check for User Pages + id: userpage + run: | + import os + nwo = os.getenv('GITHUB_REPOSITORY') + errmsg = "fastpages does not support User Pages or repo names that end with github.io, please see https://forums.fast.ai/t/fastpages-replacing-main-username-github-io-page-w-fastpages/64316/3 for more details." + assert ".github.io" not in nwo, errmsg + shell: python + + - name: Create Issue if User Pages rule is violated + if: steps.userpage.outcome == 'failure' + uses: actions/github-script@0.6.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: "Error with repository configuration: repo name", + body: 'fastpages does not support User Pages or repo names that end with github.io, please see https://forums.fast.ai/t/fastpages-replacing-main-username-github-io-page-w-fastpages/64316/3 for more details.' + }) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 19a07cbcf..5eb953ba3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,7 +2,7 @@ name: CI on: push: branches: - - main # need to filter here so we only deploy when there is a push to master + - master # need to filter here so we only deploy when there is a push to master # no filters on pull requests, so intentionally left blank pull_request: workflow_dispatch: diff --git a/.github/workflows/setup.yaml b/.github/workflows/setup.yaml index ac6e3e127..230c83c6f 100755 --- a/.github/workflows/setup.yaml +++ b/.github/workflows/setup.yaml @@ -24,7 +24,6 @@ jobs: nwo = os.getenv('GITHUB_REPOSITORY') username, repo_name = nwo.split('/') - baseurl = '' if repo_name == f'{username}.github.io' else f'/{repo_name}' readme_template_path = Path('_fastpages_docs/README_TEMPLATE.md') readme_path = Path('README.md') config_path = Path('_config.yml') @@ -39,25 +38,25 @@ jobs: # edit settings.ini file to inject baseurl config.read(settings) - config['DEFAULT']['baseurl'] = baseurl + config['DEFAULT']['baseurl'] = f'/{repo_name}' with open('_action_files/settings.ini', 'w') as configfile: config.write(configfile) # replace content of README with template - readme = readme_template_path.read_text().replace('{_username_}', username).replace('{_repo_name_}', repo_name).replace('{_baseurl_}', baseurl) + readme = readme_template_path.read_text().replace('{_username_}', username).replace('{_repo_name_}', repo_name) readme_path.write_text(readme) # update _config.yml cfg = config_path.read_text() cfg = re.sub(r'^(github_username: )(fastai)', fr'\g<1>{username}', cfg, flags=re.MULTILINE) - cfg = re.sub(r'^(baseurl: )("")', fr'\1"{baseurl}"', cfg, flags=re.MULTILINE) - cfg = re.sub(r'^(github_repo: ")(fastpages)', fr'\1{repo_name}', cfg, flags=re.MULTILINE) + cfg = re.sub(r'^(baseurl: )("")', r'\1"/{}"'.format(repo_name), cfg, flags=re.MULTILINE) + cfg = re.sub(r'^(github_repo: ")(fastpages)', r'\1{}'.format(repo_name), cfg, flags=re.MULTILINE) cfg = re.sub(r'^(url: "https://)(fastpages.fast.ai)(")', fr'\g<1>{username}.github.io\3', cfg, flags=re.MULTILINE) cfg = re.sub('UA-57531313-5', '', cfg, flags=re.MULTILINE) config_path.write_text(cfg) # prepare the pr message - pr = pr_msg_path.read_text().replace('{_username_}', username).replace('{_repo_name_}', repo_name).replace('{_baseurl_}', baseurl) + pr = pr_msg_path.read_text().replace('{_username_}', username).replace('{_repo_name_}', repo_name) pr_msg_path.write_text(pr) shell: python @@ -83,7 +82,7 @@ jobs: git rm .github/ISSUE_TEMPLATE/feature_request.md git rm _word/*.docx git add _config.yml README.md _fastpages_docs/ _action_files/settings.ini - git commit -m 'Setup repo' + git commit -m'setup repo' git push -f --set-upstream origin fastpages-automated-setup env: GH_EMAIL: ${{ github.event.commits[0].author.email }} @@ -101,6 +100,6 @@ jobs: repo: context.repo.repo, title: 'Initial Setup', head: 'fastpages-automated-setup', - base: 'main', + base: 'master', body: `${contents}` }) diff --git a/.github/workflows/upgrade.yaml b/.github/workflows/upgrade.yaml index 951db5abc..a2a1cd3a7 100644 --- a/.github/workflows/upgrade.yaml +++ b/.github/workflows/upgrade.yaml @@ -189,7 +189,7 @@ jobs: git checkout -b fastpages-automated-upgrade git add -A git commit -m'upgrade fastpages' - git push -f --set-upstream origin fastpages-automated-upgrade main + git push -f --set-upstream origin fastpages-automated-upgrade master env: GH_USERNAME: ${{ github.event.issue.user.login }} @@ -207,7 +207,7 @@ jobs: repo: context.repo.repo, title: '[fastpages] Update repo with changes from fastpages', head: 'fastpages-automated-upgrade', - base: 'main', + base: 'master', body: `${contents}` }) .then(result => console.log(`::set-output name=pr_num::${result.data.number}`)) diff --git a/Gemfile.lock b/Gemfile.lock index e135f54db..91c56fccb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -94,7 +94,7 @@ GEM jekyll-seo-tag (~> 2.1) minitest (5.14.2) multipart-post (2.1.1) - nokogiri (1.11.7) + nokogiri (1.11.5) mini_portile2 (~> 2.5.0) racc (~> 1.4) octicons (11.0.0) diff --git a/_action_files/settings.ini b/_action_files/settings.ini index ed2e341c6..18c3b4bbb 100644 --- a/_action_files/settings.ini +++ b/_action_files/settings.ini @@ -1,7 +1,7 @@ [DEFAULT] lib_name = nbdev user = fastai -branch = main +branch = master version = 0.2.10 description = Writing a library entirely in notebooks keywords = jupyter notebook diff --git a/_fastpages_docs/TROUBLESHOOTING.md b/_fastpages_docs/TROUBLESHOOTING.md index 80df35ec8..4626a11b0 100644 --- a/_fastpages_docs/TROUBLESHOOTING.md +++ b/_fastpages_docs/TROUBLESHOOTING.md @@ -63,4 +63,10 @@ See the [Upgrading guide](https://github.com/fastai/fastpages/blob/master/_fastp 2. Can you customize the styling or theme of fastpages? **A**: See [Customizing Fastpages](https://github.com/fastai/fastpages#customizing-fastpages) +3. Your initial build failed on GH-Pages Status + + `Error messsage: Unable to build page. Please try again later.` `Error: Process completed with exit code 1.` + + If your github username contains capital letters e.g. YourUserName, go to [config file](../_config.yml#L17) line 17 and rename `YourUserName.github.io` to `yourusername.github.io`. After the commit blog should build without error. + See the [FAQ](https://github.com/fastai/fastpages#faq) for frequently asked questions. diff --git a/_fastpages_docs/_setup_pr_template.md b/_fastpages_docs/_setup_pr_template.md index 0e27d20a3..9f39bfac9 100644 --- a/_fastpages_docs/_setup_pr_template.md +++ b/_fastpages_docs/_setup_pr_template.md @@ -4,22 +4,22 @@ Hello :wave: @goodboychan! 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 `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`.** +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. +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.  ### 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/goodboychan/chans_jupyter/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/goodboychan/goodboychan.github.io/actions). - 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/goodboychan/chans_jupyter/settings). +- You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/goodboychan/goodboychan.github.io/settings). If you are not using a custom domain, your website will appear at: -#### https://goodboychan.github.io/chans_jupyter +#### https://goodboychan.github.io/goodboychan.github.io ## Optional: Using a Custom Domain diff --git a/_fastpages_docs/_upgrade_pr.md b/_fastpages_docs/_upgrade_pr.md index c04daa8be..f8a0f5097 100644 --- a/_fastpages_docs/_upgrade_pr.md +++ b/_fastpages_docs/_upgrade_pr.md @@ -10,5 +10,5 @@ If you would like more fine-grained control over what changes to accept or decli ### What to Expect After Merging This PR -- GitHub Actions will build your site, which will take 3-4 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/goodboychan/chans_jupyter/actions). -- You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/goodboychan/chans_jupyter/settings). +- GitHub Actions will build your site, which will take 3-4 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/goodboychan/goodboychan.github.io/actions). +- You can monitor the status of your site in the GitHub Pages section of your [repository settings](https://github.com/goodboychan/goodboychan.github.io/settings). diff --git a/_fastpages_docs/version.txt b/_fastpages_docs/version.txt index 6d14f42d2..7ec3b24f5 100644 --- a/_fastpages_docs/version.txt +++ b/_fastpages_docs/version.txt @@ -1 +1 @@ -2.1.45 +2.1.48 diff --git a/_includes/custom-head.html b/_includes/custom-head.html index c7c1d6aa9..18425754f 100644 --- a/_includes/custom-head.html +++ b/_includes/custom-head.html @@ -61,5 +61,3 @@ elem.forEach(e => (e.innerHTML = '')); }); - - \ No newline at end of file diff --git a/_includes/google-analytics.html b/_includes/google-analytics.html index d6bb197cf..78fbbc07b 100644 --- a/_includes/google-analytics.html +++ b/_includes/google-analytics.html @@ -11,4 +11,5 @@ gtag('config', '{{site.google_analytics}}'); + {% endif %} diff --git a/_includes/notebook_binder_link.html b/_includes/notebook_binder_link.html index b73e55844..e46038f51 100644 --- a/_includes/notebook_binder_link.html +++ b/_includes/notebook_binder_link.html @@ -1,5 +1,5 @@