Skip to content

Commit 158918d

Browse files
author
Michel
committed
Asset Auto Discovery
1 parent 15665d1 commit 158918d

14 files changed

+160
-56
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ You need to create a `compile.json` file first (or look at the [example file](ex
4545
| generate | an array of files to generate. The index of the array will be passed in the generation process and is available in the \$nr variable |
4646
| placeholders | (object) - You can use placeholders which will be replaced with the values in this file. |
4747
| output_dir | Where should be the generated files be stored? eg. "../dist". If not specified, the source directory will be used as target directory. |
48-
| zip | (object) settings for the ZIP file generation. Key "filename" is used for the output filename. Key "files" is an array of which files should be stored in the ZIP file. |
48+
| zip | (object) settings for the ZIP file generation. Key "filename" is used for the output filename. Key "files" is an array of which additional files should be stored in the ZIP file. Local image assets will be automatically stored in the zip file|
4949

5050
## Parameters
5151

@@ -63,7 +63,7 @@ You want to extend it? project is open for pull requests :)
6363

6464
Open Source License.
6565
Developed by MilMike // 29.11.2017 (https://www.milmike.com)
66-
Last Update: 01.01.2018 (Happy New Year!)
66+
Last Update: 02.08.2019
6767

6868
## Further Reading
6969

composer.lock

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/dist/compiled_templates.zip

-3.06 KB
Binary file not shown.
-2.94 KB
Loading

example/dist/readme.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This is a sample readme file.
2+
This file will be added to the zip file because it was added in the compile.json file:
3+
4+
5+
"zip": {
6+
"filename": "compiled_templates.zip",
7+
"files": [
8+
"readme.txt"
9+
]
10+
}

example/dist/template_awesome.html

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5-
<meta name="viewport" content="width=1000, initial-scale=1.0">
6-
<meta name="x-apple-disable-message-reformatting">
7-
<title>Example</title>
8-
9-
<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<meta name="viewport" content="width=1000, initial-scale=1.0">
6+
<meta name="x-apple-disable-message-reformatting">
7+
8+
<title>Example</title>
9+
10+
11+
<!-- Developed by Your Company -->
12+
<!-- Last update: 2019-08-02 15:53 -->
13+
1014
</head>
1115
<body style="font-family: Arial;">
1216

13-
<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
17+
<img src="img/htmlmailcompiler-logo.png" alt="">
18+
19+
<h1 style="color: green;">I am a simple html email</h1>
1420

1521
<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
1622
<p style="font-weight: bold;">What can the compiler do for you?</p>
1723
<ul>
18-
<li style="font-size: 18px;">
24+
<li style="font-size: 18px;">
1925
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
2026
</li>
2127

@@ -32,6 +38,7 @@
3238
</li>
3339

3440
</ul>
41+
3542
</div>
3643

3744
<div class="included" style="background-color: silver; padding: 10px;">

example/dist/template_cool.html

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5-
<meta name="viewport" content="width=1000, initial-scale=1.0">
6-
<meta name="x-apple-disable-message-reformatting">
7-
<title>Example</title>
8-
9-
<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<meta name="viewport" content="width=1000, initial-scale=1.0">
6+
<meta name="x-apple-disable-message-reformatting">
7+
8+
<title>Example</title>
9+
10+
11+
<!-- Developed by Your Company -->
12+
<!-- Last update: 2019-08-02 15:53 -->
13+
1014
</head>
1115
<body style="font-family: Arial;">
1216

13-
<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
17+
<img src="img/htmlmailcompiler-logo.png" alt="">
18+
19+
<h1 style="color: green;">I am a simple html email</h1>
1420

1521
<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
1622
<p style="font-weight: bold;">What can the compiler do for you?</p>
1723
<ul>
18-
<li style="font-size: 18px;">
24+
<li style="font-size: 18px;">
1925
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
2026
</li>
2127

@@ -32,6 +38,7 @@
3238
</li>
3339

3440
</ul>
41+
3542
</div>
3643

3744
<div class="included" style="background-color: silver; padding: 10px;">

example/dist/template_yeah.html

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
22
<html xmlns="http://www.w3.org/1999/xhtml">
33
<head>
4-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5-
<meta name="viewport" content="width=1000, initial-scale=1.0">
6-
<meta name="x-apple-disable-message-reformatting">
7-
<title>Example</title>
8-
9-
<!-- Developed by Your Company --> <!-- Last update: 2019-01-01 20:26 -->
4+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5+
<meta name="viewport" content="width=1000, initial-scale=1.0">
6+
<meta name="x-apple-disable-message-reformatting">
7+
8+
<title>Example</title>
9+
10+
11+
<!-- Developed by Your Company -->
12+
<!-- Last update: 2019-08-02 15:53 -->
13+
1014
</head>
1115
<body style="font-family: Arial;">
1216

13-
<img src="img/htmlmailcompiler-logo.png" alt=""><h1 style="color: green;">I am a simple html email</h1>
17+
<img src="img/htmlmailcompiler-logo.png" alt="">
18+
19+
<h1 style="color: green;">I am a simple html email</h1>
1420

1521
<div class="foo" style="background: #f5f5f5; padding: 10px; border: 1px solid gray;">
1622
<p style="font-weight: bold;">What can the compiler do for you?</p>
1723
<ul>
18-
<li style="font-size: 18px;">
24+
<li style="font-size: 18px;">
1925
You can work with CSS selectors and create your styles in a CSS file. The compiler will generate a html file with inline CSS.
2026
</li>
2127

@@ -32,6 +38,7 @@
3238
</li>
3339

3440
</ul>
41+
3542
</div>
3643

3744
<div class="included" style="background-color: silver; padding: 10px;">

example/src/compile.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@
1616
"zip": {
1717
"filename": "compiled_templates.zip",
1818
"files": [
19-
"template_cool.html",
20-
"template_awesome.html",
21-
"template_yeah.html",
22-
"img/htmlmailcompiler-logo.png"
19+
"readme.txt"
2320
]
2421
}
2522
}
-2.94 KB
Loading

0 commit comments

Comments
 (0)