Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of formatter contentSlug #91

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Variable | Description
`MICROPUB_LAYOUT_NAME` | The name of the Jekyll layout to use for the posts. Set to `false` to have no layout be added. Defaults to `microblogpost`
`MICROPUB_OPTION_DERIVE_CATEGORY` | Override the default category
`MICROPUB_GITHUB_BRANCH` | Branch to use for pushes. Useful to test out if things end up where you want them to. Example: `micropub`
`MICROPUB_CONTENT_SLUG` | Use the content of the post as the slug (first five words). Default is `true`.

#### Complex output styles

Expand Down
3 changes: 2 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ const config = {
layoutName: parseJSON(env[prefix + 'LAYOUT_NAME'], true),
filenameStyle: parseJSON(env[prefix + 'FILENAME_STYLE'], true),
mediaFilesStyle: parseJSON(env[prefix + 'MEDIA_FILES_STYLE'], true),
permalinkStyle: parseJSON(env[prefix + 'PERMALINK_STYLE'], true)
permalinkStyle: parseJSON(env[prefix + 'PERMALINK_STYLE'], true),
contentSlug: parseJSON(env[prefix + 'CONTENT_SLUG'], true)
}
};

Expand Down
3 changes: 2 additions & 1 deletion lib/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ module.exports = function (githubTarget, micropubDocument, siteUrl, options) {
permalinkStyle: options.permalinkStyle,
filenameStyle: options.filenameStyle,
filesStyle: options.mediaFilesStyle,
layoutName: options.layoutName
layoutName: options.layoutName,
contentSlug: options.contentSlug
}))
.then(formatter => formatter.formatAll(micropubDocument))
.then(formatted => {
Expand Down