Security News
Highlights from the 2024 Rails Community Survey
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
create-harold-app
Advanced tools
Harold is a static site and blog generator based on Handlebars and Markdown. With a built-in search engine and ready-to-use responsive templates.
Static sites and blogs with HaroldJS
npx create-harold-app my-app
(npx is a package runner tool that comes with npm 5.2+ and higher, see instructions for older npm versions)
npm init harold-app my-app
npm init is available in npm 6+
yarn create harold-app my-app
yarn create is available in Yarn 0.25+
It will create a directory called my-app inside the current folder. Inside that directory, it will generate the initial project structure and install the transitive dependencies.
As an option, you can choose with which template it should init the project. Possible choices:
If you want to init the project with bare
template, pass additional option -t bare
. For example: npm init harold-app my-app -t bare
In the future, there will be a possibility to pass custom templates.
Write create-harold-app --help
in a terminal to get the list of options.
From the newly created app's directory (in our case, my-app
), run npm start
. It will serve the app under localhost:3000
. To change the port, just add PORT
env, like: PORT=3002 npm start
.
Harold will search up the directory tree for configuration in the following places:
harold
property in package.json.haroldrc
file in JSON or YAML format.haroldrc.json
, .haroldrc.yaml
, .haroldrc.yml
, .haroldrc.js
, or .haroldrc.cjs
fileharold.config.js
or harold.config.cjs
CommonJS module exporting an objectFor 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).
Example of .haroldrc
(placed in the root of your harold app):
{
mdFilesDirName: 'docs',
mdFilesLayoutsDirName: 'docs-layouts'
}
Remember to change these directories' names after you init your app.
If you are using the search system, change postsPath
in harold-search.js
.
CHANGELOG.md
harold-scripts
packageBelow are ready-to-use recipes. You can take them as inspiration or copy it as it is and use in your custom template. See more at www.haroldjs.com
You can use postsList
Handlebars helper with perPageLimit
param. You can use tags as categories. Posts will be divided into sections and listed by tag name.
<div class="homepage-section homepage-section-bg">
<div class="container">
<h1 class="homepage-header">Coding</h1>
{{postsList
perPageLimit=3
currentPage=1
className="post-list-items"
dateFormat="dd mmmm yyyy"
byTagName="coding"
readMoreButtonLabel="⇢"
}}
</div>
</div>
<div class="homepage-section">
<div class="container">
<h1 class="homepage-header">Art and Design</h1>
{{postsList
perPageLimit=3
currentPage=1
className="post-list-items"
dateFormat="dd mmmm yyyy"
byTagName="art"
readMoreButtonLabel="⇢"
}}
</div>
</div>
You can use the postsList
with byTagName
, which you should set up the same as the current post tag or tags. This way, you will be able to display a similar posts list. Remember to do this in the layout hbs file, not in Markdown files.
{{postsList
className="docs-articles-list"
byTagName=tags.[0]
}}
{{postsList
perPageLimit=1
currentPage=1
className="homepage-featured-post"
dateFormat="dd mmmm yyyy"
noTags=true
noExcerpt=true
noDate=true
byTagName="featured"
readMoreButtonLabel="Lets dive in!"
}}
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 two 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.
MIT
julian.io
0.3.3 (2021-05-31)
FAQs
Static blog/site generator
The npm package create-harold-app receives a total of 0 weekly downloads. As such, create-harold-app popularity was classified as not popular.
We found that create-harold-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A record 2,709 developers participated in the 2024 Ruby on Rails Community Survey, revealing key tools, practices, and trends shaping the Rails ecosystem.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.