jigsaw icon indicating copy to clipboard operation
jigsaw copied to clipboard

Disable pretty url per file in config

Open vladimirmartsul opened this issue 2 years ago • 2 comments

Hi I want to output collections items as pretty url and its ok. But I need to place some Google & Co verification files like 99fea846dfa8ef5396e741837f0dc005fb.html, wmail_897c3284.html, yandex_79283html as is (without moving to pretty-directory). How to achive it? Config param (pretty=>false) and CLI param (--pretty=false) disabled/enabled pretty URLs on whole project only.

vladimirmartsul avatar May 08 '22 18:05 vladimirmartsul

I can second this request. For the most part, I enjoy pretty URLs for my main site development, but I have a few edge cases where I need to disable them for specific collections.

fritosxii avatar Jun 24 '22 18:06 fritosxii

Any update on this?

sawirricardo avatar Jul 18 '22 07:07 sawirricardo

Hey @vladimirmartsul,

not sure this solves it for you, but you can specify the output permalink in the YAML frontmatter like so:

---
permalink: 404.html
---
<!-- The rest of your HTML file -->

Hope this helps! g

morpheus7CS avatar Aug 22 '22 16:08 morpheus7CS

@morpheus7CS's solution is the best way to do this. As he shows, you can add a permalink to YAML frontmatter. There's one other necessary change, though — you need to update your file's extension to .blade.html so that Blade processes it and picks up the frontmatter.

So, rename the file 99fea846dfa8ef5396e741837f0dc005fb.blade.html (or you can give it a more meaningful name, like google-verification.blade.html, then add:

---
permalink: 99fea846dfa8ef5396e741837f0dc005fb.html
---
<!-- The rest of your HTML file -->

damiani avatar Sep 02 '22 14:09 damiani