Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

menu fix for base_url #1

Merged
merged 1 commit into from

3 participants

@rephorm

As written, adding a base_url breaks the menu system. Here is a patch.

@merlinrebrovic

Hi,

Thank you for the fix :) I'm testing it at the moment. Everything I try is working, so I'll merge it in. The only thing I would prefer is that the default base_url is /, not some other path. That way when a beginner types hyde serve everything works out of the box. I'll leave your part of the configuration commented out with an explanation.

@merlinrebrovic merlinrebrovic merged commit 6d01be9 into from
@rephorm

Sounds good. I agree that the default base_url should be /, (I just left it in to demonstrate).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 15, 2011
  1. @bmattern
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 8 deletions.
  1. +3 −3 layout/macros.j2
  2. +6 −5 site.yaml
View
6 layout/macros.j2
@@ -6,11 +6,11 @@
#}
<ul>
{% for menu_item in menu -%}
- <li><a {% if (menu_item.url == resource.full_url) or
+ <li><a {% if (menu_item.url == resource.url) or
(menu_item.title == "Advanced topics"
and resource.node.name == "advanced")
- %}class="selected"{% endif %}
- href="{{ menu_item.url }}">{{ menu_item.title }}</a></li>
+ %}class="selected"{% endif -%}
+ href="{{ content_url(menu_item.url) }}">{{ menu_item.title }}</a></li>
{%- endfor %}
</ul>
{%- endmacro %}
View
11 site.yaml
@@ -1,6 +1,7 @@
mode: learning
media_root: media
-media_url: /media
+media_url: /starter/media
+base_url: /starter/
template: hyde.ext.templates.jinja.Jinja2Template
plugins:
- hyde.ext.plugins.meta.MetaPlugin
@@ -23,13 +24,13 @@ context:
install: "http://hyde.github.com/install.html"
menu:
- title: Home
- url: /index.html
+ url: index.html
- title: First steps
- url: /first-steps.html
+ url: first-steps.html
- title: Advanced topics
- url: /advanced/overview.html
+ url: advanced/overview.html
- title: About
- url: /about.html
+ url: about.html
### Advanced part ###
Something went wrong with that request. Please try again.