Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XHTML rather than HTML #1922

Closed
FearGoidte opened this issue Jan 7, 2014 · 11 comments

Comments

@FearGoidte
Copy link

commented Jan 7, 2014

Probably my own poor searching skills but I can’t work out how to manipulate Jekyll into spitting out xhtml rather than html files. The index page works by simply renaming the file but the posts continue to generate as .html.

I realize that authoring in XHTML (especially serving as application/xhtml+xml) is somewhat niche but it’s a habit I’m loathe to give up.

I’m using GitHub as a host which limits the tinkering options, I had hoped that it was available ‘out of the box’.

Could anyone point me in the right direction or dash my hopes?

@parkr

This comment has been minimized.

Copy link
Member

commented Jan 7, 2014

If you wish to write XHTML, all your files will have to use converters that output XHTML. You can either use the .html extension for everything (including posts) and write XHTML in them, or use a converter that we support to output XHTML instead of something else. If you go the former route, Jekyll will essentially be a glorified layout manager with Liquid support. :)

@parkr parkr closed this Jan 7, 2014

@FearGoidte

This comment has been minimized.

Copy link
Author

commented Jan 7, 2014

Thanks for the swift and decisive reply. No problems with outputting valid xhtml from markdown, just with getting the files served with the correct mimetype. I tried using permalinks to put .xhtml at the end of the urls but a trailing slash was added.

@parkr

This comment has been minimized.

Copy link
Member

commented Jan 7, 2014

That's outside Jekyll's hands, unfortunately. The jekyll serve command is just for local development so wherever you put your files should be where you ensure the MIME type is right. What server/service are you using?

@FearGoidte

This comment has been minimized.

Copy link
Author

commented Jan 8, 2014

I’ve just been experimenting on my own machine and GitHub. The index page works by just changing the extension to xhtml but the layout templates don’t pass their extension onto the pages they generate.

@parkr

This comment has been minimized.

Copy link
Member

commented Jan 8, 2014

Right, so each page is converted individually and placed in the layouts specified (if specified). There's no inheritance of types or anything -- it's all page-based. Why not add a meta tag that specifies the Content-Type as XHTML?

@FearGoidte

This comment has been minimized.

Copy link
Author

commented Jan 8, 2014

I’d completely forgotten that meta tag, usually ignored but wortha try. Just to clarify, there is then no way to change the extension that converted files will have?

@parkr

This comment has been minimized.

Copy link
Member

commented Jan 8, 2014

Yes! As long as it doesn't match the markdown or textile converters, it should just be output in the same format.

source/_posts/2013-03-21-my-post.xhtml should be output as .xhtml files.

@FearGoidte

This comment has been minimized.

Copy link
Author

commented Jan 8, 2014

I do want to use markdown though. Thanks for your help, I need to get more into the nuts and bolts. I’ll play around and see if I can get it to use the rRdcarpet xhtml renderer instead

@parkr

This comment has been minimized.

Copy link
Member

commented Jan 8, 2014

@FierceBadRabbit If you want to use Markdown and output to .xhtml files, you'll need to patch Markdown#output_ext.

@FearGoidte

This comment has been minimized.

Copy link
Author

commented Jan 11, 2014

Thanks for the suggestions and help. I’ve dug into Jekyll some more before surrendering. As a parting shot, though few people choose to serve HTML5 as XHTML, should there be a wish to enable support for this within Jekyll (so it could be used with Github pages for example) then their would need to be an option in _config.yml to switch to Redcarpet’s XHTML renderer and to change the output file extension to XHMTL.

@ghost

This comment has been minimized.

Copy link

commented Aug 10, 2015

Enable xhtml github pages

@jekyll jekyll locked and limited conversation to collaborators Aug 10, 2015

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.