Skip to content

Commit

Permalink
Rename .njk.md to .md files, flatten source dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Jan 23, 2024
1 parent 342e65d commit c6afdcc
Show file tree
Hide file tree
Showing 22 changed files with 58 additions and 57 deletions.
52 changes: 52 additions & 0 deletions lib/views/partials/plugins.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<div><ul class="PluginList">
{% for plugin in plugins %}
<li class="Plugin {% if plugin.user == 'metalsmith' %}Plugin--core{% endif %}{% if plugin.status =='unmaintained' %} Plugin--unmaintained{% endif %}">
{% if plugin.status =='unmaintained' %}
<span class="Plugin-notice"><i class="Plugin-noticeIcon ss-alert"></i> This plugin hasn't been updated in <abbr title="5 years">a while</abbr>.</span>
{% endif %}
<a class="Plugin-link" href="{{ plugin.repository }}">
<span class="Plugin-user">{{ plugin.user }}</span>
<h1 class="Plugin-title">
<i class="Plugin-icon ss-{{ plugin.icon }}"></i>{{ plugin.name }}
</h1>
<i class="Plugin-arrow ss-right"></i>
<p class="Plugin-description">{{ plugin.description }}</p>
</a>
<div class="Plugin-badgeContainer">
<a class="Plugin-badge" href="{{ plugin.npmUrl }}">
<img
class="b-lazy"
src="{{ placeholderBadgeUrl }}"
data-src="{{ plugin.npmVersion }}"
alt="npm version"
/>
</a>
<a class="Plugin-badge" href="{{ plugin.npmUrl }}">
<img
class="b-lazy"
src="{{ placeholderBadgeUrl }}"
data-src="{{ plugin.npmDownloads }}"
alt="npm downloads per year"
/>
</a>
{% if plugin.githubStars %}
{# this badge will not work for plugins not hosted on Github #}
<a class="Plugin-badge" href="{{ plugin.repository }}">
<img
class="b-lazy"
src="{{ placeholderBadgeUrl }}"
data-src="{{ plugin.githubStars }}"
alt="GitHub stars"
/>
</a>
{% endif %}
{% if plugin.isCorePlugin %}
<span class="Plugin-badge">
<img src="https://img.shields.io/badge/metalsmith-core_plugin-green.svg" alt="core plugin">
</span>
{% endif %}
</div>
<code class="Plugin-snippet desktop-only">npm i {{ plugin.npmName }}</code>
</li>
{% endfor %}
</ul></div>
10 changes: 5 additions & 5 deletions metalsmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,20 @@ function msBuild() {
reverse: true
},
docs: {
pattern: 'docs/*/*.md',
pattern: 'docs/**/*.md',
sortBy: 'order'
}
})
)
.use(
permalinks({
match: '**/*.njk.md',
directoryIndex: 'index.njk.md'
match: '**/*.md',
directoryIndex: 'index.md'
})
)
.use(
inPlace({
pattern: '**/*.md',
transform: 'nunjucks',
engineOptions: {
filters: { formatDate, split },
Expand All @@ -126,8 +127,7 @@ function msBuild() {
inPlace({
transform: 'jstransformer-marked',
engineOptions: {
smartypants: true,
smartLists: true
gfm: true
}
})
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 1 addition & 52 deletions src/plugins/index.njk.md → src/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,58 +18,7 @@ sitemap:
<input class="PluginFilter-input" placeholder="Filter plugins…" />
</label>

<ul class="PluginList">
{% for plugin in plugins %}
<li class="Plugin {% if plugin.user == 'metalsmith' %}Plugin--core{% endif %}{% if plugin.status =='unmaintained' %} Plugin--unmaintained{% endif %}">
{% if plugin.status =='unmaintained' %}
<span class="Plugin-notice"><i class="Plugin-noticeIcon ss-alert"></i> This plugin hasn't been updated in <abbr title="5 years">a while</abbr>.</span>
{% endif %}
<a class="Plugin-link" href="{{ plugin.repository }}">
<span class="Plugin-user">{{ plugin.user }}</span>
<h1 class="Plugin-title">
<i class="Plugin-icon ss-{{ plugin.icon }}"></i>{{ plugin.name }}
</h1>
<i class="Plugin-arrow ss-right"></i>
<p class="Plugin-description">{{ plugin.description }}</p>
</a>
<div class="Plugin-badgeContainer">
<a class="Plugin-badge" href="{{ plugin.npmUrl }}">
<img
class="b-lazy"
src="{{placeholderBadgeUrl}}"
data-src="{{ plugin.npmVersion }}"
alt="npm version"
/>
</a>
<a class="Plugin-badge" href="{{ plugin.npmUrl }}">
<img
class="b-lazy"
src="{{placeholderBadgeUrl}}"
data-src="{{ plugin.npmDownloads }}"
alt="npm downloads per year"
/>
</a>
{% if plugin.githubStars %}
{# this badge will not work for plugins not hosted on Github #}
<a class="Plugin-badge" href="{{ plugin.repository }}">
<img
class="b-lazy"
src="{{placeholderBadgeUrl}}"
data-src="{{ plugin.githubStars }}"
alt="GitHub stars"
/>
</a>
{% endif %}
{% if plugin.isCorePlugin %}
<span class="Plugin-badge">
<img src="https://img.shields.io/badge/metalsmith-core_plugin-green.svg" alt="core plugin">
</span>
{% endif %}
</div>
<code class="Plugin-snippet desktop-only">npm i {{ plugin.npmName }}</code>
</li>
{% endfor %}
</ul>
{% include "./lib/views/partials/plugins.njk" %}

<hr>

Expand Down
File renamed without changes.

0 comments on commit c6afdcc

Please sign in to comment.