Skip to content

Commit 7a335fb

Browse files
authored
Merge branch 'main' into davidnuescheler-patch-1
2 parents 47a9417 + 5ad30db commit 7a335fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+3611
-10887
lines changed

.eslintrc.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ module.exports = {
1111
requireConfigFile: false,
1212
},
1313
rules: {
14-
// allow reassigning param
15-
'no-param-reassign': [2, { props: false }],
16-
'linebreak-style': ['error', 'unix'],
17-
'import/extensions': ['error', {
18-
js: 'always',
19-
}],
14+
'import/extensions': ['error', { js: 'always' }], // require js file extensions in imports
15+
'linebreak-style': ['error', 'unix'], // enforce unix linebreaks
16+
'no-param-reassign': [2, { props: false }], // allow modifying properties of param
2017
},
2118
};

.github/pull_request_template.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Please always provide the [GitHub issue(s)](../issues) your PR is for, as well a
33
Fix #<gh-issue-id>
44

55
Test URLs:
6-
- Before: https://main--helix-block-collection--adobe.hlx.page
7-
- After: https://<branch>--helix-block-collection--adobe.hlx.page
6+
- Before: https://main--{repo}--{owner}.aem.live/
7+
- After: https://<branch>--{repo}--{owner}.aem.live/

.github/workflows/main.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Use Node.js 20
10+
uses: actions/setup-node@v4
11+
with:
12+
node-version: 20
13+
- run: npm ci
14+
- run: npm run lint

.github/workflows/run-tests.yaml

-17
This file was deleted.

.renovaterc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"extends": ["github>adobe/helix-shared"]
2+
"extends": ["config:recommended"]
33
}

