Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit b4b1c9a

Browse files
authored
Merge pull request #303 from wheels-dev/fix/sitemap-updates
Fix/sitemap updates
2 parents 7333830 + bbf25d4 commit b4b1c9a

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

app/controllers/web/ApiController.cfc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ component extends="app.Controllers.Controller" {
149149

150150
docs = getDocJSON(params.version);
151151
if (structIsEmpty(docs)) {
152-
renderWith(statusCode=404, text="Unknown version");
152+
renderWith(status = 404, text="Unknown version");
153153
return;
154154
}
155155

@@ -178,14 +178,14 @@ component extends="app.Controllers.Controller" {
178178

179179
docs = getDocJSON(params.version);
180180
if (structIsEmpty(docs)) {
181-
renderWith(statusCode=404, text="Unknown version");
181+
renderWith(status=404, text="Unknown version");
182182
return;
183183
}
184184

185185
func = getFunctionFromDocs(docs, params.slug);
186186

187187
if (structIsEmpty(func)) {
188-
renderWith(statusCode=404, text="Function not found");
188+
renderWith(status=404, text="Function not found");
189189
return;
190190
}
191191

@@ -203,7 +203,7 @@ component extends="app.Controllers.Controller" {
203203

204204
docs = getDocJSON(params.version);
205205
if (structIsEmpty(docs)) {
206-
renderWith(statusCode=404, text="Version not found");
206+
renderWith(status=404, text="Version not found");
207207
return;
208208
}
209209

@@ -239,7 +239,7 @@ component extends="app.Controllers.Controller" {
239239

240240
docs = getDocJSON(params.version);
241241
if (structIsEmpty(docs)) {
242-
renderWith(statusCode=404, text="Version not found");
242+
renderWith(status=404, text="Version not found");
243243
return;
244244
}
245245

app/controllers/web/HomeController.cfc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,34 @@ component extends="app.Controllers.Controller" {
314314
collectGuideUrls(summaryData);
315315
}
316316
}
317+
318+
// Add API functions from all versions dynamically
319+
var apiVersions = getAvailableVersions();
320+
for (var version in apiVersions) {
321+
var versionClean = replace(version, "v", "", "one");
322+
var docData = getDocJSON(version);
323+
if (!structIsEmpty(docData) && structKeyExists(docData, "functions")) {
324+
for (var func in docData.functions) {
325+
if (structKeyExists(func, "slug")) {
326+
// Get the function details using getFunctionFromDocs to verify it exists
327+
var verifiedFunc = getFunctionFromDocs(docData, func.slug);
328+
if (!structIsEmpty(verifiedFunc)) {
329+
// Add all format routes for this function
330+
var formats = ["html", "json", "xml", "pdf"];
331+
for (var fmt in formats) {
332+
arrayAppend(urls, {
333+
loc: getBaseUrl() & "/api/v" & versionClean & "/" & func.slug & "." & fmt,
334+
lastmod: dateFormat(now(), "yyyy-mm-dd"),
335+
changefreq: "weekly",
336+
priority: "0.6"
337+
});
338+
}
339+
}
340+
}
341+
}
342+
}
343+
}
344+
317345
// Add other public pages
318346
var publicPages = [
319347
"/blog",
@@ -411,7 +439,7 @@ component extends="app.Controllers.Controller" {
411439
}
412440

413441
function downloads() {
414-
redirectTo(url="https://github.com/wheels-dev/wheels/releases", statusCode=301);
442+
// serves download page
415443
}
416444

417445
private string function getBaseUrl() {

app/views/web/BlogController/show.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<cfif isBookmarked>
1616
<span class="text-success fw-bold">★ Bookmarked</span>
1717
<cfelse>
18-
<button hx-post="/bookmark/toggle" hx-vals='{"blogId": #blog.id#}' hx-target="this" hx-swap="outerHTML"
18+
<button hx-post="/bookmark/toggle" hx-vals='{"blogId": #blog.id#, "authenticityToken": "#authenticityToken()#"}' hx-target="this" hx-swap="outerHTML"
1919
class="btn btn-outline-primary">
2020
☆ Bookmark
2121
</button>

0 commit comments

Comments
 (0)