Skip to content

Commit

Permalink
Add support for folder instead of single file.
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptex committed Oct 26, 2020
1 parent bc0a268 commit 952cc0e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 307 deletions.
15 changes: 2 additions & 13 deletions .config/browsersync.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
const { argv } = require('yargs');
const url = require('url');

let host = 'localhost';
let proxy = 'localhost';

if (argv.env && argv.env.url) {
host = url.parse(argv.env.url).hostname;
proxy = argv.env.url;
}

module.exports = {
host,
host: 'localhost',
port: 3000,
open: 'external',
files: ['**/*.html'],
Expand All @@ -29,5 +18,5 @@ module.exports = {
fn: (snippet, match) => `${snippet}${match}`
}
},
proxy
proxy: 'localhost'
};
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Three 11
Copyright (c) 2020-Present Three 11

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ In order to use this setup you need to have installed the following dependencies
or
3. Yarn - min v1.3.2
4. Bash terminal (Default on OSX/Linux, GitBash or similar on Windows)
5. A running web server (Apache, MAMP, XAMPP, etc)

## Download

Expand Down Expand Up @@ -55,7 +56,7 @@ npm run build

1. Folder structure:

- `.config/` - configuration files
- `.config/` - configuration files. Currently contains the configuration file for [Browsersync](https://browsersync.io/)
- `assets/` - all images

## LICENSE
Expand Down
286 changes: 0 additions & 286 deletions index.html

This file was deleted.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "email-starter",
"version": "0.0.1",
"description": "Email template starter using the mjml language for smooth and effortless development.",
"name": "email-template",
"version": "1.0.0",
"description": "Email template using the MJML language for smooth and effortless development.",
"scripts": {
"start": "concurrently --kill-others \"yarn bs\" \"yarn mjml\"",
"bs": "browser-sync start --config ./.config/browsersync.js",
"mjml": "mjml -w index.mjml -o index.html",
"build": "rm -rf dist/ && mkdir dist && mjml -v index.mjml && mjml index.mjml -o dist/index.html"
"mjml": "mjml -w ./src/**/*.mjml -o ./dist/",
"build": "rm -rf dist/ && mkdir dist && mjml -v ./src/**/*.mjml && mjml ./src/**/*.mjml -o ./dist/"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion index.mjml → src/index.mjml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<mj-body background-color="#fff">
<mj-section>
<mj-column>
<mj-image width="200px" src="assets/logo.png"></mj-image>
<mj-image width="200px" src="../assets/logo.png"></mj-image>
</mj-column>
</mj-section>

Expand Down

0 comments on commit 952cc0e

Please sign in to comment.