I’m trying to migrate my personal blog from Jekyll & GH Pages to Bridgetown & DO App Engine and I’m having severe issues with Bridgetown and I’d like some tips on resolving that
I read upon the whole page: https://www.bridgetownrb.com/docs/migrating/jekyll
However, there’s one thing that this page doesn’t cover at all: backward compatibility
The thing is: the links are already out there. You can find the links to my blog on multiple resources outside my control – and folks sometimes do access the links. So I’d like to preserve the same behavior I had previously. I’d like my posts to be available at the same links as before – even though the engine has changed
That includes the expectation that I won’t be adding new ways to generate and access those links: I’d like those to freeze in time.
and that’s what I can’t seem to find
Here’s the previous behavior:
- Most of the pages were shared with
.html
extension - One of the pages was shared without the
.html
extension, being a directory - Folks might, in theory, access all pages without the
.html
extension. Doesn’t happen in practice, though
So I’d like to preserve behaviors 1 and 2. What that means is that I’d like the old posts to have the same URL, being year-mm-dd-slug.html
. However, I’ve come to find that no matter how hard I try to patch permalink behavior, Bridgetown cuts off .html
I’ve come to find that there’s code which unconditionally strips HTML from URLs in a resource: https://github.com/bridgetownrb/bridgetown/blob/622b9445886bceb2faccbf74e787115b500dc3c7/bridgetown-core/lib/bridgetown-core/resource/base.rb#L376
and I can’t seem to be able to access raw, unfiltered URLs
what can I do here?
@Morozzzko@community.bridgetown.pub Glad to hear you’re giving Bridgetown a try!
So…I’m not entirely certain what you mean by Bridgetown “cutting off .html”. There are two permalink “endings” as documented here: https://www.bridgetownrb.com/docs/content/permalinks
By using one of the
.*
options, instead of a page located atmy-page-here
being saved tomy-page-here/index.html
, it will be saved tomy-page-here.html
. Now a lot of servers will let you access this page without the.html
extension—in fact, that URL above to the Permalinks docs is exactly that. But you can also add.html
to the end and it will still work. See: https://www.bridgetownrb.com/docs/content/permalinks.htmlI suspect your bigger issue would be getting the right dates set up. We don’t have a YYYY-MM-DD-slug.html option out of the box. However, you could write your own Permalink Processor to handle this: https://www.bridgetownrb.com/docs/plugins/placeholders
If you get stuck there, let me know and I’ll see if I can whip up something to help.