chrisdiana / cms.js

Client-Side JavaScript Site Generator

Home Page:http://chrisdiana.github.io/cms.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for websites without Indexing support

mesarpe opened this issue · comments

By changing the line 88 of filecollection.js, it is possible to support web servers without support for the Apache directive DirectoryIndex.

It is necessary to replace:
get(this.getFileListUrl(this.type, config), function(success, error) {
By the following:
get(this.getFileListUrl(this.type, config) + '/index.html', function(success, error) {

Then, we can manually generate the index.html and support every web server. I have tried on release 2.0, and it works successfully.

Cheers and great work!
PS: it's not an issue.... btw.

commented

Very interested but I cannot seem to find filecollection.js after cloning (used recommended git clone https://github.com/chrisdiana/cms.js-starter.git)

Even downloaded the latest release and not in files.

Any advice appreciated.

Thanks for the suggestion @mesarpe! Great thinking! We should be able to roll that into the next release.

@oleteacher it's most likely because the starter project only includes the minified version. you can see the file collection source here.

I wonder if it could be possible to specify a sitemap from a single json or yml config file, for easy to configure completely static sites with no external API calls or indexing required? How hard would that be to adapt here? Thank you!

Hmm, https://github.com/chrisdiana/cms.js/blob/main/src/filecollection.js seems pretty straightforward in terms of being adapted to a static JSON index... would you be open to my trying?

Another way to streamline this could be to run an automated index.html generator such as https://www.npmjs.com/package/generate-index-html as well.