Skip to content

Commit

Permalink
Fix several scaling issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Jul 22, 2024
1 parent a1722f4 commit c8b33ce
Show file tree
Hide file tree
Showing 175 changed files with 28,998 additions and 233 deletions.
26 changes: 26 additions & 0 deletions .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy({ "src/assets/img": "img" });
eleventyConfig.addPassthroughCopy("src/**/*.var");
eleventyConfig.addPassthroughCopy({ "src/_data/*.json": "data" });
eleventyConfig.addPassthroughCopy({ "node_modules/bootstrap-icons/font/fonts/*.*": "fonts" });
eleventyConfig.addPlugin(eleventyNavigationPlugin);

eleventyConfig.addTemplateFormats("scss");
Expand All @@ -34,6 +35,30 @@ module.exports = function(eleventyConfig) {
}
);

eleventyConfig.addFilter("getYears",
function(pages) {
return Array.from(new Set(pages.map(item => {
let date = item.data.date;
if (date instanceof Date) {
date = date.toISOString().replace(/:.*$/, "").replace(/T.*$/, "");
}
return date.replace(/-.*$/, "");
})));
}
);

eleventyConfig.addFilter("newsByYear",
function(pages, year) {
return pages.filter(item => {
let date = item.data.date;
if (date instanceof Date) {
date = date.toISOString().replace(/:.*$/, "").replace(/T.*$/, "");
}
return date.startsWith(year);
});
}
);

