Skip to content

Commit

Permalink
Set contentSlug to true
Browse files Browse the repository at this point in the history
  • Loading branch information
juandpinto committed Jan 1, 2019
1 parent 341db44 commit bf9ad7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Formatter = function (options) {

this.relativeTo = options.relativeTo;
this.markdown = !options.noMarkdown;
this.contentSlug = !!options.contentSlug;
this.contentSlug = true; // !!options.contentSlug;
this.defaults = options.defaults;
this.deriveLanguages = options.deriveLanguages || false;
this.filenameStyle = options.filenameStyle || '_posts/:year-:month-:day-:slug';
Expand Down

5 comments on commit bf9ad7b

@voxpelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juandpinto Is there something I can help you out with here? 🙂

@juandpinto
Copy link
Owner Author

@juandpinto juandpinto commented on bf9ad7b Jan 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@voxpelli Yes please. I'm basically trying to figure out how to customize small parts of the front matter so that the posts match what I usually do for my Hugo website. Here I'm trying to find a way to use the beginning of the post's content for the slug. My microposts don't have a title and the filename follows the format :year-:month-:day-:slug, with :slug being the first three words of a post (hello-my-friends). Right now, a random number is assigned as the slug.

Also, I haven't quite figured out how to get my micropub endpoint to use this version of format-microformat. Here's what I have now, but it's not working.

Thanks in advance, and thanks for making such a great tool!

@voxpelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be a nice addition – I currently don't have that myself either, see this post in my Jekyll site: https://github.com/voxpelli/voxpelli.github.com/blob/master/_posts/2018-12-16-40669.md (Here on my site: https://voxpelli.com/social/2018/12/40669/)

The best solution would be to alter the main project to expose the contentSlugoption there: https://github.com/voxpelli/webpage-micropub-to-github/blob/59e3b686be793b5e156bef97fa3e07bc1252f970/lib/handler.js#L68-L76

I'll add an issue for that 👍 Hopefully I can find time to add it very soon 🙂

@voxpelli
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added here: voxpelli/webpage-micropub-to-github#90

Feel free to ask whatever else you're wondering and/or feel should be changed – I'm always happy to receive feedback 🙂

@juandpinto
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful, thanks!

Please sign in to comment.