bunki 0.18.6 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -1
- package/dist/cli.js +403 -246
- package/dist/fragments/json-ld.njk +59 -0
- package/dist/fragments/og-image.njk +21 -0
- package/dist/fragments/pagination.njk +12 -0
- package/dist/fragments/share-buttons.njk +21 -0
- package/dist/index.js +0 -32874
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{% macro blog_posting_schema(post, site) %}
|
|
2
|
+
<script type="application/ld+json">
|
|
3
|
+
{
|
|
4
|
+
"@context": "https://schema.org",
|
|
5
|
+
"@type": "BlogPosting",
|
|
6
|
+
"headline": "{{ post.title }}",
|
|
7
|
+
"description": "{{ post.excerpt }}",
|
|
8
|
+
"author": {
|
|
9
|
+
"@type": "Person",
|
|
10
|
+
"name": "{{ site.author | default('Author') }}",
|
|
11
|
+
"url": "{{ site.baseUrl }}"
|
|
12
|
+
},
|
|
13
|
+
"publisher": {
|
|
14
|
+
"@type": "Organization",
|
|
15
|
+
"name": "{{ site.title }}",
|
|
16
|
+
"url": "{{ site.baseUrl }}",
|
|
17
|
+
"logo": {
|
|
18
|
+
"@type": "ImageObject",
|
|
19
|
+
"url": "{{ site.baseUrl }}/favicon/favicon.svg"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"datePublished": "{{ post.date | date('YYYY-MM-DDTHH:mm:ssZ') }}",
|
|
23
|
+
"mainEntityOfPage": {
|
|
24
|
+
"@type": "WebPage",
|
|
25
|
+
"@id": "{{ site.baseUrl }}{{ post.url }}"
|
|
26
|
+
}{% if post.tags %},
|
|
27
|
+
"keywords": "{{ post.tags | join(', ') }}"{% endif %}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
{% endmacro %}
|
|
31
|
+
|
|
32
|
+
{% macro local_business_schema(post, site) %}
|
|
33
|
+
{% if post.business %}
|
|
34
|
+
<script type="application/ld+json">
|
|
35
|
+
{
|
|
36
|
+
"@context": "https://schema.org",
|
|
37
|
+
"@type": "{{ post.business.type | default('LocalBusiness') }}",
|
|
38
|
+
"name": "{{ post.business.name }}",
|
|
39
|
+
"address": {
|
|
40
|
+
"@type": "PostalAddress",
|
|
41
|
+
"streetAddress": "{{ post.business.address }}"
|
|
42
|
+
},
|
|
43
|
+
{% if post.business.lat and post.business.lng %}
|
|
44
|
+
"geo": {
|
|
45
|
+
"@type": "GeoCoordinates",
|
|
46
|
+
"latitude": {{ post.business.lat }},
|
|
47
|
+
"longitude": {{ post.business.lng }}
|
|
48
|
+
},
|
|
49
|
+
{% endif %}
|
|
50
|
+
{% if post.business.cuisine %}"servesCuisine": "{{ post.business.cuisine }}",{% endif %}
|
|
51
|
+
{% if post.business.priceRange %}"priceRange": "{{ post.business.priceRange }}",{% endif %}
|
|
52
|
+
{% if post.business.telephone %}"telephone": "{{ post.business.telephone }}",{% endif %}
|
|
53
|
+
{% if post.business.url %}"url": "{{ post.business.url }}",{% endif %}
|
|
54
|
+
{% if post.business.openingHours %}"openingHours": "{{ post.business.openingHours }}",{% endif %}
|
|
55
|
+
"url": "{{ site.baseUrl }}{{ post.url }}"
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
{% endif %}
|
|
59
|
+
{% endmacro %}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% macro og_image(post, site) %}
|
|
2
|
+
{% if post and post.image %}
|
|
3
|
+
<meta property="og:image" content="{{ post.image }}">
|
|
4
|
+
<meta property="og:image:type" content="image/jpeg">
|
|
5
|
+
<meta property="og:image:width" content="1200">
|
|
6
|
+
<meta property="og:image:height" content="630">
|
|
7
|
+
{% else %}
|
|
8
|
+
<meta property="og:image" content="{{ site.baseUrl }}/favicon/favicon.svg">
|
|
9
|
+
<meta property="og:image:type" content="image/svg+xml">
|
|
10
|
+
<meta property="og:image:width" content="200">
|
|
11
|
+
<meta property="og:image:height" content="200">
|
|
12
|
+
{% endif %}
|
|
13
|
+
{% endmacro %}
|
|
14
|
+
|
|
15
|
+
{% macro twitter_image(post, site) %}
|
|
16
|
+
{% if post and post.image %}
|
|
17
|
+
<meta name="twitter:image" content="{{ post.image }}">
|
|
18
|
+
{% else %}
|
|
19
|
+
<meta name="twitter:image" content="{{ site.baseUrl }}/favicon/favicon.svg">
|
|
20
|
+
{% endif %}
|
|
21
|
+
{% endmacro %}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% macro pagination_nav(pagination) %}
|
|
2
|
+
{% if pagination and pagination.totalPages > 1 %}
|
|
3
|
+
<nav class="mt-12 flex items-center gap-4 text-sm text-zinc-600 dark:text-zinc-400" aria-label="Pagination">
|
|
4
|
+
{% if pagination.hasPrevPage %}
|
|
5
|
+
<a href="{{ pagination.pagePath }}{% if pagination.prevPage > 1 %}page/{{ pagination.prevPage }}/{% endif %}" class="rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100 dark:bg-zinc-800/50 dark:text-zinc-300 dark:hover:bg-zinc-800" rel="prev">← Previous</a>
|
|
6
|
+
{% endif %}
|
|
7
|
+
{% if pagination.hasNextPage %}
|
|
8
|
+
<a href="{{ pagination.pagePath }}page/{{ pagination.nextPage }}/" class="rounded-full bg-gray-50 px-3 py-1.5 font-medium text-gray-600 hover:bg-gray-100 dark:bg-zinc-800/50 dark:text-zinc-300 dark:hover:bg-zinc-800" rel="next">Next →</a>
|
|
9
|
+
{% endif %}
|
|
10
|
+
</nav>
|
|
11
|
+
{% endif %}
|
|
12
|
+
{% endmacro %}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% macro share_buttons(post, site) %}
|
|
2
|
+
<footer class="mt-12 pt-8 border-t border-zinc-100 dark:border-zinc-700/40">
|
|
3
|
+
<div class="flex items-center gap-3">
|
|
4
|
+
<span class="text-sm font-medium text-zinc-600 dark:text-zinc-400">Share:</span>
|
|
5
|
+
<div class="flex items-center gap-2">
|
|
6
|
+
<a href="https://twitter.com/intent/tweet?text={{ post.title | urlencode }}&url={{ site.baseUrl }}{{ post.url }}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center justify-center w-9 h-9 rounded-full bg-zinc-100 text-zinc-600 hover:bg-black hover:text-white transition-colors duration-200 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-white dark:hover:text-black" aria-label="Share on X">
|
|
7
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg>
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://www.facebook.com/sharer/sharer.php?u={{ site.baseUrl }}{{ post.url }}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center justify-center w-9 h-9 rounded-full bg-zinc-100 text-zinc-600 hover:bg-[#1877f2] hover:text-white transition-colors duration-200 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-[#1877f2] dark:hover:text-white" aria-label="Share on Facebook">
|
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 3.667h-3.533v7.98H9.101z"/></svg>
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://www.linkedin.com/sharing/share-offsite/?url={{ site.baseUrl }}{{ post.url }}" target="_blank" rel="noopener noreferrer" class="inline-flex items-center justify-center w-9 h-9 rounded-full bg-zinc-100 text-zinc-600 hover:bg-[#0077b5] hover:text-white transition-colors duration-200 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-[#0077b5] dark:hover:text-white" aria-label="Share on LinkedIn">
|
|
13
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M6.5 21.5h-5v-13h5v13zM4 6.5C2.5 6.5 1.5 5.3 1.5 4s1-2.4 2.5-2.4c1.6 0 2.5 1 2.6 2.5 0 1.4-1 2.5-2.6 2.5zm11.5 6c-1 0-2 1-2 2v7h-5v-13h5V10s1.6-1.5 4-1.5c3 0 5 2.2 5 6.3v6.7h-5v-7c0-1-1-2-2-2z"/></svg>
|
|
14
|
+
</a>
|
|
15
|
+
<a href="mailto:?subject={{ post.title | urlencode }}&body=Check%20out%20this%20article%3A%20{{ site.baseUrl }}{{ post.url }}" class="inline-flex items-center justify-center w-9 h-9 rounded-full bg-zinc-100 text-zinc-600 hover:bg-zinc-600 hover:text-white transition-colors duration-200 dark:bg-zinc-800 dark:text-zinc-400 dark:hover:bg-zinc-600 dark:hover:text-white" aria-label="Share via Email">
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>
|
|
17
|
+
</a>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</footer>
|
|
21
|
+
{% endmacro %}
|