WebFundamentals

现代Web开发的最佳实践。(Best practices for modern web development.)

Github stars Tracking Chart

DevSite上的Web基础知识

欢迎使用新网站基础知识!努力展示现代Web开发的最佳实践和工具。

发生了什么变化?

  • 我们现在使用 DevSite 基础设施
  • Jekyll已被淘汰。而是在请求时呈现页面
  • 正面问题已从markdown中删除,但文件现在需要简单的标签集

保持不变?

克隆储存库

如果您有高带宽连接,我建议从一个新的克隆开始 的储存库。

git clone https://github.com/google/WebFundamentals.git

设置

新的DevSite基础架构大大简化了依赖关系。确保您已安装 Node 10或更高版本,并且已安装 适用于Python的AppEngine SDK

  1. 运行 npm install (构建过程需要)

建立自动生成的档案

一些文件(所包括的贡献者,一些页面的更新,展示等)是自动生成的。第一次克隆repo并运行 npm install 时, 这就完成了。但是,当你添加研究案例、更新等时,你需要使用以下方式重新构建这些文件:

npm run build

启动本地服务器

要在本地查看网站,只需运行:

npm start

注意:首次启动服务器时,可能需要运行start-appengine.sh并回答dev_appserver.py提供的任何提示。

更新代码实验室

要更新代码实验室,您需要 claat 工具和 访问原始文档文件。这可能只适用于Google员工。

  1. 下载 claat 工具,并将其放置在 tools 目录中。
  2. 运行 tools/update-codelabs.sh
  3. 检查GitHub最新变更

启动开发服务器

  1. 运行 npm start

在提交PR之前测试您的更改

请在提交PR前通过npm测试运行您的更改。考试 寻找可能导致DevSite问题的事情,并试图保持我们的 内容一致。这是部署过程的一部分,所以PR将失败 如果有任何错误!运行:

npm test

Overview

Name With Ownergoogle/WebFundamentals
Primary LanguageJavaScript
Program languagePython (Language Count: 7)
PlatformLinux, Mac, Windows
License:Apache License 2.0
Release Count6
Last Release Name20161111-1952 (Posted on )
First Release Name0.2 (Posted on )
Created At2014-04-28 18:45:45
Pushed At2022-08-10 14:38:07
Last Commit At
Stargazers Count13.8k
Watchers Count657
Fork Count2.6k
Commits Count11.3k
Has Issues Enabled
Issues Count3929
Issue Open Count1174
Pull Requests Count4887
Pull Requests Open Count34
Pull Requests Close Count586
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

Web Fundamentals on DevSite

Build Status

Welcome to the new WebFundamentals! An effort to showcase best practices and tools for modern Web Development.

What's changed?

  • We're now using the DevSite infrastructure
    • New style guide
    • New widgets allow inline JavaScript, common links, related guide and more
  • Jekyll has been eliminated. Instead, pages are rendered at request time
  • Front-matter has been eliminated from the markdown, but files now require a simple set of tags

What stays the same?

Cloning the repo

If you have a high-bandwidth connection, I recommend starting with a fresh clone
of the repo.

git clone https://github.com/google/WebFundamentals.git

Getting set up

The new DevSite infrastructure simplifies the dependencies a lot. Ensure
you have Node 10 or greater, and the
AppEngine SDK for Python
already installed.

  1. Run npm install (needed for the build process)

Build the auto-generated files

Some files (contributors includes, some pages for updates, showcases, etc.) are
automatically generated. The first time you clone the repo and run npm install,
this is done for you. However, when you add a case study, update, etc., you'll
need to re-build those files using:

npm run build

Start Local Server

To view the site locally, just run:

npm start

Note: The first time you start the server, you may need to run
start-appengine.sh and answer any prompts provided by dev_appserver.py.

Update the code labs

To update the Code Labs, you'll need the
claat tool and
access to the original Doc files. This will likely only work for Googlers.

  1. Download the claat tool and place it in your tools directory
  2. Run tools/update-codelabs.sh
  3. Check the latest changes into GitHub

Start the development server

  1. Run npm start

Test your changes before submitting a PR

Please run your changes through npm test before submitting a PR. The test
looks for things that may cause issues with DevSite and tries to keep our
content consistent. It's part of the deployment process, so PRs will fail
if there are any errors! To run:

npm test
To the top