Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Site root behavior not consistent #10

Closed
zimmicz opened this issue Mar 31, 2015 · 3 comments
Closed

Site root behavior not consistent #10

zimmicz opened this issue Mar 31, 2015 · 3 comments

Comments

@zimmicz
Copy link

zimmicz commented Mar 31, 2015

My config.yml looks as follows:

baker:
  processors:
  - imageoptimizer
  - cssmin
  - copy
jinja:
  twig_compatibility: true
site:
  author: Michal Zimmermann
  description: Pieces of knowledge from the world of GIS.
  category_url: category/%category%
  enable_gzip: true
  hide_quickstart: true
  post_url: '%year%/%slug%'
  posts_per_page: 10
  pretty_urls: true
  root: /posts
  tag_url: tag/%tag%
  title: Michal Zimmermann
  trailing_slash: true
smartypants:
  enable: true

In my HTML template, I use <h1><a href="{{pcurl(site.root)}}">Michal Zimmermann</a></h1> which should take me to the www.zimmi.cz/posts (as www.zimmi.cz is my root domain). It takes me to www.zimmi.cz/posts/posts instead.

Using <a class="pagination" href="{{pagination.next_page}}"> takes me to www.zimmi.cz/2 where it should take me to www.zimmi.cz/posts/2 instead.

<img src="{{assets.lines}}" title="Self-intersecting lines" class="img-responsive centered">

is translated to

<img src="/_asset/posts/2015-03-30_postgis-count-line-self-intersections-assets/lines.png" title="Self-intersecting lines" class="img-responsive centered"> on a localhost

and to

<img src="/postsposts/2015/postgis-count-line-self-intersections/lines.png" title="Self-intersecting lines" class="img-responsive centered"> on a production environment.

Is this a bug or is it my faulty settings?

@ludovicchabant
Copy link
Owner

Yeah I'm cleaning up the code around how URLs are passed around and processed, it's a bit of a mess right now.

Note however that {{pcurl(site.root)}} is incorrect. You either just use site.root, or pcurl('/'), or even pcurl(''). The pcurl function processes a simple URL by making it absolute, i.e. preprending site.root, and appending any debug stuff like ?!debug.

@zimmicz
Copy link
Author

zimmicz commented Mar 31, 2015

Alright, good to know. Anything I can do about the broken image src url?

@ludovicchabant
Copy link
Owner

Nope, I have to fix it :) Most problems should be fixed with 9b1de1f, so you can pull and try again, but I'm still writing tests and chasing side effect bugs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants