--- title: Permalinks permalink: /docs/permalinks/ --- Permalinks are the output path for your pages, posts, or collections. They allow you to structure the directories of your source code different from the directories in your output. ## Front Matter The simplest way to set a permalink is using front matter. You set the `permalink` variable in front matter to the output path you'd like. For example, you might have a page on your site located at `/my_pages/about-me.html` and you want the output url to be `/about/`. In front matter of the page you would set: ```yaml --- permalink: /about/ --- ``` ## Global Setting a permalink in front matter for every page on your site is no fun. Luckily, Jekyll lets you set the permalink structure globally in your `_config.yml`. To set a global permalink, you use the `permalink` variable in `_config.yml`. You can use placeholders to your desired output. For example: ```yaml permalink: /:categories/:year/:month/:day/:title:output_ext ``` Note that pages and collections (excluding `posts` and `drafts`) don't have time and categories (for pages, the above `:title` is equivalent to `:basename`), these aspects of the permalink style are ignored for the output. For example, a permalink style of `/:categories/:year/:month/:day/:title:output_ext` for the `posts` collection becomes `/:title.html` for pages and collections (excluding `posts` and `drafts`). ### Placeholders Here's the full list of placeholders available:
Variable | Description |
---|---|
|
{{ entry.desc }} |
Permalink Style | URL Template |
---|---|
|
|
Built-in permalink styles are not recognized in front matter. As a result, permalink: pretty
will not work.
Variable | Description |
---|---|
|
{{ entry.desc }} |
Variable | Description |
---|---|
|
{{ entry.desc }} |