eleventyConfig.addExtension("scss", {

compileOptions: {
Expand Down Expand Up @@ -72,6 +97,7 @@ module.exports = function(eleventyConfig) {
"navkey": inputPath.replace(".*/", "").replace(".xml", ""),
"eleventyNavigation": {
key: inputPath.replace(".*/", "").replace(".xml", ""),
parent: "Council",
title: jdom.window.document.querySelector("titleStmt > title").textContent
}
}
Expand Down
3 changes: 2 additions & 1 deletion .eleventyignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
node_modules
src/documentation/Documentation/Bylaws
src/documentation/Documentation/bin
src/documentation/Documentation/*.*
src/documentation/Documentation/*.*
src/news/README.md
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.TEIWEB_KEY }}
- run: ssh -o StrictHostKeyChecking=accept-new ${{ secrets.TEIWEB_USER }}@${{ secrets.TEIWEB_HOST }} uptime
- run: rsync -avz -e ssh --delete dist/ ${{ secrets.TEIWEB_USER }}@${{ secrets.TEIWEB_HOST }}:${{ secrets.TEIWEB_PATH }}

- run: |
ssh -o StrictHostKeyChecking=accept-new ${{ secrets.TEIWEB_USER }}@${{ secrets.TEIWEB_HOST }} uptime
rsync -avz -e ssh --delete dist/ ${{ secrets.TEIWEB_USER }}@${{ secrets.TEIWEB_HOST }}:${{ secrets.TEIWEB_PATH }}
75 changes: 45 additions & 30 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"dependencies": {
"bootstrap": "^5.3.1",
"bootstrap-icons": "^1.11.3",
"CETEIcean": "^1.9.1",
"jsdom": "^23.2.0",
"sass": "^1.69.7"
Expand Down
3 changes: 2 additions & 1 deletion src/_includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@
</a>
</p>
</footer>
</div>
</div>
{% include 'searchmenu.html' %}
21 changes: 17 additions & 4 deletions src/_includes/navbar.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<a class="navbar-brand p-0 m-0" href="/">
<img src="/img/emblem_color_dark.png" alt="TEI Emblem" width="40"/>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#TEIMenu" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#TEIMenu" aria-controls="#TEIMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="TEIMenu">
Expand All @@ -27,9 +27,22 @@
{% endif %}
{% endfor %}
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
<button class="btn btn-outline-light" type="submit">Search</button>
<form class="d-flex" action="https://www.google.com/search" method="get">
<input id="query_string" name="q" class="form-control me-2" type="search" placeholder="Search" aria-label="Search" />
<input id="sitesearch" type="hidden" name="sitesearch" value="tei-c.org" />
<div class="btn-group">
<button class="btn btn-outline-light" type="submit">Search</button>
<button type="button" class="btn btn-outline-light dropdown-toggle dropdown-toggle-split"
data-bs-toggle="dropdown" aria-expanded="false">
<span class="visually-hidden">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
<li>
<a class="dropdown-item" href="javascript:setSearch('all')">TEI Site</a>
<a class="dropdown-item" href="javascript:setSearch('guidelines')">Guidelines</a>
</li>
</ul>
</div>
</form>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/_layouts/documentation.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<body>
{% include 'navbar.njk' %}
<nav aria-label="breadcrumb">
{% set breadcrumbs = collections.all | eleventyNavigationBreadcrumb(navkey, {includeSelf: true}) %}
{% set breadcrumbs = collections.all | eleventyNavigationBreadcrumb(eleventyNavigation.key, {includeSelf: true}) %}
<ol class="breadcrumb">
{%- for breadcrumb in breadcrumbs -%}
<li class="breadcrumb-item">
Expand Down
2 changes: 1 addition & 1 deletion src/_layouts/homepage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</div>
</main>
{% include 'footer.html' %}
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/main.js"></script>
</body>
</html>
34 changes: 14 additions & 20 deletions src/_layouts/news.njk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<main>
<div class="container mt-4">
<div class="row">
<div class="col col-9">
<div class="col col-md-9">
{{ content | safe }}
{% for page in collections.news | reverse %}
<div class="article card mt-4">
Expand All @@ -24,25 +24,19 @@
</div>
{% endfor %}
</div>
<div class="col col-3 ms-0 mt-3">
<nav class="navbar navbar-expand-lg">
<span></span>
<button class="navbar-toggler" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidenav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" style="text-align:right">
<span class="navbar-toggler-icon"></span>
</button>
<div class="offcanvas offcanvas-end" id="sidenav">
<div class="offcanvas-header">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<ul>
{% for page in collections.news | reverse %}
<li><a href="{{ page.url }}">{{ page.data.title }}</a></li>
{% endfor %}
</ul>
</div>
</div>
</nav>
<button class="tc-sidebar-toggler btn btn-light" type="button" data-bs-toggle="collapse" data-bs-target="#sidebar" aria-controls="#sidebar" aria-expanded="false" aria-label="Toggle sidebar">
<i class="bi bi-arrow-bar-left"></i>
</button>
<div class="col col-3 ms-0 mt-3 collapse tc-sidebar-collapse small" id="sidebar">
{% set years = collections.news | getYears %}
{% for year in years | reverse %}
<h2 class="h4">{{ year }}</h2>
<ul>
{% for page in collections.news | newsByYear(year) %}
<li><a href="{{ page.url }}">{{ page.data.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}
</div>
</div>
</div>
Expand Down
34 changes: 14 additions & 20 deletions src/_layouts/page.njk
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,27 @@
{% include 'navbar.njk' %}
<main>
<div class="container">
<div class="row justify-content-md-center">
<div class="col col-8 mt-4">
{{ content | safe }}
</div>
<div class="row">
{% if sidenav %}
<div class="col col-md-9 mt-4">
{{ content | safe }}
</div>
<button class="tc-sidebar-toggler btn btn-light" type="button" data-bs-toggle="collapse" data-bs-target="#sidebar" aria-controls="#sidebar" aria-expanded="false" aria-label="Toggle sidebar">
<i class="bi bi-arrow-bar-left"></i>
</button>
{% set navigation = collections.all | eleventyNavigation(sidenav) %}
<div class="col col-2 ms-0 mt-5 small">
<nav class="navbar navbar-expand-lg">
<span></span>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#sidenav" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation" style="text-align:right">
<span class="navbar-toggler-icon"></span>
</button>
<div class="offcanvas offcanvas-end" id="sidenav">
<div class="offcanvas-header">
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
{{ navigation | eleventyNavigationToHtml | safe }}
</div>
</div>
</nav>
<div class="col col-sm-3 collapse tc-sidebar-collapse small" id="sidebar">
{{ navigation | eleventyNavigationToHtml | safe }}
</div>
{% else %}
<div class="col mt-4">
{{ content | safe }}
</div>
{% endif %}
</div>
</div>
</main>
{% include 'footer.html' %}
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/main.js"></script>
</body>
</html>
Loading

0 comments on commit c8b33ce

Please sign in to comment.