Skip to content

Commit

Permalink
Generate HTML sitemap from XML one
Browse files Browse the repository at this point in the history
  • Loading branch information
moisseev committed Apr 2, 2024
1 parent 0fbe7ec commit de9803c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sitemap1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: default
title: Site map
---

# Site map

{% capture sitemapData %}{% include '/sitemap.xml' %}{% endcapture %}
{% assign sitemapArray = sitemapData | split: '<loc>' %}

{::nomarkdown}<ul>
{% for i in sitemapArray offset:1 %}
{% assign locArray = i | split: '</loc>' %}
{% assign locUrl = locArray | first %}
{% assign locTitle = locUrl | split: '/' | last | replace: '-', ' ' | titlecase %}
<li><a href="{{locUrl}}">{{locTitle}}</a></li>
{% endfor %}
</ul>{:/}

0 comments on commit de9803c

Please sign in to comment.