且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jekyll带有Markdown的无扩展永久链接

更新时间:2023-12-05 19:56:46

我认为您做得正确,这只是正确配置Web服务器的问题(假设它支持删除扩展名).它在本地正常工作,因为默认情况下内置的jekyll Web服务器可以做到这一点.文档在此处提供有关此信息:

I think you are doing it correctly, it is just a matter of configuring your webserver properly (assuming it supports removing the extension). It works properly locally cause the built in jekyll webserver can do it by default. The docs have info on this here:

http://jekyllrb.com/docs/permalinks/#extensionless-permalinks

在AWS S3上,您可以通过上载没有扩展名的文件,然后将内容类型设置为text/html来使用无扩展名的URL进行托管.我认为不可能让jekyll以contact的形式输出contact.html而没有扩展名.因此,您可以在Web服务器上删除该扩展名(如果支持)(在s3上,我使用结尾的/).

On AWS S3 it says you can host with extensionless urls by uploading files with no extension at all, and then setting the content type to text/html. I don't think it is possible to get jekyll to output contact.html as just contact with no extension. So you get the web server to remove the extension, if it supports that (on s3 I use the trailing /).

这也有一些有趣的信息: https://github.com/jekyll/jekyll/issues/3345

This has some interesting info too: https://github.com/jekyll/jekyll/issues/3345