create-harold-app
Advanced tools
Comparing version 0.3.3 to 0.4.0
@@ -0,1 +1,8 @@ | ||
### [0.4.0](https://github.com/juliancwirko/create-harold-app/releases/tag/v0.4.0) (2021-06-04) | ||
- support for relative paths, now you can host it in subdirectory | ||
- added `relativePath` and `hostDirName` handlebars helpers | ||
- new configuration in `.haroldrc` if needed (outputDirName, hostDirName) | ||
- new documentation articles and updates | ||
### [0.3.3](https://github.com/juliancwirko/create-harold-app/releases/tag/v0.3.3) (2021-05-31) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "create-harold-app", | ||
"version": "0.3.3", | ||
"version": "0.4.0", | ||
"description": "Static blog/site generator", | ||
@@ -5,0 +5,0 @@ "author": "Julian Ćwirko (julian.io)", |
@@ -61,4 +61,6 @@ ## create-harold-app | ||
For now, there isn't much to configure, but you can configure the directory for md files (by default `posts`) and the directory for md files layouts (by default `blog-layouts`). Quite helpful because these names are also used in urls. For example, by default, `/posts/name-of-the-post` (name of the .md file), but you might want to build the docs website and have `/docs/name-of-the-doc` (name of the .md file). | ||
You can configure the directory for md files (by default `posts`) and the directory for md files layouts (by default `blog-layouts`). Quite helpful because these names are also used in urls. For example, by default, `/posts/name-of-the-post` (name of the .md file), but you might want to build the docs website and have `/docs/name-of-the-doc` (name of the .md file). | ||
You can also configure the name for output directory using `outputDirName` and if you want to host your site in subdirectory you would also need to add `hostDirName`. | ||
Example of `.haroldrc` (placed in the root of your harold app): | ||
@@ -69,3 +71,5 @@ | ||
mdFilesDirName: 'docs', | ||
mdFilesLayoutsDirName: 'docs-layouts' | ||
mdFilesLayoutsDirName: 'docs-layouts', | ||
outputDirName: 'dist', | ||
hostDirName: 'subfolder-name' | ||
} | ||
@@ -147,2 +151,25 @@ ``` | ||
#### 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. | ||
```bash | ||
{ | ||
outputDirName: 'docs', | ||
} | ||
``` | ||
Build your Harold app and push it to the repo. Remember to add the `.gitignore` file, and exclude `node_modules` but keep the output directory (`docs`). | ||
Configure your Github Pages to take the source from the `docs` directory. | ||
If you want to host Harold's website under the repository subdirectory name (username.github.io/my-blog), you need to add `hostDirName` and remember to keep your paths in order. You can use the `relativePath` handlebars helper. The default template (from v0.4.0) is already using it, so it should work as-is. | ||
```bash | ||
{ | ||
outputDirName: 'docs', | ||
hostDirName: 'my-blog' | ||
} | ||
``` | ||
### Why another one? | ||
@@ -163,5 +190,5 @@ | ||
- when you want to build something significant (not tested with big projects, tested with over 120 markdown files, works quite fast) | ||
- when you don't want to use Scss (you can still write standard CSS in .scss files) | ||
- when you want to rely on something which has its community | ||
- when you want to build bigger projects (not tested with big projects, tested with over 120 markdown files, works quite fast) | ||
- when you don't want to use Scss (you can still write standard CSS in .scss files) or Handlebars | ||
- when you want to rely on something which has big community | ||
@@ -172,4 +199,10 @@ ### License | ||
### Harold is built upon these excellent tools: | ||
- [unified](https://unifiedjs.com/) | ||
- [Handlebars](https://handlebarsjs.com/) | ||
- [Sass](https://sass-lang.com/) | ||
### Contact | ||
julian.io |
(function () { | ||
// Trigger search overlay events and logic | ||
const postsPath = '/posts/'; | ||
const rootDir = document.querySelector('html').dataset.hrldRoot; | ||
const postsPath = | ||
(rootDir && window.location.href.includes(rootDir) ? '/' + rootDir : '') + | ||
'/posts/'; | ||
const searchIcon = document.querySelector('[data-js-search]'); | ||
@@ -5,0 +8,0 @@ const searchIconClose = document.querySelector('[data-js-search-close]'); |
const harold = (function () { | ||
let searchIndex; | ||
let postsJSON; | ||
const postsJsonDataPath = '/jsonData/posts.json'; | ||
const rootDir = document.querySelector('html').dataset.hrldRoot; | ||
const postsJsonDataPath = | ||
(rootDir && window.location.href.includes(rootDir) ? '/' + rootDir : '') + | ||
'/jsonData/posts.json'; | ||
@@ -6,0 +9,0 @@ // Loads data for search index |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165078
460
204