Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,5 @@ module.exports = function (eleventyConfig) {
layouts: 'assets/views/layouts',
data: 'data',
},
templateFormats: ['njk', 'md', '11ty.js'],
};
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
"last 2 versions"
],
"devDependencies": {
"@11ty/eleventy": "^2.0.0-canary.13",
"@11ty/eleventy": "^2.0.0-canary.16",
"@11ty/eleventy-img": "^2.0.1",
"@11ty/eleventy-plugin-webc": "^0.4.0",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-node-resolve": "^13.1.3",
"@rollup/plugin-replace": "^4.0.0",
Expand Down
2 changes: 2 additions & 0 deletions src/assets/styles/_branding.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
--color-background: white;
--color-light: silver;
--color-primary: #7950f2;
--gradientStart: #7950f2;
--gradientEnd: #f783ac;

@media (prefers-color-scheme: dark) {
--color-text: #fff;
Expand Down
19 changes: 19 additions & 0 deletions src/assets/views/components/fancy-rule.webc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<hr>

<style>
fancy-rule > hr {
--gradientStart: #7950f2;
--gradientEnd: #f783ac;
--gradient: linear-gradient(45deg, var(--gradientStart) 10%, var(--gradientEnd) 90%);
--unit: 1rem;

border: 0;
height: 2px;
background-image: var(--gradient);
border-radius: var(--unit);
transform: rotate(-1.5deg);
text-align: center;
margin-top: calc(var(--unit) * 2);
margin-bottom: calc(var(--unit) * 2);
}
</style>
5 changes: 5 additions & 0 deletions src/assets/views/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
{# Page Title #}
<title>{{ title | safe }}</title>

{% renderTemplate "webc" %}
<style @html="this.getCSS(this.page.url)"></style>
<script @html="this.getJS(this.page.url)"></script>
{% endrenderTemplate %}

{# Stylesheet #}
<link rel="stylesheet" href="{{ '/assets/styles/styles.css' | url }}"/>

Expand Down
21 changes: 21 additions & 0 deletions src/config/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@ module.exports = {
eleventyConfig.addPlugin(plugin);
},


/**
* Render plugin
*/
render: function (eleventyConfig) {
let { EleventyRenderPlugin } = require("@11ty/eleventy");
eleventyConfig.addPlugin(EleventyRenderPlugin);
},


/**
* WebC plugin
*/
webc: function (eleventyConfig) {
let plugin = require("@11ty/eleventy-plugin-webc");
eleventyConfig.addPlugin(plugin, {
components: "src/assets/views/components/**/*.webc",
});
},


/**
* Rollup plugin to bundle JavaScript
* https://github.com/Snapstromegon/eleventy-plugin-rollup
Expand Down
6 changes: 5 additions & 1 deletion src/content/pages/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ title: Up to zero! 🪐
<li>Change colors and styles: <code>src/assets/styles/</code></li>
</ul>

<hr>
{% renderTemplate "webc" %}

<fancy-rule></fancy-rule>

{% endrenderTemplate %}

<figure>
{% image "/assets/images/favicon.svg", "ZeroPoint Favicon" %}
Expand Down
Loading