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
39ff7724
Verified
Commit
39ff7724
authored
2 years ago
by
Jake
Browse files
Options
Downloads
Patches
Plain Diff
tags working
parent
05ee2f39
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fgs/generator.py
+14
-10
14 additions, 10 deletions
fgs/generator.py
fgs/reader.py
+1
-1
1 addition, 1 deletion
fgs/reader.py
theme/templates/macros/getters.html
+1
-1
1 addition, 1 deletion
theme/templates/macros/getters.html
theme/templates/tag.html
+12
-0
12 additions, 0 deletions
theme/templates/tag.html
with
28 additions
and
12 deletions
fgs/generator.py
+
14
−
10
View file @
39ff7724
...
@@ -42,22 +42,22 @@ class Generator:
...
@@ -42,22 +42,22 @@ class Generator:
# categories
# categories
categories
=
{}
categories
=
{}
for
page
in
published_pages
:
for
page
in
published_pages
:
if
page
.
category
not
in
categories
:
if
page
.
lang
not
in
categories
:
categories
[
page
.
category
]
=
{}
categories
[
page
.
lang
]
=
{}
if
page
.
lang
not
in
categories
[
page
.
category
]:
if
page
.
category
not
in
categories
[
page
.
lang
]:
categories
[
page
.
category
][
page
.
lang
]
=
[]
categories
[
page
.
lang
][
page
.
category
]
=
[]
categories
[
page
.
category
][
page
.
lang
].
append
(
page
)
categories
[
page
.
lang
][
page
.
category
].
append
(
page
)
self
.
context
[
'
categories
'
]
=
categories
self
.
context
[
'
categories
'
]
=
categories
# tags
# tags
tags
=
{}
tags
=
{}
for
page
in
published_pages
:
for
page
in
published_pages
:
for
tag
in
page
.
tags
:
for
tag
in
page
.
tags
:
if
ta
g
not
in
tags
:
if
page
.
lan
g
not
in
tags
:
tags
[
ta
g
]
=
{}
tags
[
page
.
lan
g
]
=
{}
if
page
.
lan
g
not
in
tags
[
ta
g
]:
if
ta
g
not
in
tags
[
page
.
lan
g
]:
tags
[
tag
][
page
.
lang
]
=
[]
tags
[
page
.
lang
]
[
tag
]
=
[]
tags
[
tag
][
page
.
lang
].
append
(
page
)
tags
[
page
.
lang
]
[
tag
]
.
append
(
page
)
self
.
context
[
'
tags
'
]
=
tags
self
.
context
[
'
tags
'
]
=
tags
...
@@ -77,6 +77,10 @@ class Generator:
...
@@ -77,6 +77,10 @@ class Generator:
for
page
in
self
.
context
[
'
pages
'
][
lang
].
values
():
for
page
in
self
.
context
[
'
pages
'
][
lang
].
values
():
writer
.
write_template
(
page
.
template
,
page
.
url
,
lang
,
{
'
page
'
:
page
})
writer
.
write_template
(
page
.
template
,
page
.
url
,
lang
,
{
'
page
'
:
page
})
# all tags
for
tag
,
tagpages
in
self
.
context
[
'
tags
'
][
lang
].
items
():
writer
.
write_template
(
'
tag.html
'
,
lang
+
'
/tag/
'
+
tag
+
'
.html
'
,
lang
,
{
'
tag
'
:
tag
,
'
tagpages
'
:
tagpages
})
# homepages for languages
# homepages for languages
self
.
generate_homepage
(
writer
,
lang
,
lang
+
"
/index.html
"
)
self
.
generate_homepage
(
writer
,
lang
,
lang
+
"
/index.html
"
)
...
...
This diff is collapsed.
Click to expand it.
fgs/reader.py
+
1
−
1
View file @
39ff7724
...
@@ -150,7 +150,7 @@ class MarkdownReader:
...
@@ -150,7 +150,7 @@ class MarkdownReader:
if
not
isinstance
(
slug
,
str
):
if
not
isinstance
(
slug
,
str
):
raise
Exception
(
"
slug is not a string:
'"
,
slug
,
"'"
)
raise
Exception
(
"
slug is not a string:
'"
,
slug
,
"'"
)
slug
=
slug
.
lower
()
slug
=
slug
.
lower
()
whitelist
=
"
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
"
whitelist
=
"
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
-
"
res
=
""
res
=
""
for
c
in
slug
:
for
c
in
slug
:
if
c
in
whitelist
:
if
c
in
whitelist
:
...
...
This diff is collapsed.
Click to expand it.
theme/templates/macros/getters.html
+
1
−
1
View file @
39ff7724
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
{%- endcall -%}
{%- endcall -%}
{%- endif -%}
{%- endif -%}
{{- caller(ns.tagtitle, ns.tagcolor, [lang, 'tag', tagname + '.html']|join('/') , ns.tagpage, tags[tagname]
[lang]
) -}}
{{- caller(ns.tagtitle, ns.tagcolor, [lang, 'tag', tagname + '.html']|join('/') , ns.tagpage, tags[
lang][
tagname]) -}}
{%- endmacro -%}
{%- endmacro -%}
{%- macro metadata_entry(slug, lang, key) -%}
{%- macro metadata_entry(slug, lang, key) -%}
...
...
This diff is collapsed.
Click to expand it.
theme/templates/tag.html
0 → 100644
+
12
−
0
View file @
39ff7724
{% extends "base.html" %}
{% block title -%}
{%- call(tagtitle, tagcolor, tagurl, tagpage, tagpages) get.tag_by_name(tag, l) -%}
{{ t[l].title_prefix }}{{ t[l].sitename }}{{ t[l].title_suffix }} - {{ tagtitle|e }}
{%- endcall -%}
{%- endblock -%}
{% block content %}
<section>
{{ render.section({"type": "tag", "tag": tag, "num": None}, l) }}
</section>
{% endblock content %}
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