
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
npm install -g writr
blog/*.md //markdown files in the folder root
blog/images //images for the blog
blog/config.json //config file
blog/templates //template directory for your index, post, and tag
writr --path ./blog
Then in express map your blog_output
via static files:
app.use("/blog/*/images", express.static(path.join(__dirname, "blog_output/images")))
app.use("/blog/images", express.static(path.join(__dirname, "blog_output/images")))
app.use("/blog", express.static(path.join(__dirname, "blog_output")))
There are three templates that are part of every instance of Writr. By default it goes in the /blog/templates
directory. Here are the files and are in Handlebars
format:
You can also set a post to use a different layout by setting the layout
value in the front-matter
like so:
---
title: 'Docula: Persistent Links and Styles!'
tags:
- Github
- Open Source
- Docula
date: 2017-03-07
layout: post2
featured_image: Docula_%20Persistent%20Links%20and%20Styles%201.jpeg
---
In your posts front-matter
you can specify the format of the url to be generated. Be default is the :title
(also known as the none
style) that is formatted correctly.
Variable | Description |
---|---|
year | Year from the post’s filename with four digits. |
short_year | Year from the post’s filename without the century. (00..99) |
month | Month from the post’s filename. (01..12) |
i_month | Month without leading zeros |
short_month | Three-letter month abbreviation, e.g. "Dec". |
long_month | Full month name, e.g. “January”. |
day | Day of the month from the post’s filename. (01..31) |
i_day | Day of the month without leading zeros from the post’s filename. |
y_day | Day of the year (01...365) |
short_day | Three-letter weekday abbreviation, e.g. “Sun”. |
long_day | Weekday name, e.g. “Sunday”. |
week | Week number of the current year, starting with the first week having a majority of its days in January. (01..53) |
hour | Hour of the day, 24-hour clock, zero-padded from the post’s date front matter. (00..23) |
minute | Minute of the hour from the post’s date front matter. (00..59) |
second | Second of the minute from the post’s date front matter. (00..59) |
title | Title from the document’s front matter. |
You can simply put in the style on permalink setting in the individual post front-matter
or globally in config.json
Style | Template |
---|---|
default | /:title/ |
date | /:year/:month/:day/:title/ |
ordinal | /:year/:y_day/:title/ |
---
title: 'Docula: Persistent Links and Styles!'
tags:
- Github
- Open Source
- Docula
permalink: simple
date: 2017-03-07
layout: post2
featured_image: Docula_%20Persistent%20Links%20and%20Styles%201.jpeg
---
To set it globally you can set it in the config.json
by setting the permaLink
variable like so:
{
"output" : "./blog_output",
"render": [ "html" , "json", "atom", "images"],
"path": "./blog_example",
"title": "Example Blog",
"url": "https://writr.io/blog",
"authorName": "Jared Wray",
"authorEmail": "me@jaredwray.com",
"permalink": ":year/:month/:title"
}
To learn more about Markdown go here: https://markdownguide.org
FAQs
Markdown Rendering Simplified
The npm package writr receives a total of 1,015 weekly downloads. As such, writr popularity was classified as popular.
We found that writr 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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.