Skip to content

Commit 59a061b

Browse files
authored
mj-include implementation (#6)
mj-include implementation with 2 loaders (filesystem, simple/generic)
1 parent 8e87d78 commit 59a061b

39 files changed

+620
-148
lines changed

data/circular/circular-1.mjml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<mj-section css-class="bg-white">
2+
<mj-column padding="32px 48px">
3+
<mj-include path="circular-2.mjml" />
4+
</mj-column>
5+
</mj-section>

data/circular/circular-2.mjml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<mj-section css-class="bg-white">
2+
<mj-column padding="32px 48px">
3+
<mj-include path="circular-1.mjml" />
4+
</mj-column>
5+
</mj-section>

data/circular/include-circular.mjml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<mjml>
2+
<mj-body>
3+
4+
<mj-section css-class="bg-white">
5+
<mj-column>
6+
<mj-text padding="48px 48px 0 48px">
7+
<p>This is the Index!</p>
8+
</mj-text>
9+
</mj-column>
10+
</mj-section>
11+
12+
<mj-include path="/circular/circular-1.mjml" />
13+
</mj-body>
14+
</mjml>

data/import-head.mjml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<mjml>
2+
<mj-head>
3+
<mj-include path="include/import-head-styles.mjml" />
4+
</mj-head>
5+
<mj-body>
6+
<mj-text>test</mj-text>
7+
</mj-body>
8+
</mjml>

data/include-about.mjml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<mjml>
2+
<mj-body>
3+
<mj-include path="include/styling.mjml" />
4+
<mj-include path="include/header.mjml" />
5+
6+
<mj-section css-class="bg-white">
7+
<mj-column>
8+
<mj-text padding="48px 48px 0 48px">
9+
<p>This is the About!</p>
10+
</mj-text>
11+
</mj-column>
12+
</mj-section>
13+
14+
<mj-include path="include/footer.mjml" />
15+
</mj-body>
16+
</mjml>

data/include-index.mjml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<mjml>
2+
<mj-body>
3+
<mj-include path="include/styling.mjml" />
4+
<mj-include path="include/header.mjml" />
5+
6+
<mj-section css-class="bg-white">
7+
<mj-column>
8+
<mj-text padding="48px 48px 0 48px">
9+
<p>This is the Index!</p>
10+
</mj-text>
11+
</mj-column>
12+
</mj-section>
13+
14+
<mj-include path="include/footer.mjml" />
15+
<mj-include path="not-found.mjml" />
16+
</mj-body>
17+
</mjml>

data/include-type-css.mjml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<mjml>
2+
<mj-body>
3+
<mj-section>
4+
<mj-column>
5+
<mj-include type="css" path="include/type.css" />
6+
</mj-column>
7+
<mj-column>
8+
<mj-include type="css" path="include/type2.css" />
9+
</mj-column>
10+
<mj-column>
11+
<mj-include type="css" path="include/non-exist.css" />
12+
</mj-column>
13+
</mj-section>
14+
</mj-body>
15+
</mjml>

data/include-type-html.mjml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<mjml>
2+
<mj-body>
3+
<mj-section>
4+
<mj-column>
5+
<mj-include type="html" path="include/type.html" />
6+
</mj-column>
7+
<mj-column>
8+
<mj-include type="html" path="include/non-exist.html" />
9+
</mj-column>
10+
</mj-section>
11+
</mj-body>
12+
</mjml>

data/include/footer.mjml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<mj-include path="styling.mjml" />
2+
3+
<mj-section css-class="bg-white">
4+
<mj-column padding="32px 48px">
5+
<mj-text>
6+
<p>Cheers,</p>
7+
<p>Me!</p>
8+
</mj-text>
9+
</mj-column>
10+
</mj-section>
11+
<mj-section css-class="bg-white">
12+
<mj-column>
13+
<mj-divider />
14+
</mj-column>
15+
</mj-section>
16+
<mj-section css-class="bg-white">
17+
<mj-column>
18+
<mj-text color="#2F5854" align="center" padding="8px 0">
19+
<p>Something.com ©️ 2023</p>
20+
</mj-text>
21+
</mj-column>
22+
</mj-section>

data/include/header.mjml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<mj-include path="styling.mjml" />
2+
3+
<mj-section css-class="bg-dark" padding="16px">
4+
<mj-column>
5+
<mj-spacer height="32px" />
6+
</mj-column>
7+
</mj-section>

0 commit comments

Comments
 (0)