astro-paper icon indicating copy to clipboard operation
astro-paper copied to clipboard

Environment Variables & Sitemap

Open ferrarafer opened this issue 11 months ago • 3 comments

Hi @satnaing, how is it going? I'm really enjoying using your template, thanks for the hard work. I have the following questions:

  1. Why are you using .env file to pass the Google Tag and the Google Site Verification instead of using src/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.

  1. Why sitemap is divided into two files sitemap-0.xml and sitemap-index.xml ?

    Is just for curiosity, I'm not expert here 😅 .

Thanks in advance, Cheers!

ferrarafer avatar Jul 14 '23 12:07 ferrarafer

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

MrGKanev avatar Jul 14 '23 12:07 MrGKanev

Hi @satnaing, what about question 1?

ferrarafer avatar Aug 08 '23 04:08 ferrarafer

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.

satnaing avatar Sep 16 '23 03:09 satnaing