Skip to content

Generate absolute link for include_code#519

Merged
tommy351 merged 1 commit into
hexojs:masterfrom
floriancargoet:patch-2
Mar 14, 2014
Merged

Generate absolute link for include_code#519
tommy351 merged 1 commit into
hexojs:masterfrom
floriancargoet:patch-2

Conversation

@floriancargoet

Copy link
Copy Markdown
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
Copy Markdown

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