Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Strand
pit
Commits
29d8644d
Commit
29d8644d
authored
6 years ago
by
Erik Strand
Browse files
Options
Downloads
Patches
Plain Diff
Use relative URLs
parent
feaaeb80
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
_includes/navigation.html
+1
-1
1 addition, 1 deletion
_includes/navigation.html
_layouts/default.html
+1
-1
1 addition, 1 deletion
_layouts/default.html
_plugins/real_relative_url.rb
+17
-0
17 additions, 0 deletions
_plugins/real_relative_url.rb
_sass/main.scss
+1
-1
1 addition, 1 deletion
_sass/main.scss
with
20 additions
and
3 deletions
_includes/navigation.html
+
1
−
1
View file @
29d8644d
<nav>
{% for item in site.data.navigation %}
<a
href=
"{{ item.link }}"
{%
if
page.url =
=
item.link
%}
class=
"current"
{%
endif
%}
>
{{ item.name }}
</a>
<a
href=
"{{ item.link
| real_relative_url
}}"
{%
if
page.url =
=
item.link
%}
class=
"current"
{%
endif
%}
>
{{ item.name }}
</a>
{% endfor %}
</nav>
This diff is collapsed.
Click to expand it.
_layouts/default.html
+
1
−
1
View file @
29d8644d
...
...
@@ -3,7 +3,7 @@
<head>
<meta
charset=
"utf-8"
>
<title>
{{ page.title }}
</title>
<link
rel=
"stylesheet"
href=
"/assets/css/styles.css"
>
<link
rel=
"stylesheet"
href=
"{{
"
/
assets
/
css
/
styles.css
"
|
real_relative_url
}}"
>
{% include mathjax.html %}
</head>
<body>
...
...
This diff is collapsed.
Click to expand it.
_plugins/real_relative_url.rb
0 → 100644
+
17
−
0
View file @
29d8644d
require
'pathname'
# Jekyll's built-in "relative_url" filter does not generate relative URLs, it generates URLs that
# don't contain the domain. This plugin was posted to a GitHub issue in which @aioobe asks about
# making real relative URLs: https://github.com/jekyll/jekyll/issues/6360.
module
Jekyll
module
RealRelativeUrl
def
real_relative_url
(
url
)
pageUrl
=
@context
.
registers
[
:page
][
"url"
]
pageDir
=
Pathname
(
pageUrl
).
parent
Pathname
(
url
).
relative_path_from
(
pageDir
).
to_s
end
end
end
Liquid
::
Template
.
register_filter
(
Jekyll
::
RealRelativeUrl
)
This diff is collapsed.
Click to expand it.
_sass/main.scss
+
1
−
1
View file @
29d8644d
.current
{
color
:
green
;
font-weight
:
bold
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment