Skip to content

Commit

Permalink
Merge branch 'main' into no-css
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlaki authored Mar 3, 2024
2 parents 46ad74c + 1d404e0 commit e721ff2
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ module.exports = config => {
elements.forEach(element => {
const heading = element.querySelector('h2, h3');

if (heading && heading.textContent !== 'Example(s)' && heading.textContent !== 'Argument(s)' && heading.textContent !== 'References') {
if (heading && ! ['Example(s)', 'Argument(s)', 'References'].includes(heading.textContent)) {
toc += `<li class="toc-level-${heading.tagName.toLowerCase()}"><a href="#${heading.id}">${heading.textContent}</a></li>`;
}
});
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ jobs:
name: Install dependencies
run: npm ci
-
name: Run linter
name: Run SASS linter
run: npm run sass:lint
-
name: Run JavaScript linter
run: npm run js:lint
-
name: Build website
run: npm run build
-
name: Check EditorConfig configuration
run: test -f .editorconfig
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ We use `eleventy --serve` and compile Sass with sass-cli with npm scripts.
Before you go live, you should use the production script to compress the Sass files.

```shell
npm run prod
npm run build
```

## SCSS
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"scripts": {
"delete:dist": "del-cli --force dist",
"eleventy:dev": "npx eleventy --serve",
"eleventy:prod": "npx eleventy",
"js:lint": "npx eslint \"src/js/**\"",
"js:lint:fix": "npx eslint \"src/js/**\" --fix",
"prod": "npm-run-all delete:dist sass:prod eleventy:prod",
"sass:dev": "sass --load-path=node_modules --watch --no-source-map --update --style=expanded src/scss:src/css",
"sass:lint:fix": "stylelint src/scss/**/*.scss --fix",
"dist:delete": "del-cli --force dist",
"eleventy:serve": "npx eleventy --serve",
"eleventy:build": "npx eleventy",
"js:lint": "npx eslint 'src/js/**'",
"js:fix": "npx eslint --fix 'src/js/**'",
"build": "npm-run-all dist:delete eleventy:build sass:compile",
"sass:watch": "sass --watch --update --load-path=node_modules --no-source-map --style=expanded src/scss:src/css",
"sass:fix": "stylelint src/scss/**/*.scss --fix",
"sass:lint": "stylelint src/scss/**/*.scss",
"sass:prod": "sass --load-path=node_modules --no-source-map --style=compressed src/scss:src/css",
"start": "npm-run-all --parallel eleventy:dev sass:dev"
"sass:compile": "sass --load-path=node_modules --no-source-map --style=compressed src/scss:src/css",
"start": "npm-run-all --parallel eleventy:serve sass:watch"
},
"devDependencies": {
"@11ty/eleventy": "^2.0.1",
Expand Down
23 changes: 22 additions & 1 deletion src/_data/ui.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
const EleventyFetch = require('@11ty/eleventy-fetch');

module.exports = async (config) => {
module.exports = async () => {
const url = process.env.UI_API_URL;

if (!url) {
const data = [
{
title: 'Introduction',
folder: 'getting-started',
slug: 'introduction',
order: 1,
content: 'Etiam semper luctus nisi sodales commodo. Proin a diam ex. Quisque id arcu turpis. Proin a libero vel quam hendrerit tristique ut et justo.',
},
{
title: 'Config',
folder: 'getting-started',
slug: 'config',
order: 2,
content: 'Donec commodo nibh at suscipit gravida. Suspendisse accumsan blandit velit id finibus. Morbi hendrerit mi id quam egestas, non pulvinar massa sollicitudin.',
},
];

return data;
}

const response = await EleventyFetch(url, {
duration: '0s',
type: 'json',
Expand Down
21 changes: 0 additions & 21 deletions src/_includes/partial/intro.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/js/cookie-consent.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
setCookie, getCookie, issetCookie, removeCookie,
} from './cookie.js';
} from './cookie';

(() => {
const prefix = 'spruce';
Expand Down
2 changes: 1 addition & 1 deletion src/privacy-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: "layout/page.html"

If you accept the cookies in the consent banner, you accept [Google Analytics tracking](https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage), which uses cookies.

We store this choice of you in the `spruce-gdpr-cookies` cookie.
We store this choice of you in the `spruce-cookie-law-analytics` cookie.

If you want to opt-out or accept our cookies, please press the button below.

Expand Down

0 comments on commit e721ff2

Please sign in to comment.