Giter Site home page Giter Site logo

Comments (11)

thesec avatar thesec commented on June 12, 2024

Not sure if that is what @zenorocha intended as well but am looking for a way to prevent the redirect and render the actual contents within the index.html pages ...

from docpad-plugin-cleanurls.

balupton avatar balupton commented on June 12, 2024

@thesec not sure what you're use case is, but the reason why this isn't done, is that it would destroy SEO though, as you would have a bunch of files with the same content...

from docpad-plugin-cleanurls.

balupton avatar balupton commented on June 12, 2024

I think what @zenorocha was after is the ability to not create these files at all. @zenorocha can you pease elaborate?

from docpad-plugin-cleanurls.

thesec avatar thesec commented on June 12, 2024

Without knowing the use case that is a very flat answer, especially adding in such a wide field such as SEO ...

That said, the use case is that I am adding prefixes to the docs that are used to determine their navigation order but that I do not want to show up in URLs and am not linking to (for SEO reasons if you will ...).

from docpad-plugin-cleanurls.

RobLoach avatar RobLoach commented on June 12, 2024

On a layout basis, allow cleanurls: false?

from docpad-plugin-cleanurls.

balupton avatar balupton commented on June 12, 2024

This is now possible with v2.7.0. Set the following in your docpad configuration file:

environments:
    static:
        plugins:
            cleanurls:
                static: false

If you'd like to turn off clean urls completely (not just the redirect files) for the static env, use this:

environments:
    static:
        plugins:
            cleanurls:
                enabled: false

Happy to re-open if still an issue.

from docpad-plugin-cleanurls.

balupton avatar balupton commented on June 12, 2024

@RobLoach cleanurls: false meta-data is a great idea as well. Let's add that. I'll create an issue now.

from docpad-plugin-cleanurls.

StudioLE avatar StudioLE commented on June 12, 2024

@balupton
I'm currently using DocPad with cleanurls plugin to generate a static website with SEO friendly, semantic urls such as parent/child (achieved by the file: parent/child/index.html).

However I have no need for the parent/child.html redirect file that is created by cleanurls at: parent/child.html and I don't want to resort to manually deleting the file each time..

is there a config option:

plugins:
    cleanurls:
        redirectFile: false

Which will generate to parent/child/index.html but not create the parent/child.html file?

As I understand it that is what this issue is about however the proposed solution:

environments:
    static:
        plugins:
            cleanurls:
                static: false

Seems to remove the cleanurls functionality completely?

from docpad-plugin-cleanurls.

simbo avatar simbo commented on June 12, 2024

@balupton
I'm experiencing the same issues as @iSpyCreativity and probably also @zenorocha initially.

I want to use DocPad only to generate static files, not to act as a server and perform redirects. Therefore i'm using static: true or else cleanurls won't change anything.

I'm using datefromfilename, dateurls and cleanurls to generate blog posts from src/render/posts/2014-11-16-foo-bar.html.md to out/2014/03/foo-bar/index.html

This works great so far but docpad and/or cleanurls also write all those redirect files, which are never used/linked and imho not needed in this usecase.

out/posts/2014-11-16-foo-bar/index.html
out/posts/foo-bar/index.html
out/posts/foo-bar.html

I created a fork of cleanurls, introducing a new plugin option staticRedirectFile, which is true by default and only affects when static is also true. When set to false, all those redirection files will not be written or removed.

https://github.com/simbo/docpad-plugin-cleanurls/tree/no-redirection-files

from docpad-plugin-cleanurls.

balupton avatar balupton commented on June 12, 2024

I'm no longer interested in programming, someone else will need to take this.

from docpad-plugin-cleanurls.

simbo avatar simbo commented on June 12, 2024

Ok...
Maybe you can reopen the issue so others take notice. Thanks.

from docpad-plugin-cleanurls.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.