Skip to content

Commit

Permalink
feat(plugin): add warning banner to plugin pages
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Dec 11, 2023
1 parent 6ad095f commit 7482379
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions _includes/icons/warning.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ layout: layouts/base.njk
<p>New plugin releases will not be processed.</p>
<hr/>
<p>The jQuery Plugin Registry is preserved for historical purposes. Search is still supported.</p>
<p class="italic">We do not recommend using any plugins from this registry. Please find jQuery plugins on <a href="https://www.npmjs.com/search?q=keywords:jquery-plugin">npm</a>.</p>
<p class="italic">We do not recommend using any versions of plugins from this registry. Please find jQuery plugins on <a href="https://www.npmjs.com/search?q=keywords:jquery-plugin">npm</a>.</p>
</div>

<div class="flex flex-col px-6 py-5 lg:w-[300px]">
Expand Down
11 changes: 11 additions & 0 deletions content/plugin.njk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@
---

<div class="flex flex-col gap-5 py-5 px-6 lg:flex-row">

<div class="flex flex-col gap-2 grow">
<div class="flex flex-row justify-center gap-1 mb-3 p-4 text-center bg-warning rounded">
<div class="pt-px">
{% include "icons/warning.svg" %}
</div>
<div class="text-lg">
This version is old school.
Please find jQuery plugins on <a href="https://www.npmjs.com/search?q=keywords:jquery-plugin">npm</a>.
</div>
</div>

<h1 class="lg:text-4xl">{{ plugin.name }}</h1>

<div>
Expand Down
5 changes: 0 additions & 5 deletions eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ export default function eleventyConfig(eleventyConfig) {
)
})

eleventyConfig.addFilter('htmlDateString', (dateObj) => {
// dateObj input: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-date-string
return DateTime.fromJSDate(dateObj, { zone: 'utc' }).toFormat('yyyy-LL-dd')
})

// Get the first `n` elements of a collection.
eleventyConfig.addFilter('head', (array, n) => {
if (!Array.isArray(array) || array.length === 0) {
Expand Down
3 changes: 3 additions & 0 deletions styles/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module.exports = {
hover: '#e6e6e6'
},
transparent: 'transparent',
warning: {
DEFAULT: '#ffffaa'
},
white: {
DEFAULT: '#ffffff',
dark: '#f2f2f2',
Expand Down
3 changes: 3 additions & 0 deletions styles/tailwind.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
hr {
@apply bg-gray-lightest my-3 h-3 border-none;
}
svg {
@apply shrink-0;
}

h1 svg,
h2 svg,
Expand Down

0 comments on commit 7482379

Please sign in to comment.