Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: changes in the layout of the main page on github #241

Merged
merged 12 commits into from
Jun 10, 2021
Merged
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
9 changes: 5 additions & 4 deletions .eleventy.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
module.exports = config => {
config.setUseGitIgnore(false);
config.addWatchTarget('pages/static/bundles');
config.addPassthroughCopy({
'pages/static/bundles': '/bundles',
'pages/static/assets': '/assets',
'pages/static/bundles': 'bundles',
'pages/static/assets': 'assets',
});

const environment = process.env.ELEVENTY_ENV;

return {
dir: {
input: 'pages/views-11ty',
output: 'pages/dist',
includes: 'includes',
layouts: 'layouts',
data: 'data',
},
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
Expand Down
27 changes: 3 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
"build-pages": "concurrently \"npm run build-pages:ts\" \"npm run build-pages:less\" && npm run build-pages:eleventy",
"build-pages:ts": "cd pages && webpack",
"build-pages:less": "lessc pages/src/localdev.less pages/static/bundles/localdev.css --source-map=pages/static/bundles/localdev.css.map",
"build-pages:eleventy": "eleventy",
"build-pages:eleventy": "npx @11ty/eleventy -- --env=production",
"watch:ts": "cd pages && webpack --watch",
"watch:less": "chokidar --initial \"**/*.less\" -c \"npm run build-pages:less\"",
"watch:eleventy": "eleventy --serve --port=3005",
"watch:eleventy": "npx @11ty/eleventy --serve --port=3005 -- --env=development",
"test": "concurrently \"npm run lint\" \"npm run test:unit\"",
"test:unit": "jest --silent --noStackTrace",
"test:report": "jest --coverage",
Expand Down
3 changes: 0 additions & 3 deletions pages/src/footer/config.json

This file was deleted.

11 changes: 0 additions & 11 deletions pages/src/footer/footer.html

This file was deleted.

3 changes: 0 additions & 3 deletions pages/src/header/config.json

This file was deleted.

15 changes: 0 additions & 15 deletions pages/src/header/header-menu.html

This file was deleted.

31 changes: 0 additions & 31 deletions pages/src/header/header.html

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
layout: basic
title: ESL Alert component
name: ESL Alert
containerCls: container
tags: basic
name: ESL Alert
path: /basic/esl-alert.html
---

<section class="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
layout: basic
title: ESL Media Component
tags: basic
name: ESL Media
path: /basic/esl-media.html
tags: basic
---

<div class="description">
Expand Down
4 changes: 4 additions & 0 deletions pages/views-11ty/data/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
environment: process.argv.find(arg => arg.startsWith('--env='))?.split('=')[1],
version: process.env.npm_package_version
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
layout: basic
title: ESL Select List
name: ESL Select List
containerCls: container
tags: forms
name: ESL Select List
path: forms/esl-select-list.html
---

<section class="row">
Expand Down
2 changes: 1 addition & 1 deletion pages/views-11ty/includes/footer.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="container">
<div class="text-center">
<div class="text-muted">ESL 2021 Exadel, Inc</div>
<div class="text-muted">ESL v{{ env.version }} © 2021 Exadel, Inc</div>
<div class="text-muted">Core Team Contributors:
<a href="mailto:[email protected]">Alexey Stsefanovich</a>,
<a href="mailto:[email protected]">Julia Murashko</a>,
Expand Down
12 changes: 11 additions & 1 deletion pages/views-11ty/includes/header-menu.njk
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{% macro menu(title, collection) %}
<esl-trigger class="hd-dropdown-trigger" event="hover" target="::next">
<button class="btn btn-link hd-dropdown-btn hd-dropdown-arrow">
<button class="btn btn-link hd-dropdown-btn hd-dropdown-arrow {{ 'text-info' if collection in page.url}}">
{{ title }}
</button>
</esl-trigger>
<esl-panel class="hd-dropdown-content" default-params="{hideDelay: 250}" fallback-duration="500">
<ul class="hd-dropdown-list">
{% for item in collections[collection] %}
{% set isActive = page.url == item.url %}
<li class="nav-item hd-dropdown-item {{ 'active' if isActive }}" {% if isActive %}aria-current="page"{% endif %}>
<a class="hd-dropdown-link" href="{{ item.url }}">{{ item.data.name }}</a>
</li>
{% endfor %}
</ul>
</esl-panel>
{% endmacro %}
12 changes: 6 additions & 6 deletions pages/views-11ty/includes/header.njk
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<nav class="navbar navbar-expand-md navbar-dark bg-dark esl-demo-header">
<div class="container">
<a class="navbar-brand logo-light mr-5" href="./index.html">
<a class="navbar-brand logo-light mr-5" href="/">
{% include "img/logo.svg" %}
<span class="ml-2">Exadel Smart Library</span>
</a>
{% from 'header-menu.njk' import menu %}
{% from 'header-menu.njk' import menu with context %}
<ul class="navbar-nav flex-grow-1">
<li class="nav-item hd-dropdown">
{{ menu ("Components", "component") }}
{{ menu ("Components", "basic") }}
</li>
<li class="nav-item hd-dropdown">
{{ menu ("Form Components", "form") }}
{{ menu ("Form Components", "forms") }}
</li>
{% if config.environment == "local" %}
{% if env.environment == "development" %}
<li class="nav-item hd-dropdown">
{{ menu ("Drafts", "draft") }}
{{ menu ("Drafts", "draft") }}
</li>
{% endif %}

Expand Down
4 changes: 2 additions & 2 deletions pages/views-11ty/index.njk
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ ui_playground: github.com/exadel-inc/ui-playground
<h3 id="components">List of components</h3>
<ul class="list-inline">
{% for item in collections.basic %}
<li class="list-inline-item"><h5><a href="{{ item.data.path }}">{{ item.data.title }}</a></h5></li>
<li class="list-inline-item"><h5><a href="{{ item.url }}">{{ item.data.name }}</a></h5></li>
{% endfor %}
</ul>

<h3 id="form-components">Form Components</h3>
<ul class="list-inline">
{% for item in collections.forms %}
<li class="list-inline-item"><h5><a href="{{ item.data.path }}">{{ item.data.title }}</a></h5></li>
<li class="list-inline-item"><h5><a href="{{ item.url }}">{{ item.data.name }}</a></h5></li>
{% endfor %}
</ul>
<hr/>
Expand Down