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

Added feature to allow default extensions #1

Closed
wants to merge 2 commits into from

Conversation

dploeger
Copy link

@dploeger dploeger commented Nov 6, 2017

This PR adds a feature to allow a default extension for files, that have no extension set after filtered.

The need for this feature came along, because we wanted to host the generated documentation in another generated documentation and that didn't work without the .html extension for HTML files in links.

This PR adds an option called "defaultExt" which can be set to e.g. ".html" and will set this extension in the _href data for pages, that have no extension (e.g. Markdown-sources). Generated Index files are left out.

@dploeger
Copy link
Author

dploeger commented Nov 6, 2017

I added a test for it. However, the test suite doesn't succeed, but I believe that's not due to my changes.

@dploeger
Copy link
Author

dploeger commented Aug 9, 2018

@jldec Could this be merged?

@jldec
Copy link
Owner

jldec commented Aug 13, 2018

Hi @dploeger thanks for the inquiry - sorry for the delays - this projects has had to take a back seat for a little while. Your PR suggestion looks reasonable - the only only change i might ask for the defaultExt option to live on the source intead of the root of the opts object.

I'm in the process of doing a general housekeeping upgrade of the modules in pub-server/pub-generator - hopefully that will allow me to fix the failing test and then merge your change.

@dploeger
Copy link
Author

Thank you.

I've integrated the additional change you asked for.

Base automatically changed from master to main March 7, 2021 12:02
@jldec
Copy link
Owner

jldec commented Feb 16, 2023

Setting source.defaultExt to .htm or .html will create hrefs with one of those extensions, instead of no extension.

The same is also possible by setting an explicit extension for the href in the markdown file frontmatter.

See pub-server v2.11.3 or pub-generator v.4.3.5

@jldec jldec closed this Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants