GG谷歌福建seo推广专员.shopbase - 服务最有耐心的产品

最近网站建设经验分享 Recent Website Building Experience Sharing 最近上线了一个新网站,与之前的博客建站过程有所不同,因此想记录下这次的经验。 Recently launc

超牛的SEO推广快速排名技巧 - 成都谷歌竞价推广公司分享建站经验

最近网站建设经验分享

Recent Website Building Experience Sharing

最近上线了一个新网站,与之前的博客建站过程有所不同,因此想记录下这次的经验。

Recently launched a new website, which is different from my previous blog building process, so I want to document this experience.

网站功能设计

Website Function Design

由于最近上线了一个APP,需要一个网站来做产品说明,同时还有一些其他待上线的项目,因此网站的核心功能定为:

Since we recently launched an APP, we needed a website for product description, plus some other upcoming projects, so the core functions of the website are:

由此形成了网站最初的目录结构:

This formed the initial directory structure of the website:

技术选型

Technology Selection

以简单为第一原则,现阶段只需要静态页面。因此选择:

Simplicity is the top principle, currently only static pages are needed. Therefore, we chose:

Cloudflare Pages不仅免费托管,还免流量费用,还能免费享受到全球网络优化服务。

Cloudflare Pages not only provides free hosting, but also free traffic and global network optimization services.

SEO优化关键点

SEO Optimization Key Points

1. 自动生成sitemap

1. Automatically generate sitemap

网站地图是搜索引擎索引你网站的向导,我们可以通过脚本自动生成:

Sitemap is the guide for search engines to index your website, we can generate it automatically through scripts:

 // scripts/generate-sitemap.js // 查找build目录下的所有HTML文件 // Find all HTML files in the build directory glob(`${buildDir}/**/*.html`, (err, files) => { // 生成sitemap的XML内容 // Generate sitemap XML content const urls = files.map(file => { return ` https://your.site${url}`; }); }); 

2. 搜索引擎提交

2. Search Engine Submission

上线后第一件事是向各搜索引擎提交网站,以Google为例:

The first thing after launch is to submit the website to search engines, take Google as an example:

注意:百度对Cloudflare上的网站收录不友好,如果依赖百度收录需要其他方案。

Note: Baidu is not friendly to websites on Cloudflare, if you rely on Baidu indexing, you need other solutions.

访问统计设置

Access Statistics Setup

添加Google Analytics的svelte组件代码:

Add Google Analytics svelte component code:

 <script lang="ts"> import { onMount } from "svelte"; const analyticsId = import.meta.env.VITE_ANALYTICS_ID; if (analyticsId) { onMount(async () => { window.dataLayer = window.dataLayer || []; window.dataLayer.push('js', new Date()); window.dataLayer.push('config', analyticsId); }); } </script> 

可以使用环境变量控制,只在生产环境启用统计代码。

You can use environment variables to control, only enabling statistics code in production environment.

设计资源推荐

Design Resources Recommendation

对于非设计人员,推荐以下工具:

For non-designers, the following tools are recommended:

成都谷歌竞价推广公司提示:网站logo和favicon非常重要,最好在网站推广前设计好。

Chengdu Google Ads Agency Tip: Website logo and favicon are very important, it's best to design them before website promotion.

超牛的SEO推广快速排名技巧 - 成都谷歌竞价推广公司分享建站经验