Skip to content

Commit

Permalink
Fix build time issue and two other tiny cleanups (ampproject#138)
Browse files Browse the repository at this point in the history
* Use much less expensive check to determine if a nav menu item should be open.

* Use doc.locale.is_rtl to determine if RTL, instead of hardcoding ar.

* Remove dead grow deploy command from README, since it's not used.
  • Loading branch information
jeremydw authored and pbakaus committed Jul 17, 2016
1 parent 1edd40a commit 745e54e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ $ grow run

You can now open http://localhost:8080/ and continue working on the source files, then reload the page to see changes appear.

### Deploy
### Build

```sh
$ grow build
$ grow deploy
```

This will generate a static, complete build of the site into the **build* folder.
Expand Down
4 changes: 2 additions & 2 deletions views/base.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html ⚡{% if doc.locale == "ar" %} dir="rtl" lang="ar"{% endif %}>
<html ⚡{% if doc.locale.is_rtl %} dir="rtl" lang="ar"{% endif %}>
{% include "/views/partials/head.html" %}
<body class="{{doc.class}}{% if doc.locale == 'ar' %}rtl{% endif %}">
<body class="{{doc.class}}{% if doc.locale.is_rtl %}rtl{% endif %}">
<amp-analytics type="googleanalytics" id="analytics-ga">
<script type="application/json">
{
Expand Down
2 changes: 1 addition & 1 deletion views/partials/nav.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro render_item(item) -%}
{% set sub_collection = g.collection(item.collection.pod_path + '/' + item.base) %}
{% set open = sub_collection.pod_path == doc.pod_path[:-3] or doc in sub_collection %}
{% set open = sub_collection.pod_path in doc.pod_path[:-3] %}

{% if doc == item %}
<li class="current">
Expand Down

0 comments on commit 745e54e

Please sign in to comment.