Skip to content

Commit 8ea8f44

Browse files
Merge pull request #96 from TheDragonCode/1.x
Improved docs
2 parents 4ffab82 + 525dbe4 commit 8ea8f44

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

docs/topics/receipt-sitemap.topic

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,40 @@
66
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
77
title="Sitemap" id="receipt-sitemap" help-id="sitemap">
88

9-
<link-summary>Recipe for creating a sitemap</link-summary>
10-
<card-summary>Recipe for creating a sitemap</card-summary>
11-
<web-summary>Recipe for creating a sitemap</web-summary>
9+
<link-summary>How to create a product sitemap feed</link-summary>
10+
<card-summary>Step-by-step guide for creating a product sitemap</card-summary>
11+
<web-summary>Step-by-step guide to creating a product sitemap feed</web-summary>
1212

1313
<show-structure depth="3" />
1414

15+
<p>
16+
This recipe walks you through creating a product sitemap feed using Laravel Feeds. You will:
17+
- Generate the necessary classes
18+
- Implement the feed logic
19+
- Expose the files via the filesystem
20+
- Optionally reference the generated sitemap from a root sitemap.xml
21+
</p>
22+
1523
<chapter title="Create files" id="create_files">
24+
<p>
25+
Generate the feed and its item class using the following console command:
26+
</p>
1627
<code-block lang="bash">
1728
%command-make-simple% Sitemaps/Product -%command-shortcut-item%
1829
</code-block>
1930
</chapter>
2031

21-
<chapter title="Filling the feed" id="filling_the_feed">
32+
<chapter title="Fill the feed" id="filling_the_feed">
33+
<p>
34+
Implement the feed root element, attributes, query builder, output filename, and item mapping as shown below:
35+
</p>
2236
<code-block lang="php" src="receipt-sitemap-feed.php" />
2337
</chapter>
2438

25-
<chapter title="Filling the feed item" id="filling_the_feed_item">
39+
<chapter title="Fill the feed item" id="filling_the_feed_item">
40+
<p>
41+
Define the XML element name and map your model properties to the corresponding sitemap tags:
42+
</p>
2643
<code-block lang="php" src="receipt-sitemap-feed-item.php" />
2744
</chapter>
2845

@@ -32,14 +49,14 @@
3249

3350
<chapter title="Links" id="links">
3451
<p>
35-
Don't forget to add a link to the folder with site maps in the
36-
<a href="https://github.com/laravel/laravel/blob/12.x/config/filesystems.php#L76-L78">config/filesystems.php</a> configuration file:
52+
Add a filesystem disk that points to the directory containing your sitemaps in
53+
the <a href="https://github.com/laravel/laravel/blob/12.x/config/filesystems.php#L76-L78">config/filesystems.php</a> configuration file:
3754
</p>
3855

3956
<code-block lang="php" src="receipt-sitemap-links.php" include-lines="5-" />
4057

4158
<p>
42-
After that, run the console command:
59+
Then create the public symlink so the files are accessible in the browser:
4360
</p>
4461

4562
<code-block lang="bash">
@@ -51,11 +68,17 @@
5168
<include from="snippet-generate.topic" element-id="feed_generate" />
5269
</chapter>
5370

54-
<chapter title="Adding a link to the general sitemap.xml file" id="adding_a_link_to_the_general_sitemap_xml_file">
71+
<chapter title="Add a link to the root sitemap.xml" id="adding_a_link_to_the_general_sitemap_xml_file">
72+
<p>
73+
If you maintain a root sitemap.xml file that references other sitemaps, add an entry like this:
74+
</p>
5575
<code-block lang="xml" src="receipt-sitemap-root.xml" />
5676
</chapter>
5777

5878
<chapter title="Result" id="result">
79+
<p>
80+
A generated sitemap.xml for your products will look like this:
81+
</p>
5982
<code-block lang="xml" src="receipt-sitemap-feed.xml" />
6083
</chapter>
6184

docs/topics/snippet-generate.topic

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<snippet id="feed_generate">
1111
<p>
12-
Now you can generate a feed using a console command:
12+
Generate the feed by running the following console command:
1313
</p>
1414

1515
<code-block lang="bash">
@@ -19,8 +19,7 @@
1919

2020
<snippet id="check_operation">
2121
<p>
22-
Check the <a href="create-feeds.topic">operation/migration</a>
23-
file that was created for you and run the console command:
22+
Review the generated <a href="create-feeds.topic">operation or migration</a> file, then run the appropriate console command:
2423
</p>
2524

2625
<code-block lang="bash">

0 commit comments

Comments
 (0)