超牛的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:
- 产品目录/Product Catalog
- 产品介绍/Product Introduction
- 产品文档/Product Documentation
由此形成了网站最初的目录结构:
This formed the initial directory structure of the website:
- 网站首页/Homepage
- 产品首页/Product Homepage
- 产品详情页/Product Details Page
- 文档首页/Documentation Homepage
- 文档详情页/Documentation Details Page
- 隐私政策页/Privacy Policy Page (APP上线必备/Required for APP launch)
技术选型
Technology Selection
以简单为第一原则,现阶段只需要静态页面。因此选择:
Simplicity is the top principle, currently only static pages are needed. Therefore, we chose:
- Cloudflare Pages作为托管服务/Cloudflare Pages as hosting service
- svelte作为开发框架/svelte as development framework
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:
- 访问Google Search Console/Access Google Search Console
- 提交sitemap/Submit sitemap
- 等待收录/Wait for indexing
注意:百度对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:
- IconPark SVG图标库/IconPark SVG Icon Library
- SVG查看器/SVG Viewer
- SVG路径编辑器/SVG Path Editor
- Flowbite组件库/Flowbite Component Library
成都谷歌竞价推广公司提示:网站logo和favicon非常重要,最好在网站推广前设计好。
Chengdu Google Ads Agency Tip: Website logo and favicon are very important, it's best to design them before website promotion.
