Skip to content

Commit

Permalink
update index
Browse files Browse the repository at this point in the history
  • Loading branch information
abakaldin committed Mar 3, 2022
1 parent 73c880e commit 79a253d
Show file tree
Hide file tree
Showing 842 changed files with 32,852 additions and 23,316 deletions.
1 change: 1 addition & 0 deletions .github/jekyll/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
share.zabbix.com
6,922 changes: 4,296 additions & 2,626 deletions .github/jekyll/_data/meta.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/jekyll/_includes/template.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a href="templates/{{ include.template.jekyll }}">
<div class="template">
<div id = "{{ include.template.jekyll }}" class="template">

{{ include.template.template }}

Expand Down
6 changes: 3 additions & 3 deletions .github/jekyll/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
</head>

<body id="body">
{% include banner_integration.html %}
{% include google-search.html %}
<div class="w container">
{% include banner_integration.html %}
<div class="w container">
{% include google-search.html %}
{% include markdown_file.html path="markdown/template_readme.md" %}
<h1>Templates</h1>
<div id="template_tree">
Expand Down
43 changes: 25 additions & 18 deletions .github/jekyll/_layouts/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
<body id="body">
{% assign tgs = site.data.zabbix_templates[page.folder].tags %}
{% capture git_hub_url %}{{ "https://github.com/zabbix/community-templates/tree/main/" }}{{ page.github }}{% endcapture %}
{% capture git_hub_url_raw %}{{ "https://raw.githubusercontent.com/zabbix/community-templates/main/" }}{{ page.github }}{% endcapture %}
<a href="{{ git_hub_url }}">
{% include banner_integration_template.html name = page.name tags = tgs %}
{% include banner_integration_template.html name = page.name tags = tgs %}
</a>
<div class="w container">
<h2 class="h2">Available versions</h2>
Expand All @@ -23,7 +24,7 @@ <h2 class="h2">Available versions</h2>
{% assign vers = site.data.zabbix_templates[page.folder].versions %}
{% for vr in vers %}
<li>
<a class="js_tab" id="ver_{{ vr | replace: ".", "_" }}" href="#body">ver. {{ vr }}
<a class="js_tab" id="ver_{{ vr.version | replace: " .", "_" }}" href="#body">ver. {{ vr.version }}
</a>
</li>
{% endfor %}
Expand All @@ -33,32 +34,38 @@ <h2 class="h2">Available versions</h2>
<br>
<br>
{% for vr in vers %}
{% capture git_hub_url_template %}{{ git_hub_url }}{{"/"}}{{ vr }}{% endcapture %}
<div id="content_ver_{{ vr | replace: ".", "_" }}" class="readme">
<a class="button button-green" style="color: #ffff;" href="{{ git_hub_url_template }}">Download ver. {{ vr }}</a>
{% capture file_name %}{{ "markdown/zabbix_templates/" }}{{ page.folder }}{{"/"}}{{ vr }}{{"/README.md"}}{% endcapture %}
{% include markdown_file.html path=file_name %}
{% capture git_hub_url_template %}{{ git_hub_url_raw }}{{"/"}}{{ vr.version }}{{"/"}}{{ vr.template_file }}{% endcapture
%}
<div id="content_ver_{{ vr.version | replace: ".", "_" }}" class="readme">
<div class="banner-buttons " style="padding-top: 20px; ">
<a class="button button-gray" style="color: #ffff;" href="/#{{ page.folder }}">Back to index</a>
<a class="button button-green" style="color: #ffff;" href="{{ git_hub_url_template }}">Download</a>
</div>
{% capture file_name %}{{ "markdown/zabbix_templates/" }}{{ page.folder }}{{"/"}}{{ vr.version }}{{"/README.md"}}{% endcapture %}
{% include markdown_file.html path=file_name %}
</div>
{% endfor %}
{% include disqus_main.html folder=page.folder %}
</div>
<script>
(function(){
console.log('#content_ver_{{ vers | last | replace: ".", "_"}}');
console.log('#ver_{{ vers | last | replace: ".", "_" }}');
(function () {
{% assign last_vers = vers | last %}
console.log('#content_ver_{{ last_vers.version | replace: ".", "_"}}');
console.log('#ver_{{ last_vers.version | replace: ".", "_" }}');
$('.readme').hide();
$('#content_ver_{{ vers | last | replace: ".", "_" }}').fadeIn('slow');
$('#ver_{{ vers | last | replace: ".", "_" }}').addClass('active');
$('#content_ver_{{ last_vers.version | replace: ".", "_" }}').fadeIn('slow');
$('#ver_{{ last_vers.version | replace: ".", "_" }}').addClass('active');

{% for vr in vers %}
$('#ver_{{ vr | replace: ".", "_" }}').click(function() {
{% for vr in vers %}
$('#ver_{{ vr.version | replace: ".", "_" }}').click(function () {
$('.readme').hide();
$('#content_ver_{{ vr | replace: ".", "_" }}').fadeIn('slow');
$('#content_ver_{{ vr.version | replace: ".", "_" }}').fadeIn('slow');
$('.js_tab').removeClass('active')
$('#ver_{{ vr | replace: ".", "_" }}').addClass('active');
})
$('#ver_{{ vr.version | replace: ".", "_" }}').addClass('active');
})
{% endfor %}
})();
</script>
</script>
</body>

</html>
5 changes: 5 additions & 0 deletions .github/jekyll/_sass/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7279,6 +7279,11 @@ button.link {
.button-green {
background-color: #17C25E;
}

.button-gray {
background-color: #3c3d3c;
}

.button-green:hover,
.button-green:focus {
background-color: #19D667;
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/update_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,17 @@ def __init__(self, name, type='template', sync=int(time.time()), collection='_te
self.author = ''
self.collection = collection

def add_file(self, template_object={}, file_type='xml'):
def add_file(self, template_object={}, file = 'template.xml'):
if not 'zabbix_export' in template_object:
return
if not 'templates' in template_object['zabbix_export']:
return
file_type = file.split('.')[-1]
template = {
'version': float(template_object['zabbix_export']['version']),
'sync': int(time.time()),
'description': ''
'description': '',
'template_file': file
}
if file_type == 'xml':
if isinstance(template_object['zabbix_export']['templates']['template'], list):
Expand Down Expand Up @@ -76,7 +78,10 @@ def export_folders(self, isprint):
'tags': self.tags
}
for ver in self.versions:
info['versions'].append(ver['version'])
info['versions'].append({
'version': ver['version'],
'template_file': ver['template_file']
})
os.makedirs(os.path.join(self.collection,os.sep.join(['_includes','markdown','zabbix_templates']),file_mame,str(ver['version'])))
shutil.copyfile(os.path.join(os.sep.join(self.path),str(ver['version']),'README.md'),
os.path.join(self.collection,os.sep.join(['_includes','markdown','zabbix_templates']),file_mame,str(ver['version']),'README.md'))
Expand Down Expand Up @@ -188,7 +193,7 @@ def parse_template(self, directory):
in_template = json.dumps(r_file)
elif file.split('.')[-1] == 'yaml':
in_template = yaml.load(r_file)
tmpl.add_file(in_template, file.split('.')[-1])
tmpl.add_file(in_template, file)
if len(tmpl.versions) > 0:
self.add_folder(path[:-1], template=tmpl)

Expand Down
2 changes: 2 additions & 0 deletions docs/assets/css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/assets/css/styles.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit 79a253d

Please sign in to comment.