astro-paper
astro-paper copied to clipboard
Environment Variables & Sitemap
Hi @satnaing, how is it going? I'm really enjoying using your template, thanks for the hard work. I have the following questions:
-
Why are you using
.env
file to pass the Google Tag and the Google Site Verification instead of usingsrc/config.ts
?I ask this because seems to be done like that for security reasons but, actually, there is no benefit because both ids are exposed on the HTML code, looking into them is just as simple as mouse right click and select see source code.
Maybe I'm missing something here.
-
Why sitemap is divided into two files
sitemap-0.xml
andsitemap-index.xml
?Is just for curiosity, I'm not expert here 😅 .
Thanks in advance, Cheers!
I haven't checked the logic (if any behind it) but typically the sitemap is broken into files like that for optimization's sake. Naturally, Google has X minutes to crawl each website (depending on the website), which can help you to be crawled easier or at all. - if your website is slow there is a possibility it can't be crawled
Hi @satnaing, what about question 1?
Hello, Sorry for my late response.
I placed the Google Site Verification code inside the .env file to allow users to easily add their site verification without the need to modify the code, commit, and push it again. Unlike other configurations, such as SITE.title
, which can be determined during the development and configuration steps, Google Site Verification is typically added as part of post-deployment configuration adjustments (after deploying and configuring the domain, etc.). While this may not always be the case, it's the approach I take when deploying a website.
This is the main reason for doing so. If you have any further better ideas, we can discuss them openly for sure.