docpad / docpad-plugin-cleanurls Goto Github PK
View Code? Open in Web Editor NEWAdds support for clean urls to DocPad
License: Other
Adds support for clean urls to DocPad
License: Other
Was wondering if someone could create a new release of master branch and publish to npm. Thanks in advance :)
Via #9 (comment)
Good to implement.
I've been getting this error inside cleanurls. I have no idea why. The key with a value of 3 is _curOpen.
error: Something went wrong with the action
error: An error occured:
TypeError: Object -3 has no method 'bind'
at Object.<anonymous> (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad-plugin-cleanurls/node_modules/safefs/out/lib/safefs.js:119:27)
at Object.<anonymous> (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad-plugin-cleanurls/node_modules/safefs/out/lib/safefs.js:125:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad-plugin-eco/node_modules/eco/node_modules/coffee-script/lib/coffee-script/coffee-script.js:211:36)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at CleanUrlsPlugin.writeAfter (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad-plugin-cleanurls/out/cleanurls.plugin.js:66:18)
at ambi (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:23:18)
at Task.<anonymous> (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad/node_modules/event-emitter-grouped/out/lib/event-emitter-grouped.js:38:23)
at ambi (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad/node_modules/ambi/out/lib/ambi.js:23:18)
at fire (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:159:23)
at b (domain.js:183:18)
at Domain.run (domain.js:123:23)
at Task.fire (/Users/Thoughtworker/repos/opensource/zurb-foundation.docpad/node_modules/docpad/node_modules/taskgroup/out/lib/taskgroup.js:166:25)
at processImmediate [as _immediateCallback] (timers.js:330:15)
Currently cleanurls does not handle a trailing slash added (when configured with false). That is, http://docpad.org/docs/begin/ produces a 401 rather than a 301 to http://docpad.org/docs/begin.
Is it possible to output site pages inside a directory with the "page name" and an "index.html" file inside? This would provide a clean url with a "/" ending in the url address.
Python's Pelican static site generator uses a config file to specify this function simply like so:
PAGE_SAVE_AS = '{slug}/index.html'
{slug} would be the page name used in the markdown file.
Thanks
geturl allows you to change the root directory of some of the documents, allowing you to host the site on a sub-directory rather than on the docroot.
Currently, the Base URL is to be assumed at /, but it would be great if we used geturl or similar to allow usage as a different base URL.
https://github.com/docpad/docpad-plugin-cleanurls/blob/master/src/cleanurls.plugin.coffee#L17
Not compatible with docpad-plugin-paged
Just an FYI, paged plugin uses the base file name and extension to generate paginated pages. I'll look into fixing one or the other.
Say I have 01-index.html
, 02-getting-started.html
and so on. Is there was to have clean urls emit urls like /index
and /getting-started
instead of /01-index
and /02-getting-started
?
I can remove the numeric from file and have the order in metadata instead which will avoid this issue. But having them on the file makes it easier to glean info about which file goes first and so on.
Maybe its possible via advancedRedirect
rules? Or maybe there is an even simpler way?
When inside the static environment we should:
Currently with v2.3 with static environments we don't take custom urls into account at all.
line 80 in your src plugin code there is :
if 'static' in docpad.getEnvironments()
the static features could also be triggered by a custom parameters to not enforce static env name use. It could improve compatibility with other plugin using env specific rules.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.