Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Fachgruppenwebseite Metadaten
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
fginfo
Fachgruppenwebseite Metadaten
Commits
51f00afd
Verified
Commit
51f00afd
authored
2 years ago
by
Jake
Browse files
Options
Downloads
Patches
Plain Diff
added renderers.html
parent
6e6a5064
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theme/templates/macros/renderers.html
+81
-0
81 additions, 0 deletions
theme/templates/macros/renderers.html
with
81 additions
and
0 deletions
theme/templates/macros/renderers.html
0 → 100644
+
81
−
0
View file @
51f00afd
{%- import 'macros/getters.html' as get with context -%}
{%- import 'macros/cards.html' as cards with context -%}
{%- macro section_news(s) -%}
{{ cards.open() }}
{%- for article in all_articles -%}
{%- if loop.index
<
s.num
-
%}
{{
cards.card_from_article_or_page
(
article
)
}}
{%
-
endif
-
%}
{%
-
endfor
-
%}
{{
cards.close
()
}}
{%
-
endmacro
-
%}
{%
-
macro
section_custom
(
s
)
-
%}
{{
cards.open
()
}}
{%
-
for
c
in
s.content
-
%}
{{
cards.card(title=
c[lang],
url=
c.url,
catcolor=
c.color)
}}
{%
-
endfor
-
%}
{{
cards.close
()
}}
{%
-
endmacro
-
%}
{%
-
macro
section_iframe
(
s
)
-
%}
<
iframe
src=
"{{ s.url }}"
></iframe>
{%- endmacro -%}
{%- macro section_category(s) -%}
{%- call(nativecat, sccat, catarticles) get.category_by_name(s.category) -%}
{%- if s.title is not defined -%}
<header>
<h2
{%
if
s.id
is
defined
-
%}
id=
"{{ s.id }}"
{%
-
endif
%}
>
{{ sccat[lang]|e }}
</h2>
</header>
{%- endif -%}
{{ cards.open() }}
{%- for article in catarticles -%}
{%- if loop.index
<
s.num
-
%}
{{
cards.card_from_article_or_page
(
article
)
}}
{%
-
endif
-
%}
{%
-
endfor
-
%}
{{
cards.close
()
}}
{%
-
endcall
-
%}
{%
-
endmacro
-
%}
{%
-
macro
section_tag
(
s
)
-
%}
{%
-
call
(
nativetag
,
sccat
,
tagarticles
)
get.tag_by_name
(
s.tag
)
-
%}
{%
-
if
s.title
is
not
defined
-
%}
<
header
>
<h2
{%
if
s.id
is
defined
-
%}
id=
"{{ s.id }}"
{%
-
endif
%}
>
{{ s.tag|e }}
</h2>
</header>
{%- endif -%}
{{ cards.open() }}
{%- for article in tagarticles -%}
{%- if loop.index
<
s.num
-
%}
{{
cards.card_from_article_or_page
(
article
)
}}
{%
-
endif
-
%}
{%
-
endfor
-
%}
{{
cards.close
()
}}
{%
-
endcall
-
%}
{%
-
endmacro
-
%}
{%
-
macro
section
(
s
)
-
%}
{%
-
if
s.title
is
defined
-
%}
<
header
>
<h2
{%
if
s.id
is
defined
-
%}
id=
"{{ s.id }}"
{%
-
endif
%}
>
{{ s.title[lang]|e }}
</h2>
</header>
{%- endif -%}
{%- if s.type == "news" -%}
{{ section_news(s) }}
{%- elif s.type == "iframe" -%}
{{ section_iframe(s) }}
{%- elif s.type == "custom" -%}
{{ section_custom(s) }}
{%- elif s.type == "category" -%}
{{ section_category(s) }}
{%- elif s.type == "tag" -%}
{{ section_tag(s) }}
{%- else -%}
<br
/>
<strong>
ERROR: render.section: Unknown section type: {{ s.type|e }}
</strong><br
/>
<br
/>
{%- endif -%}
{%- endmacro -%}
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