[ 
https://issues.apache.org/jira/browse/CAMEL-15296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17160511#comment-17160511
 ] 

Aemie commented on CAMEL-15296:
-------------------------------

[~aashnajena], [~zregvart] we could use that or as stated in one call we can 
make use of the sitemap present within the documentation folder. We could make 
use of gulp to automate the task and use regex as well. I will just run through 
the regex as I tried working with a piece of string and with regex, it works 
out.

Let's say we have a string 
*s='<url><loc>hey-camel.html</loc></url><url><loc>hey-spring.html</loc></url>'* 
and *matchesOfLoc=/<loc>(.*?)<\/loc>/g.* When we run 
*listOfLoc=s.match(matchesOfLoc),* you get a list of all the loc tag.

With this list, we can run a loop and extract the filename for each. Here, we 
have our list as *["<loc>hey-camel.html</loc>", "<loc>hey-spring.html</loc>"]*. 
I will walk you through to extract the name for a particular element of the 
list. 

*fileName = matchesOfLoc.exec(listOfLoc[1])*

*title = fileName[1].replace(/^.*[\\\/]/, '')*

*name = title.replace('.html', '')*

Here, your output would be *hey-spring.* With this manner, we could extract the 
names of each file through the sitemap itself. 

> Create sitemap for Camel website
> --------------------------------
>
>                 Key: CAMEL-15296
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15296
>             Project: Camel
>          Issue Type: New Feature
>          Components: website
>            Reporter: Aashna Jena
>            Priority: Minor
>              Labels: outreachy2020
>
> Create a page with links to all documentation pages on the website. Automate 
> this process and organise the links category wise.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to