Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate absolute link for include_code #519

Merged
merged 1 commit into from
Mar 14, 2014
Merged

Generate absolute link for include_code #519

merged 1 commit into from
Mar 14, 2014

Conversation

floriancargoet
Copy link
Contributor

Here are the relevant lines of my config:

permalink: :year/:month/:title/
code_dir: projects/
source_dir: source

An URL for a post is for instance /2014/03/monthofcode-day-8-mathematics/

If I use the include_code tag :

{% include_code monthofcode/8/8.js %}

the generated download link is projects/monthofcode/8/8.js which is resolved to /2014/03/monthofcode-day-8-mathematics/projects/monthofcode/8/8.js instead of the desired /projects/monthofcode/8/8.js.

Since the code_dir option is relative the the source_dir, I don't see why we shouldn't use an absolute link (starting with a slash).

What do you think?

tommy351 added a commit that referenced this pull request Mar 14, 2014
Generate absolute link for include_code
@tommy351 tommy351 merged commit 48b4a9e into hexojs:master Mar 14, 2014
@floriancargoet floriancargoet deleted the patch-2 branch March 14, 2014 06:49
@smmoosavi
Copy link

you must include root config in generated url. see #928

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

Successfully merging this pull request may close these issues.

3 participants