Skip to content

Commit

Permalink
Add info on optional titles and file slugs (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwojcik authored Sep 14, 2023
1 parent e01da3e commit e07d15f
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,27 @@ Non-exhaustive list of steps to make the template **your own**. Some of them are
- [ ] Decide if you want to use automated OpenGragh image generation + consider modifying their appearance to suit your taste (see `siteConfig.js` for more info)
- [ ] Copy your existing static assets to `assets` folder. Note that the top of `assets` folder corresponds to the _root directory_ of your site (`_site`)
- [ ] Modify anything else you don't like about the theme to match your preferences
- [ ] Enjoy! :)
- [ ] Enjoy! 😊

## Optional customizations

### Make titles optional + use file slugs for permalinks

By default, the template assumes each post and each page to have a title and generates a permalink out using a `slugify` function. In other words, it converts `A title like this!` into `a-title-like-this`.

If you want your posts to have no title, open `content/posts/posts.json` file and modify the following line:

```json
"permalink": "{% if customPermalink %}{{ customPermalink }}{% else %}/{{ title | slugify }}/{% endif %}",
```

into the following:

```json
"permalink": "{% if customPermalink %}{{ customPermalink }}{% else %}/{{ page.fileSlug }}/{% endif %}",
```

You can do the same for pages by modifying `content/pages/pages.json` file.

## Contributions

Expand Down

1 comment on commit e07d15f

@vercel
Copy link

@vercel vercel bot commented on e07d15f Sep 14, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.