Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

How to exclude the build folder from the URL? #14

Open
janwerkhoven opened this issue Jan 27, 2016 · 1 comment
Open

How to exclude the build folder from the URL? #14

janwerkhoven opened this issue Jan 27, 2016 · 1 comment

Comments

@janwerkhoven
Copy link

Much love this little package. Found a bug I cannot seem to resolve...

All my source files are in /src and all my build files are in /dist. Running grunt xml_sitemap successfully creates the /dist/sitemap.xml as intended. The only problem is that all the URLs contain the /dist folder like below:

    <url>
      <loc>http://www.example.com/dist/</loc>
      <lastmod>2016-01-28T00:31:56.000Z</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
    </url>
    <url>
      <loc>http://www.example.com/dist/contact</loc>
      <lastmod>2016-01-28T00:31:56.000Z</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
    </url>
    <url>
      <loc>http://www.example.com/dist/products</loc>
      <lastmod>2016-01-28T00:31:56.000Z</lastmod>
      <changefreq>weekly</changefreq>
      <priority>0.8</priority>
    </url>

I used the following settings:

    xml_sitemap: {
      custom_options: {
        options: {
          siteRoot: 'http://www.praktijkcentrumlochristi.be/',
          changefreq: 'weekly',
          priority: '0.8',
          dest: 'dist/'
        },
        files: [{
          expand: true,
          cwd: 'dist/',
          src: ['**/*.html', '!**/google2dbd407974c11f6a.html'],
          dest: 'dist/sitemap.xml'
        }]
      }
    },

How do I exclude /dist from the URLs??

Thanks

@Tantawi
Copy link

Tantawi commented Jul 6, 2016

I don't know if you solved it already by now :) I faced the same problem and fixed it simply by changing:

expand: true
to
expand: false

Good luck.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants