jez / hpstr-theme

A Medium-like Octopress theme based on the HPSTR Jekyll theme.
GNU General Public License v3.0
63 stars 15 forks source link

site.links does not seem to work #11

Closed smykytyn closed 9 years ago

smykytyn commented 9 years ago

as in:

links: - title: About url: /about-us

results in:

_config.yml): block sequence entries are not allowed in this context at line 14 column 8

jez commented 9 years ago

Hmmm, I can't reproduce the issue. I added an entry to my blog by changing _config.yml to look like:


# other stuff

links:
  - title: Portfolio
    url: http://www.zimmerman.io
    external: true
  - title: Posts
    url: /posts/

# other stuff

and everything works. If you wouldn't mind putting your _config.yml in a gist, maybe I could take a look at it.

smykytyn commented 9 years ago

Your way works for me too.

The .yml file is very sensitive to white-space, seems like. Tricky for someone just starting to figure this all out.

Originally I just copied directly from the github page instructions, which are all on one line.

So this issue is probably closed. Thanks for the help...

On Tue, Dec 2, 2014 at 4:09 PM, Jake Zimmerman notifications@github.com wrote:

Hmmm, I can't reproduce the issue. I added an entry to my blog by changing _config.yml to look like:

other stuff

links:

and everything works. If you wouldn't mind putting your _config.yml in a gist https://gist.github.com/, maybe I could take a look at it.

— Reply to this email directly or view it on GitHub https://github.com/Z1MM32M4N/hpstr-theme/issues/11#issuecomment-65330142 .

smykytyn commented 9 years ago

One more thing though. This line in navigation.html:

    {% for link in site.links %}<li>{% if link.external %}<a href="{{ link.url }}">{{ link.title }}</a>{% else %}<a href="{{ site.url }}{{ link.url }}">{{ link.title }}</a>{% endif %}</li>{% endfor %}

does not work with the preview function for internal pages. Had to delete the {{ site.url }} so it now looks like this: {% for link in site.links %}

  • {% if link.external %}{{ link.title }}{% else %}{{ link.title }}{% endif %}
  • {% endfor %}

    jez commented 9 years ago

    Thanks for pointing that out about the Properties.md file, I've updated the documentation.

    As far as the site.url issue, that's actually my mistake, but the solution you've identified isn't quite the one that I want. site.url should actually be replaced with root_url.