Compare commits

...

2 Commits

Author SHA1 Message Date
Digital Studium 9bba1d2c70 Fix social and schema 2023-07-23 15:53:48 +03:00
Digital Studium 13613a593f Refactor 2023-07-23 11:47:23 +03:00
9 changed files with 53 additions and 44 deletions

View File

@ -39,7 +39,7 @@ function addCopyButtons(clipboard) {
// wrapper.appendChild(preElement);
var preParent = preElement.parentNode;
if (preParent.classList.contains('highlight') && preElement.children[0].dataset.lang != 'plaintext') {
if (preParent.classList.contains('codehilite') && preElement.children[0].dataset.lang != 'plaintext') {
preParent.parentNode.insertBefore(button, preParent);
}
});

View File

@ -1,3 +1,12 @@
{% set title = config.languages[language].title %}
{% set description = config.languages[language].description %}
{% if section %}
{% set title = translate(section, language) | capitalize %}
{% set description = title %}
{% elif not home %}
{% set title = post.title %}
{% set description = post.description %}
{% endif %}
<!DOCTYPE html>
<html lang="{{ language }}">
{% include "components/head.j2" %}
@ -13,6 +22,7 @@
{% include "components/single.j2" %}
{% endif %}
</main>
{% include "components/social.j2" %}
{% include "components/sidebar.j2" %}
{% include "components/footer.j2" %}
{% include "components/script.j2" %}

View File

@ -16,4 +16,4 @@
{% endif %}
{% endfor %}
</p>
{% endif %}
{% endif %}

View File

@ -1,18 +1,11 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% set title = config.languages[language].title %}
{% set description = config.languages[language].description %}
{% if section %}
{% set title = (translate(section, language) | capitalize) + " | " + title %}
{% set description = title %}
{% elif not home %}
{% set title = post.title + " | " + title %}
{% set description = post.description %}
{% endif %}
<title>{{ title }}</title>
<meta name="title" content="{{ title }}" />
<meta name="description" content="{{ description }}" />
<link href="/css/style.css" rel="stylesheet">
{% if config.custom_css %}<link href="/css/{{ config.custom_css }}" rel="stylesheet">{% endif %}
</head>
{% if config.custom_css %}
<link href="/css/{{ config.custom_css }}" rel="stylesheet">
{% endif %}
</head>

View File

@ -1,5 +1,7 @@
{% for section, urls in posts[language].items() %}
{% for url, post in urls.items() %}
{% include "components/post_summary.j2" %}
{% endfor %}
{% if section != "/" %}
{% for url, post in urls.items() %}
{% include "components/post_summary.j2" %}
{% endfor %}
{% endif %}
{% endfor %}

View File

@ -4,9 +4,9 @@
"@context": "http://schema.org",
"@type": "WebSite",
"name": "{{ title }}",
"url": "{{ url }}",
"url": "{{ config.base_url }}",
"description": "{{ description }}",
"thumbnailUrl": "{{ logo_url }}",
"thumbnailUrl": "{{ config.base_url + "/logo.svg" }}",
}
</script>
{% else %}
@ -14,29 +14,31 @@
{
"@context": "https://schema.org",
"@type": {{ config.schema.type }},
{# "articleSection": {{ translate(section, language) }}, #}
{% if section %}
"articleSection": {{ translate(section, language) }},
{% endif %}
{% if config.schema.type == 'TechArticle' %}
"proficiencyLevel": "Beginner",
{% endif %}
"name": {{ title }},
"headline": {{ title }},
"inLanguage": {{ language }},
"wordCount": {{ wordcount }},
"description": {{ description }},
"description": {{ description | striptags }},
"datePublished": {{ date_published }},
"dateModified": {{ date_modified }},
"author": {
"@type": "Person",
"name": {{ config.languages[language].author }},
"url": {{ config.baseURL + "/" + language + "/about-author" }}
"url": {{ config.base_url + "/" + language + "/about-author" }}
},
"publisher": {
"@type": "Organization",
"name": "{{ config.languages[language].title }}",
"url": {{ config.baseUrl }},
"url": {{ config.base_url }},
"logo": {
"@type": "ImageObject",
"url": {{ logo_url }}
"url": {{ config.base_url + "/logo.svg" }}
}
}
}

View File

@ -1,3 +1,3 @@
{% for include in includes %}
{% for include in config['includes'] %}
<script defer src="/js/{{ include }}"></script>
{% endfor %}

View File

@ -1,9 +1,11 @@
<div class="sidebar">
<section>
{% for section, urls in posts[language].items() %}
<p>
<a href="/{{ language}}/{{ section }}">{{ translate(section, language) }} ({{ urls | length }})</a>
</p>
{% if section != "/" %}
<p>
<a href="/{{ language}}/{{ section }}">{{ translate(section, language) }} ({{ urls | length }})</a>
</p>
{% endif %}
{% endfor %}
</section>
</div>
</div>

View File

@ -1,20 +1,20 @@
<div class="social-icons">
{{ if .Site.Params.youtube }}
<a href="https://youtube.com/{{ .Site.Params.Youtube }}">
<img src="data:image/svg+xml;base64,{{ readFile "/static/images/youtube.svg" | base64Encode }}"
alt="{{ .Site.Title }}" width="100" />
{% if config.languages[language].youtube %}
<a href="https://youtube.com/{{ config.languages[language].youtube }}">
<img src="/images/youtube.svg"
alt="{{ config.languages[language].title }}" width="100" />
</a>
{{ end }}
{{ if .Site.Params.github }}
<a href="https://github.com/{{ .Site.Params.Github }}">
<img src="data:image/svg+xml;base64,{{ readFile "/static/images/github.svg" | base64Encode }}"
alt="{{ .Site.Title }}" width="100" />
{% endif %}
{% if config.languages[language].github %}
<a href="https://github.com/{{ config.languages[language].github }}">
<img src="/images/github.svg"
alt="{{ config.languages[language].title }}" width="100" />
</a>
{{ end }}
{{ if .Site.Params.telegram }}
<a href="https://t.me/{{ .Site.Params.Telegram }}">
<img src="data:image/svg+xml;base64,{{ readFile "/static/images/telegram.svg" | base64Encode }}"
alt="{{ .Site.Title }}" width="100" />
{% endif %}
{% if config.languages[language].telegram %}
<a href="https://t.me/{{ config.languages[language].telegram }}">
<img src="/images/telegram.svg"
alt="{{ config.languages[language].title }}" width="100" />
</a>
{{ end }}
{% endif %}
</div>