-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switching to use a custom route provider and scanning the routes.
- Loading branch information
Showing
8 changed files
with
338 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
packages/amagaki-plugin-partial-library/example/views/library.njk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% extends "/views/base.njk" %} | ||
|
||
{% block main %} | ||
<ul> | ||
{% for key, partial in doc.fields.partials %} | ||
<li><a href="{{ doc.fields.library.url.path }}{{key}}/">{{ key }}</a>: {{ partial.length }}</li> | ||
{% endfor %} | ||
</ul> | ||
{% if doc.fields.partial %} | ||
{% set trackedPartial = doc.fields.partials[doc.fields.partial] %} | ||
|
||
<h2>{{ doc.fields.partial }}</h2> | ||
|
||
<dl> | ||
<dt>Instance count ({{trackedPartial.length}}) split by locale</dt> | ||
{% for locale, localeLen in trackedPartial.lengthByLocale %} | ||
<dd>{{locale}}: {{localeLen}}</dd> | ||
{% endfor %} | ||
</dl> | ||
|
||
{% for partialInstance in trackedPartial.instances %} | ||
{# Only show if we have the config. #} | ||
{% if partialInstance.config %} | ||
{% if loop.index > 1 %} | ||
<hr> | ||
{% endif %} | ||
|
||
<div> | ||
{% if partialInstance.urlPath %} | ||
<a href="{{ partialInstance.urlPath }}">{{ partialInstance.urlPath }}</a> | ||
{% endif %} | ||
{% if partialInstance.locale %} | ||
({{partialInstance.locale.id}}) | ||
{% endif %} | ||
</div> | ||
|
||
{% set partial = partialInstance.config %} | ||
{% include "/views/partials/" ~ doc.fields.partial ~ ".njk" %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endblock %} |
58 changes: 0 additions & 58 deletions
58
packages/amagaki-plugin-partial-library/src/partial-library-templates.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.