404.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
<meta property="og:title" content="Page not found">
1212
<script src="/scripts/scripts.js" type="module" crossorigin="use-credentials"></script>
1313
<script type="module">
14-
import { sampleRUM } from '/scripts/aem.js';
15-
1614
window.addEventListener('load', () => {
1715
if (document.referrer) {
1816
const { origin, pathname } = new URL(document.referrer);
@@ -26,9 +24,12 @@
2624
btnContainer.append(backBtn);
2725
}
2826
}
29-
sampleRUM('404', { source: document.referrer, target: window.location.href });
3027
});
3128
</script>
29+
<script type="module">
30+
import { sampleRUM } from '/scripts/aem.js';
31+
sampleRUM('404', { source: document.referrer });
32+
</script>
3233
<link rel="stylesheet" href="/styles/styles.css">
3334
<style>
3435
main.error {

README.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,35 @@
1-
# Block Collection
2-
3-
This project contains code that is featured in the [AEM Block Collection](https://www.aem.live/developer/block-collection#block-collection-1) documentation.
1+
# Your Project's Title...
2+
Your project's description...
43

54
## Environments
6-
- Preview: https://main--aem-block-collection--adobe.hlx.page/
7-
- Live: https://main--aem-block-collection--adobe.hlx.live/
5+
- Preview: https://main--{repo}--{owner}.aem.page/
6+
- Live: https://main--{repo}--{owner}.aem.live/
7+
8+
## Documentation
9+
10+
Before using the aem-block-collection, we recommand you to go through the documentation on https://www.aem.live/docs/ and more specifically:
11+
1. [Developer Tutorial](https://www.aem.live/developer/tutorial)
12+
2. [The Anatomy of a Project](https://www.aem.live/developer/anatomy-of-a-project)
13+
3. [Web Performance](https://www.aem.live/developer/keeping-it-100)
14+
4. [Markup, Sections, Blocks, and Auto Blocking](https://www.aem.live/developer/markup-sections-blocks)
15+
5. [AEM Block Collection](https://www.aem.live/developer/block-collection#block-collection-1)
816

917
## Installation
1018

1119
```sh
1220
npm i
1321
```
1422

23+
## Linting
24+
25+
```sh
26+
npm run lint
27+
```
28+
1529
## Local development
1630

1731
1. Create a new repository based on the `aem-block-collection` template and add a mountpoint in the `fstab.yaml`
18-
1. Add the [aem-code-sync](https://github.com/apps/aem-code-sync) to the repository
32+
1. Add the [AEM Code Sync GitHub App](https://github.com/apps/aem-code-sync) to the repository
1933
1. Install the [AEM CLI](https://github.com/adobe/helix-cli): `npm install -g @adobe/aem-cli`
2034
1. Start AEM Simulator: `aem up` (opens your browser at `http://localhost:3000`)
2135
1. Open the `{repo}` directory in your favorite IDE and start coding :)

blocks/accordion/accordion.css

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
.accordion details {
2-
border: 1px solid var(--dark-color);
2+
border: 1px solid #dadada;
33
}
44

55
/* stylelint-disable-next-line no-descending-specificity */
66
.accordion details + details {
7-
margin-top: 16px;
7+
margin-top: 24px;
8+
}
9+
10+
.accordion details p {
11+
margin-bottom: 0.8em;
812
}
913

1014
.accordion details summary {
1115
position: relative;
1216
padding: 0 16px;
13-
padding-right: 48px;
17+
padding-right: 46px;
1418
cursor: pointer;
1519
list-style: none;
1620
overflow: auto;
@@ -23,21 +27,21 @@
2327

2428
.accordion details summary:focus,
2529
.accordion details summary:hover {
26-
background-color: var(--dark-color);
30+
background-color: var(--light-color);
2731
}
2832

2933
.accordion details summary::-webkit-details-marker {
3034
display: none;
3135
}
3236

3337
.accordion details summary::after {
34-
content: "";
38+
content: '';
3539
position: absolute;
3640
top: 50%;
3741
right: 18px;
3842
transform: translateY(-50%) rotate(135deg);
39-
width: 9px;
40-
height: 9px;
43+
width: 6px;
44+
height: 6px;
4145
border: 2px solid;
4246
border-width: 2px 2px 0 0;
4347
transition: transform 0.2s;
@@ -52,6 +56,6 @@
5256
}
5357

5458
.accordion details[open] .accordion-item-body {
55-
border-top: 1px solid var(--dark-color);
59+
border-top: 1px solid #dadada;
5660
background-color: var(--background-color);
5761
}

blocks/accordion/accordion.js

-10
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,16 @@
44
* https://www.hlx.live/developer/block-collection/accordion
55
*/
66

7-
function hasWrapper(el) {
8-
return !!el.firstElementChild && window.getComputedStyle(el.firstElementChild).display === 'block';
9-
}
10-
117
export default function decorate(block) {
128
[...block.children].forEach((row) => {
139
// decorate accordion item label
1410
const label = row.children[0];
1511
const summary = document.createElement('summary');
1612
summary.className = 'accordion-item-label';
1713
summary.append(...label.childNodes);
18-
if (!hasWrapper(summary)) {
19-
summary.innerHTML = `<p>${summary.innerHTML}</p>`;
20-
}
2114
// decorate accordion item body
2215
const body = row.children[1];
2316
body.className = 'accordion-item-body';
24-
if (!hasWrapper(body)) {
25-
body.innerHTML = `<p>${body.innerHTML}</p>`;
26-
}
2717
// decorate accordion item
2818
const details = document.createElement('details');
2919
details.className = 'accordion-item';

blocks/cards/cards.css

+3-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
margin: 0;
44
padding: 0;
55
display: grid;
6-
grid-template-columns: repeat(auto-fill, minmax(278px, 1fr));
7-
grid-gap: 16px;
6+
grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
7+
grid-gap: 24px;
88
}
99

1010
.cards > ul > li {
11-
border: 1px solid var(--dark-color);
11+
border: 1px solid #dadada;
1212
background-color: var(--background-color);
1313
}
1414

@@ -20,10 +20,6 @@
2020
line-height: 0;
2121
}
2222

23-
.cards .cards-card-body > *:first-child {
24-
margin-top: 0;
25-
}
26-
2723
.cards > ul > li img {
2824
width: 100%;
2925
aspect-ratio: 4 / 3;

blocks/cards/cards.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function decorate(block) {
1212
});
1313
ul.append(li);
1414
});
15-
ul.querySelectorAll('img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }])));
15+
ul.querySelectorAll('picture > img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }])));
1616
block.textContent = '';
1717
block.append(ul);
1818
}

0 commit comments

Comments
 (0)