Skip to content

Commit d72906a

Browse files
committed
Added Sitemap.xsl; xml style
Just cause, is purdier
1 parent f9d2382 commit d72906a

File tree

4 files changed

+607
-1
lines changed

4 files changed

+607
-1
lines changed

docs/sitemap.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>
23
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
34
<url>
45
<loc>https://procstack.github.io/Init.htm</loc>

docs/sitemap.xsl

Lines changed: 297 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,297 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<xsl:stylesheet version="1.0"
3+
xmlns:html="http://www.w3.org/TR/REC-html40"
4+
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
5+
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
6+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7+
8+
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.01//EN" doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
9+
<xsl:template match="/">
10+
<html>
11+
<head>
12+
<title>ProcStack's Sitemap</title>
13+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
14+
<style type="text/css">
15+
body {
16+
font-family: Roboto, sans-serif;
17+
font-size: 14px;
18+
background-color: #353535;
19+
margin: 0;
20+
padding: 20px;
21+
}
22+
23+
.container {
24+
max-width: 1200px;
25+
margin: 0 auto;
26+
overflow: hidden;
27+
}
28+
29+
.header {
30+
background: linear-gradient(135deg, #4e5164 0%, #494668 100%);
31+
color: white;
32+
padding: 40px 30px;
33+
text-align: center;
34+
}
35+
36+
.header h1 {
37+
margin: 0;
38+
font-size: 32px;
39+
font-weight: 300;
40+
}
41+
42+
.header p {
43+
margin: 10px 0 0 0;
44+
opacity: 0.9;
45+
font-size: 16px;
46+
}
47+
48+
.stats {
49+
background: #3d3c46;
50+
padding: 20px 30px;
51+
border-bottom: 1px solid #55507b;
52+
display: flex;
53+
justify-content: space-between;
54+
align-items: center;
55+
flex-wrap: wrap;
56+
}
57+
58+
.stat-item {
59+
text-align: center;
60+
margin: 10px 0;
61+
}
62+
63+
.stat-number {
64+
display: block;
65+
font-size: 24px;
66+
font-weight: 600;
67+
color: #afafaf;
68+
}
69+
70+
.stat-label {
71+
font-size: 12px;
72+
color:rgb(123, 137, 150);
73+
text-transform: uppercase;
74+
letter-spacing: 0.5px;
75+
}
76+
77+
.content {
78+
padding: 0;
79+
}
80+
81+
table {
82+
width: 100%;
83+
border-collapse: collapse;
84+
margin: 0;
85+
background-color: #4a4a4a;
86+
}
87+
88+
th {
89+
background: #5b5d60;
90+
color: white;
91+
padding: 15px;
92+
text-align: left;
93+
font-weight: 500;
94+
font-size: 13px;
95+
text-transform: uppercase;
96+
letter-spacing: 0.5px;
97+
text-align: center;
98+
}
99+
100+
101+
td {
102+
padding: 8px;
103+
border-bottom: 1px solid #8a8a8a;
104+
vertical-align: top;
105+
text-align: center;
106+
}
107+
108+
.td-url{
109+
text-align: left;
110+
.padded{ margin-left: 4%; }
111+
}
112+
113+
.url-link {
114+
color: #9dccff;
115+
text-decoration: none;
116+
font-weight: 500;
117+
word-break: break-all;
118+
}
119+
120+
.url-link:hover {
121+
text-decoration: underline;
122+
color: #5baaff;
123+
}
124+
125+
.date {
126+
color:rgb(147, 160, 171);
127+
font-size: 13px;
128+
}
129+
130+
.frequency {
131+
background: #e9ecef;
132+
padding: 4px 8px;
133+
border-radius: 12px;
134+
font-size: 11px;
135+
text-transform: uppercase;
136+
color: #495057;
137+
display: inline-block;
138+
}
139+
140+
.frequency.daily { background:rgb(92, 97, 93); color:rgb(57, 214, 93); }
141+
.frequency.weekly { background:rgb(99, 104, 110); color:rgb(23, 123, 229); }
142+
.frequency.monthly { background:rgb(86, 84, 78); color:rgb(229, 180, 32); }
143+
.frequency.yearly { background:rgb(81, 75, 75); color:rgb(224, 113, 124); }
144+
145+
.image-yes-indicator {
146+
color: #28a745;
147+
font-size: 12px;
148+
font-weight: 600;
149+
}
150+
.image-no-indicator {
151+
color:rgb(243, 120, 95);
152+
font-size: 12px;
153+
font-weight: 500;
154+
}
155+
156+
.footer {
157+
padding: 30px;
158+
text-align: center;
159+
color: #afafaf;
160+
font-size: 13px;
161+
background: #3d3c46;
162+
border-top: 1px solid #55507b;
163+
}
164+
165+
.file-count {
166+
font-weight: 600;
167+
color: #343a40;
168+
font-weight:700;
169+
background:rgb(168, 172, 177);
170+
border-radius: 4px;
171+
padding: 3px 4px;
172+
}
173+
174+
.table-before {
175+
content: '';
176+
border-radius: 15px 15px 0px 0px;
177+
background: transparent;
178+
border-width: 0px 2px 2px 2px;
179+
border-color: #5d5d5d;
180+
border-style: solid;
181+
height: 12px;
182+
margin-bottom: 5px;
183+
}
184+
.table-content{
185+
border: 1px solid #5d5d5d;
186+
}
187+
.table-after {
188+
content: '';
189+
border-radius: 0px 0px 15px 15px;
190+
background: transparent;
191+
border-width: 2px 2px 0px 2px;
192+
border-color: #5d5d5d;
193+
border-style: solid;
194+
height: 12px;
195+
margin-top: 5px;
196+
}
197+
198+
@media (max-width: 768px) {
199+
body { padding: 10px; }
200+
.header { padding: 30px 20px; }
201+
.header h1 { font-size: 24px; }
202+
.stats { padding: 15px 20px; }
203+
th, td { padding: 10px; }
204+
.container { border-radius: 0; }
205+
}
206+
</style>
207+
</head>
208+
<body>
209+
<div class="container">
210+
<div class="table-before"></div>
211+
<div class="table-content">
212+
<div class="header">
213+
<h1>ProcStack's Sitemap</h1>
214+
<p>XML Sitemap for <a href="https://procstack.github.io/" class="url-link">procstack.github.io</a></p>
215+
</div>
216+
217+
<div class="stats">
218+
<div class="stat-item">
219+
<span class="stat-number">
220+
<xsl:value-of select="count(//sitemap:url)"/>
221+
</span>
222+
<span class="stat-label">Total URLs</span>
223+
</div>
224+
<div class="stat-item">
225+
<span class="stat-number">
226+
<xsl:value-of select="count(//sitemap:url[image:image])"/>
227+
</span>
228+
<span class="stat-label">With Images</span>
229+
</div>
230+
<div class="stat-item">
231+
<span class="stat-number">
232+
2025-06-19
233+
</span>
234+
<span class="stat-label">Generated</span>
235+
</div>
236+
</div>
237+
238+
<div class="content">
239+
<table>
240+
<thead>
241+
<tr>
242+
<th style="width: 50%;">URL</th>
243+
<th style="width: 15%;">Last Modified</th>
244+
<th style="width: 15%;">Change Frequency</th>
245+
<th style="width: 10%;">Priority</th>
246+
<th style="width: 10%;">Images</th>
247+
</tr>
248+
</thead> <tbody>
249+
<xsl:for-each select="//sitemap:url">
250+
<tr>
251+
<td class="td-url">
252+
<a href="{sitemap:loc}" class="url-link padded" target="_blank">
253+
<xsl:value-of select="sitemap:loc"/>
254+
</a>
255+
</td>
256+
<td class="date">
257+
<xsl:value-of select="sitemap:lastmod"/>
258+
</td>
259+
<td>
260+
<span class="frequency {sitemap:changefreq}">
261+
<xsl:value-of select="sitemap:changefreq"/>
262+
</span>
263+
</td>
264+
<td>
265+
<xsl:choose>
266+
<xsl:when test="sitemap:priority">
267+
<xsl:value-of select="sitemap:priority"/>
268+
</xsl:when>
269+
<xsl:otherwise>-</xsl:otherwise>
270+
</xsl:choose>
271+
</td>
272+
<td>
273+
<xsl:choose>
274+
<xsl:when test="image:image">
275+
<span class="image-yes-indicator">Yes</span>
276+
</xsl:when>
277+
<xsl:otherwise>
278+
<span class="image-no-indicator">No</span>
279+
</xsl:otherwise>
280+
</xsl:choose>
281+
</td>
282+
</tr>
283+
</xsl:for-each>
284+
</tbody>
285+
</table>
286+
</div>
287+
<div class="footer">
288+
<p>Listing <span class='file-count'><xsl:value-of select="count(//sitemap:url)"/></span> URLs for <a href="https://procstack.github.io/" class="url-link">procstack.github.io</a></p>
289+
<p>For more info - <a href="https://www.sitemaps.org/" target="_blank" class="url-link">sitemaps.org</a></p>
290+
</div>
291+
</div>
292+
<div class="table-after"></div>
293+
</div>
294+
</body>
295+
</html>
296+
</xsl:template>
297+
</xsl:stylesheet>

packing/renderStaticPages.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,21 @@ const thumbnailUrl = siteRootUrl + "/images/ProcStack_th.jpg";
6262

6363
const renderDir = directToDocs ? outputRoot : snapshotDir;
6464
const sitemapPath = path.join( renderDir, 'sitemap.xml' );
65+
const sitemapPathXSL = path.join( renderDir, 'sitemap.xsl' );
66+
const sitemapXslSource = path.join( __dirname, 'sitemap.xsl' );
6567

6668
fs.mkdirSync( renderDir, { recursive: true });
6769
fs.mkdirSync( botsDir, { recursive: true });
6870

71+
// Copy the sitemap XSL file if it exists
72+
if( fs.existsSync(sitemapXslSource) ){
73+
fs.copyFileSync(sitemapXslSource, sitemapPathXSL);
74+
console.log(`Sitemap XSL copied to: ${sitemapPathXSL}`);
75+
}else{
76+
console.warn(`!! Sitemap XSL file not found at: ${sitemapXslSource}`);
77+
}
78+
79+
6980
// Check for meta data spec file and move it to the bots directory if it's not already there
7081
const aiMetaSpecFile = path.join( projectRoot, 'ai-metadata-spec.html' );
7182
if( fs.existsSync(aiMetaSpecFile) ){
@@ -140,7 +151,7 @@ const htmlToMarkdown = (html, title = '') => {
140151

141152

142153
const generateSitemap = (urls) => {
143-
const header = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n`;
154+
const header = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n`;
144155
const footer = `\n</urlset>`;
145156
let imageTag = '';
146157
if( thumbnailUrl !== '' ){

0 commit comments

Comments
 (0)