Skip to content

Commit 7fd5cc1

Browse files
committed
Move Keras 2 apis to a constant url
We had the idea of a rolling Keras 2 api url, that would append to the set of files we publish on keras.io. It's broken for a couple reasons: 1. The site might change between tf version, and we don't want to serve old versions of pages from the site hoping that they match up. 2. We should have a stable url for the latest keras 2 api for things like SEO. We don't have that! We should only serve what we can build from the current version of the site. If we want rolling selectable API versions, we should do so by extending our site build to be able to build all Keras 2 versions we care about when we render.
1 parent 0007b60 commit 7fd5cc1

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

scripts/keras2_api_master.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@
66

77
if tf_keras:
88
parts = tf_keras.__version__.split(".")
9-
tf_keras_version = parts[0] + "." + parts[1]
9+
tf_keras_version = parts[0]
1010
else:
1111
tf_keras_version = "None"
1212

1313

14-
# In order to refresh the pages for an old version (e.g. 2.14)
15-
# You will need to re-run `python autogen.py make` after updating
16-
# the tf_keras version in autogen.py and making sure to install
17-
# the targeted keras_version locally. When you do this
18-
# `/2.14/api/` (for instance) will be regenerated. You can then
19-
# just reupload, which won't affect the directories for any other
20-
# version number.
2114
KERAS2_API_MASTER = {
2215
"path": tf_keras_version + "/api/",
2316
"title": "Keras 2 API documentation",

theme/base.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
<div class="k-page">
6666
<div class="hidden">
6767
{% set related_nav_urls_map = {
68-
"/api/": ["/2.18/api/"],
69-
"/2.18/api/": ["/api/"],
68+
"/api/": ["/2/api/"],
69+
"/2/api/": ["/api/"],
7070
} %}
7171
{% set vars = {'related_urls': [], 'active_url': ''} %}
7272
{% for item in nav %}

0 commit comments

Comments
 (0)