Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
website
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSE 373
21au
website
Commits
df98f32f
Commit
df98f32f
authored
4 years ago
by
Kevin Lin
✨
Browse files
Options
Downloads
Patches
Plain Diff
_includes: Remove eval.liquid, split.liquid dependencies
parent
86aa5e5e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_includes/eval.liquid
+0
-38
0 additions, 38 deletions
_includes/eval.liquid
_includes/split.liquid
+0
-34
0 additions, 34 deletions
_includes/split.liquid
with
0 additions
and
72 deletions
_includes/eval.liquid
deleted
100644 → 0
+
0
−
38
View file @
86aa5e5e
{%
capture
eval_workspace
%}
{%
comment
%}
Evaluate Liquid tags stored in plaintext.
Supports:
`link` tag for site.pages. Does not raise errors on invalid links.
Parameters:
`content` (string): String containing Liquid tags.
{%
endcomment
%}
{%
capture
tags
%}{{
"{%|"
}}
%}
{%
endcapture
%}
{%
assign
tags
=
tags
|
split
:
"|"
%}
{%
assign
join
=
"|"
%}
{%
capture
parts
%}{%
include
split.liquid
content
=
include
.
content
queries
=
tags
join
=
join
%}{%
endcapture
%}
{%
assign
parts
=
parts
|
split
:
join
%}
{%
assign
result
=
""
%}
{%
for
part
in
parts
%}
{%
assign
subparts
=
part
|
split
:
" "
%}
{%
assign
rest
=
subparts
|
slice
:
1
,
subparts
.
size
|
join
:
" "
%}
{%
case
subparts
[
0
]
%}
{%
when
"link"
%}
{%
comment
%}
Jekyll 4.0 supports Liquefied link tags: https://github.com/jekyll/jekyll/pull/6269
{%
endcomment
%}
{%
for
page
in
site
.
pages
%}
{%
if
page
.
path
==
rest
%}
{%
assign
link
=
page
.
url
|
relative_url
%}
{%
assign
result
=
result
|
append
:
link
%}
{%
endif
%}
{%
endfor
%}
{%
else
%}
{%
assign
result
=
result
|
append
:
part
%}
{%
endcase
%}
{%
endfor
%}
{%
endcapture
%}{%
assign
eval_workspace
=
''
%}{{
result
}}
This diff is collapsed.
Click to expand it.
_includes/split.liquid
deleted
100644 → 0
+
0
−
34
View file @
86aa5e5e
{%
capture
split_workspace
%}
{%
comment
%}
Split the string on all of the delimiters and join the result.
Parameters:
`content` (string): String to split.
`delimiters` (array of strings): Boundary strings defining what to split.
`join` (string): Join the resulting parts on this string.
{%
endcomment
%}
{%
assign
queries
=
include
.
queries
|
default
:
empty
%}
{%
assign
join
=
include
.
join
|
default
:
"|"
%}
{%
if
queries
.
size
==
0
%}
{%
assign
result
=
include
.
content
%}
{%
else
%}
{%
assign
result
=
include
.
content
|
split
:
queries
[
0
]
|
join
:
join
%}
{%
assign
rest
=
queries
|
slice
:
1
,
queries
.
size
%}
{%
for
query
in
rest
%}
{%
assign
temp
=
result
|
split
:
join
%}
{%
assign
result
=
""
%}
{%
for
part
in
temp
%}
{%
assign
split
=
part
|
split
:
query
%}
{%
for
subpart
in
split
%}
{%
comment
%}
Suppress repeated delimiters (empty strings).
{%
endcomment
%}
{%
if
subpart
!=
""
%}
{%
assign
result
=
result
|
append
:
join
|
append
:
subpart
%}
{%
endif
%}
{%
endfor
%}
{%
endfor
%}
{%
endfor
%}
{%
endif
%}
{%
endcapture
%}{%
assign
split_workspace
=
''
%}{{
result
}}
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