Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to have Colab badges on pages #210

Merged
merged 11 commits into from
Aug 11, 2020
Merged

Add ability to have Colab badges on pages #210

merged 11 commits into from
Aug 11, 2020

Conversation

hamelsmu
Copy link
Member

@hamelsmu hamelsmu commented Aug 11, 2020

EDIT: this is ready for review now

This closes issue #209

@hamelsmu hamelsmu changed the title Help Needed (99% done) - add ability to have Colab badges on pages Add ability to have Colab badges on pages Aug 11, 2020
@hamelsmu hamelsmu requested a review from jph00 August 11, 2020 02:33
@jph00
Copy link
Member

jph00 commented Aug 11, 2020

Nice! I think we need a way to turn them on and off per page. If on for the site, it shouldn't be added to pages that aren't from notebooks.

And needs some docs including in readme

@hamelsmu
Copy link
Member Author

hamelsmu commented Aug 11, 2020

@jph00 I made the following changes:

  1. Edited index.ipynb to add a section about badges
  2. Built the docs which rendered README.md as well as all of the HTML pages with the new Colab Badge
  3. Added the ability to turn off a badge selectively on a page even though the site-wide option is turned on via the hide_colab_badge front matter, this is what is used in fastpages, BTW. This is also documented in the README now.
  4. Re: ignoring non-notebook posts I will comment on the code that facilitates this naturally but this is taken care of already.

LMK what you think

@@ -5,6 +5,9 @@
<div class="post-header">
<a id="{{page.title}}"></a>
<h1 class="post-title-main">{{ page.title }}</h1>
{% if page.nb_path %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jph00 this line of code prevents non-notebook documents from getting a Colab badge

@jph00 jph00 merged commit 5cab004 into master Aug 11, 2020
@jph00 jph00 deleted the add-colab branch August 11, 2020 17:59
@jph00 jph00 added the enhancement New feature or request label Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants