You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by "jamesfredley (via GitHub)" <gi...@apache.org> on 2026/05/01 21:36:29 UTC

[PR] Fix /guides/index.html partial expansion + drop legacy main.css from guide layout (refs #354) [grails-static-website]

jamesfredley opened a new pull request, #469:
URL: https://github.com/apache/grails-static-website/pull/469

   ## Summary
   
   Three small fixes spotted during a visual review of the live site:
   
   1. **`https://grails.apache.org/guides/index.html` was broken** - the rendered HTML still contained literal `[%PARTIAL:site-head]` etc. tokens because `GuidesTask` calls `RenderSiteTask.renderPages` without passing the partials directory. `GuidesTask` now passes `templates/partials` so the same chrome partials that `RenderSiteTask` uses get expanded for guides/index.html, the tag pages, and the category pages.
   
   2. **Per-guide pages had different fonts than the main site** because the legacy `\/css/main.css` was loaded after the main-site stylesheets and overrode body-level rules. Dropped that link. The companion `guide.css` stays for article-body affordances (TOC, GitHub aside, code blocks).
   
   3. **Live verification** sample at `https://grails.apache.org/guides/grails-tvmlapp/3/guide/index.html` will pick up both fixes on the next publish run.
   
   ## Local verification
   
   `
   $ ./gradlew clean build buildGuides --rerun-tasks --no-daemon --no-configuration-cache
   BUILD SUCCESSFUL
   
   $ # build/dist/guides/index.html
   main-header: 1, apache-grails: 1, social-media-nav: 1
   PARTIAL:site-head: 0  (token expanded)
   
   $ # build/dist/guides/grails-database-migration/6/guide/index.html
   main-header: 1, screen.css: 1, plugin.css: 1, guide.css: 1
   main.css: 0  (legacy CSS no longer loaded)
   `
   
   Refs #354.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix /guides/index.html partial expansion + drop legacy main.css from guide layout (refs #354) [grails-static-website]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #469:
URL: https://github.com/apache/grails-static-website/pull/469#discussion_r3175322003


##########
buildSrc/src/main/groovy/website/gradle/tasks/GuidesTask.groovy:
##########
@@ -128,18 +128,26 @@ abstract class GuidesTask extends GrailsWebsiteTask {
         def f = new File(tempDir, PAGE_NAME_GUIDES)
         def page = pageWithFile(f)
         page.filename = 'index.html'
-        RenderSiteTask.renderPages(meta, [page], distDir, templateText)
+        // Resolve [%PARTIAL:<name>] tokens against the same partial bundle
+        // RenderSiteTask uses, so guides/index.html, tag, and category pages
+        // share the main-site chrome.
+        File partialsRoot = project.rootProject.layout.projectDirectory
+                .dir('templates/partials').asFile
+        File partialsArg = partialsRoot.isDirectory() ? partialsRoot : null
+        RenderSiteTask.renderPages(meta, [page], distDir, templateText, partialsArg)

Review Comment:
   GuidesTask is marked @CacheableTask, and renderGuides() now makes the output depend on templates/partials, but that directory is not declared as an `@InputDirectory` (unlike RenderSiteTask.getPartialsDir). This can leave guides/index.html / tags / categories stale (task up-to-date / build cache hit) after partials change. Consider adding an optional DirectoryProperty partialsDir (defaulting to rootProject templates/partials) and using it here so Gradle tracks changes correctly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix /guides/index.html partial expansion + drop legacy main.css from guide layout (refs #354) [grails-static-website]

Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley merged PR #469:
URL: https://github.com/apache/grails-static-website/pull/469


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@grails.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org