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

Set Default values, use link instead of permaLink #28

Merged
merged 19 commits into from
Mar 14, 2017
Merged

Set Default values, use link instead of permaLink #28

merged 19 commits into from
Mar 14, 2017

Conversation

mhauri
Copy link
Contributor

@mhauri mhauri commented Jan 26, 2017

  • Set default values for "changefreq" and "priority" and use them.
  • Use $page->link(true) instead of $page->permaLink()

@flaviocopes
Copy link
Contributor

What's the reason behind Use $page->link(true) instead of $page->permaLink() ?

@mhauri
Copy link
Contributor Author

mhauri commented Jan 30, 2017

Didn't tested it trough, but noticed a Problem in my Blog.

As Example in my Blog I have a folder 01.blog in which i have my blog posts.
When navigated over the blog they are shown as example.com/this-is-my-blog-post
But in the Sitemap the link is shown as example.com/blog/this-is-my-blog-post

Also the Homepage itself contains the /blog folder in the sitemap.
So example.com is shown as example.com/blog in the sitemap.

@Chouchen
Copy link
Contributor

$page->canonical() could be a solution, right ?

@lulis
Copy link

lulis commented Mar 14, 2017

This patch is really needed to make the grav sitemap plug-in functional. Thanks @mhauri !

I've patched my local install manually.
This patch will be merged anytime soon?
Sorry about this dumb question, but the timeline above really make me confuse:
image

Thanks a lot (and sorry for any inconvenience here), guys!

@rhukster
Copy link
Member

I also think it should be canonical as it supports languages.

@rhukster rhukster merged commit 8c6479e into getgrav:develop Mar 14, 2017
@rhukster
Copy link
Member

FYI: link code is simply:

public function link($include_host = false)
    {
        return $this->url($include_host);
    }

Canonical code is:

    public function canonical($include_lang = true)
    {
        return $this->url(true, true, $include_lang);
    }

so $page->link(true) is actually the same as $page->canonical(false) but actually having $include_lang true is going to give better results for multi-lang setups.

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.

None yet

6 participants