From 3c21a42a054be26f23bea346f13e4e5ffaa8d468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20=C4=86wirko?= Date: Sun, 22 Aug 2021 12:08:41 +0200 Subject: [PATCH] static files copying as an option --- CHANGELOG.md | 4 ++++ README.md | 6 +++++- bin/create-harold-app.js | 3 ++- bin/packagejson.template | 2 +- package-lock.json | 8 ++++---- package.json | 4 ++-- 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 916f051..da0a422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +### [0.8.0](https://github.com/juliancwirko/create-harold-app/releases/tag/v0.7.0) (2021-08-08) + +- possibility to copy custom static files or/and dirs structures starting from the root (use cases: robots.txt, manifest config, etc.) Configurable with .haroldrc file + ### [0.7.0](https://github.com/juliancwirko/create-harold-app/releases/tag/v0.7.0) (2021-08-08) - possibility to pass a custom template package when initializing the project diff --git a/README.md b/README.md index daf6e9c..f6ffe00 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,10 @@ You can use the `postsList` with `byTagName`, which you should set up the same a }} ``` +#### Adding robots.txt, manifest.json, and any other statics + +In many cases, there is a need to add some custom files to the root of your website. You can do this using the optional `src/statics` directory. Example: `src/statics/robots.txt` will be placed in `build/robots.txt` next to your index.html file. You can also nest your directories like `src/statics/some-dir/some-dir/file.txt`. It will land in `build/some-dir/some-dir/file.txt`. + #### Hosting: GitHub Pages If you want to host Harold's website under your main username (username.github.io), you would need to rename your output directory to supported by Github. It is the `docs` directory. You would need to create a `.haroldrc` file and put the output directory name there. @@ -218,7 +222,7 @@ Here is the quick walk-through video on how to do that: I wanted to have a simple static site generator to build and host on Netlify. There are many such solutions, but I wanted to have complete control. -What is essential, I equipped it with three templates that you can use and modify for your needs. I prepared the templates system for custom ones in the future. Templates are great because we don’t need to start every site/blog repeatedly from the ground. +What is essential, I equipped it with three templates that you can use and modify for your needs. I prepared the templates system for custom ones in the future. I also plan to provide some other complete thematic templates. ### When to use it diff --git a/bin/create-harold-app.js b/bin/create-harold-app.js index 52dc8d8..c6b1ea7 100755 --- a/bin/create-harold-app.js +++ b/bin/create-harold-app.js @@ -31,9 +31,10 @@ const args = process.argv; const projectName = args ? args[2] : undefined; program - .option('-t, --template ', 'template type (bare, default)') + .option('-t, --template ', 'Template type (bare, default, docs)') .option('-v, --version', 'Create Harold App version'); program.parse(process.argv); +program.showHelpAfterError(); const options = program.opts(); diff --git a/bin/packagejson.template b/bin/packagejson.template index e7c3602..fb73bce 100644 --- a/bin/packagejson.template +++ b/bin/packagejson.template @@ -8,6 +8,6 @@ "start": "harold-scripts start" }, "devDependencies": { - "harold-scripts": "^0.7.0" + "harold-scripts": "^0.8.0" } } diff --git a/package-lock.json b/package-lock.json index aac0ef9..9857508 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "create-harold-app", - "version": "0.7.0", + "version": "0.8.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -301,9 +301,9 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "commander": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-7.1.0.tgz", - "integrity": "sha512-pRxBna3MJe6HKnBGsDyMv8ETbptw3axEdYHoqNh7gu5oDcew8fs0xnivZGm06Ogk8zGAJ9VX+OPEr2GXEQK4dg==" + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.1.0.tgz", + "integrity": "sha512-mf45ldcuHSYShkplHHGKWb4TrmwQadxOn7v4WuhDJy0ZVoY5JFajaRDKD0PNe5qXzBX0rhovjTnP6Kz9LETcuA==" }, "concat-map": { "version": "0.0.1", diff --git a/package.json b/package.json index 0b591d8..8567372 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-harold-app", - "version": "0.7.0", + "version": "0.8.0", "description": "Static blog/site generator", "author": "Julian Ćwirko (julian.io)", "license": "MIT", @@ -25,7 +25,7 @@ "prettier": "prettier --write '**/*.{js,json}'" }, "dependencies": { - "commander": "^7.1.0", + "commander": "^8.1.0", "cross-spawn": "^7.0.3", "decompress": "^4.2.1", "download": "^8.0.0",