SitemapGenerator | Provides a way to create/generate a sitemap using Propel | Sitemap library
kandi X-RAY | SitemapGenerator Summary
kandi X-RAY | SitemapGenerator Summary
Provides a way to create/generate a sitemap using Propel, Doctrine, etc.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Format video .
- Generates an iterator for all routes .
- Splits an iterable into chunks .
- Get result location .
- Builds the sitemap .
- Set the platforms .
- Create default values
- Opens the file .
- Set change frequency
- Get the title .
SitemapGenerator Key Features
SitemapGenerator Examples and Code Snippets
Community Discussions
Trending Discussions on SitemapGenerator
QUESTION
I am running two Angular2+ projects and a Laravel API on my server together. The first angular project is a public website for users (SSR enabled), the second angular project is Admin Panel (SSR not enabled), these two projects run on Laravel API. I have a strange problem with sitemap creation.
I am using this library for sitemap creation and also Laravel API is running on Apache Server.
The problem is The sitemap creation process is taking too much time (Apr. 70 seconds) This problem occurred after enabling server-side rendering on my angular project. If I disable SSR, the problem not occurs. While the angular SSR project is running based on Node.js, the sitemap creation process increases Node.js resource usage (CPU up to 85%) and therefore this process takes 1 minute to complete. This is strange because Laravel is running on the Apache server and the admin can create a sitemap, because SSR is not enabled for the admin panel, it shouldn't be related to the Node.js server.
Here is my SSR enabled angular project (when idle):
This ss taken when executing following code:
$sitemap = SitemapGenerator::create($website->url)->getSitemap();
As you can see Node process is consuming all CPU resources.
How did I understand sitemap generation is getting slow the performance?
Sitemap generation code here:
...ANSWER
Answered 2021-May-07 at 07:17From what I understand, that lib works by dynamically crawling the website. I don't know how many pages you've got, but it could take a while since the crawler will cause angular universal to render all the pages to retrieve the links.
If you disable SSR, I doubt that the sitemap will work as expected, since the crawler will not be able to retrieve page content (as without SSR, the rendered page only contains js/css links).
A solution could be to generate the sitemap yourself: add static links first, then use your api generate the lsit of dynamic pages (product/xxx
, product/yyy
)
QUESTION
I have created sitemap using this library https://github.com/spatie/laravel-sitemap but i don't want changefreq info.how to disable.can't find in repository
...ANSWER
Answered 2021-Apr-17 at 12:10Publish resource views
Then edit file: https://github1s.com/spatie/laravel-sitemap/blob/HEAD/resources/views/url.blade.php
QUESTION
I'm scanning the site's sitemap using apollo server. but when I send the request from playground, it gives results without waiting for the function to finish. How can I hold the scan for a result? And how can I show the scanned url array of the site instantly on the client side?
If I use graphql subscription, I need to save the data one by one. this would be a lot of data.
Note: the system is working and data is being saved in mongoose.
...ANSWER
Answered 2020-Nov-27 at 08:17In this case, your scanSitemap
resolver needs to return a Promise
that resolves only when the 'done'
event is emitted from SitemapGenerator
Why? Well, according to the ApolloServer Docs:
Resolvers often perform asynchronous actions, such as fetching from a database or back-end API. To support this, a resolver can return a promise that resolves to any other supported return type. (https://www.apollographql.com/docs/apollo-server/data/resolvers/#return-values)
In this case, your resolver is definitely performing an asynchronous operation -- sitemap scraping -- so this is a good situation to use Promises.
By returning a Promise
, you are instructing Apollo Server to wait for the results of your asynchronous operation to be available. According to your code, I believe you want to resolve this at the end of the day:
QUESTION
I am using spatie to generate sitemap.xml. It is working properly as it is expected. But as per some requirement I would like to not include any image url in sitemap.xml.
This is my code -
...ANSWER
Answered 2020-Jun-22 at 23:50Please follow this part of document - spatie. This is not specifically omit images but if there is any specific format in your url for images link - http://www.example.com/uploads
then try to get segment(1)
and compare so this part of documentation will work.
In your case as an example -
QUESTION
I am using sitemap_generator gem with rails 6 on heroku. I am told the easiest way is to use an s3 on amazon and bridge with aws_fog.
The implementation is well documented on the gem side... but I am struggling to make sure the amazon config is correct.
I search a lot and couldn't find anything so I was hoping someone could help
I configure an s3 instance lets name it example and I add it to region US East(Ohio). This is all pretty simple.
The Properties tab... what should and shouldn't be selected? i select nothing.
The Permissions tab. I make public, although this feels wrong... the bucket is for a sitemap, so it should be public right?
I set up my region as per the doumentation
...ANSWER
Answered 2020-Jun-10 at 06:43I am also using sitemap-generator gem on my rails application (heroku hosted and rails 6). I have the following code inside config/sitemap.rb
, before SitemapGenerator::Sitemap.create
. I have configured it with aws-sdk-s3
gem and it goes like this:
QUESTION
I have this GenerateSitemap.php file where I can configure the crawler, but I don't understand how I should make the crawler skip some specific URLs for example (https://example.com/noindex-url). I have read this but I can't get my head around it. https://github.com/spatie/laravel-sitemap
...ANSWER
Answered 2020-May-06 at 13:48if ((string)$url->path() === '/noindex-url') {
return;
}
QUESTION
I am using a tutorial that creates a sitemap XML. However i am changing things so it uses a database instead of current code. I have placed a Foreach statement in the controller to retrieve the information as a list and that code seems to be okay. The rest of the code in the action doesn't seem to like it. I am sure it is something that is looking me right in the face but i am not seeing it. Could someone direct me as to what might be the issue or if i am missing something in my code.
Here is the controller Action: (I have left the original code in it, but is commented out)
...ANSWER
Answered 2019-Nov-20 at 20:03You can't place a foreach
inside an object initializer like that, but you can use Linq
to return an IEnumerable
of sitemaps like:
QUESTION
I'm using spatie/sitemap
this is what i do to inform me that sitemap is created
...ANSWER
Answered 2019-May-24 at 10:39So it works when you're not using localhost:8000 or 127.0.0.1:8000. you should change your web address using laravel valet for MAC or change your hosts for Windows
QUESTION
I want to generate sitemap.xml
via PHP with DOMDocument
Now I have three array:
...ANSWER
Answered 2019-May-22 at 12:22If you modify the generateXML
method and move the pieces of code that create the urlset to a new method you can then call generateXML
many times without generating the urlset
repeatedly. Below the __construct
, generateXML
were modified and a new method addurlset
added...
QUESTION
I need to generate a sitemap.
I am using spatie/laravel-sitemap. I have installed and published it but when I run the generator Symphony throws a fatal error: Maximum execution time of 60 seconds exceeded
.
I have a huge list of links and left just one to test, but still getting the same error.
How to fix that? Here is my web.php
code:
ANSWER
Answered 2019-Jan-08 at 14:46This is a common problem when working with long running scripts.
Did you try using php function set_time_limit ?
Try putting in the beginning of your script
set_time_limit(300);
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SitemapGenerator
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page