Coursera 笔记

Module 04 · Final Project期末项目(补充材料)

Publish your Portfolio to GitHub Pages将作品集发布到 GitHub Pages

Coursera ↗

In this lab, you will publish the portfolio page to Github Pages.
在这个实验室,您将把作品集页面发布到 Github Pages。

GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files straight from a repository on GitHub, optionally runs the files through a build process, and publishes a website.
GitHub Pages 是一种静态网站托管服务,它直接从 GitHub 上的存储库获取 HTML、CSS 和 JavaScript 文件,可选择运行文件通过构建过程,并发布网站。

Prerequisites 先决条件

Before doing this lab, you need to have:
在进行这个实验之前,您需要具备:

  1. Completed the Final Project: Portfolio Website (https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-CD0101EN-SkillsNetwork/labs/Project/Final_Project_V3/final-project_instructions_v3.md.html).
    完成了最终项目:个人网站(https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-CD0101EN-SkillsNetwork/labs/Project/Final_Project_V3/final-project_instructions_v3.md.html)。
  2. Downloaded the Final Project having the below files and folders to your local system:
    下载了以下文件和文件夹的最终项目到您的本地系统:
    • index.html
    • style.css
    • script.js
    • html_finalprojimages folder with the relevant image files
      html_finalprojimages 文件夹包含相关图片文件

Instructions 说明

  1. Sign up for a new Github account at https://github.com/ , or login if you already have an account.
    在 https://github.com/ 注册一个新的 Github 账户,或者如果您已有账户,请登录。
  2. Create a new repository by clicking on the + dropdown at the top right, and selecting New repository.
    通过点击右上角的 + 下拉菜单,选择 New repository 创建一个新的仓库。
  3. Give it an appropriate name like my-portfolio. eg.,JaneDoe-portfolio. Select the repository type as Public, select Add a README file, and click on Create repository.
    给它一个合适的名字,例如 my-portfolio。例如,JaneDoe-portfolio。选择仓库类型为公共,选择添加 README 文件,然后点击 Create repository 。
  4. Go to Settings and select Pages.
    前往 Settings 并选择 Pages 。
  5. Select the branch as main from the dropdown.
    选择下拉菜单中的 main 分支。
  6. Once the main branch is selected click on Save.
    一旦选择了 main 分支,点击 Save 。

With this, the Github repository and the master branch which will be used to configure the Github pages link to your Portfolio, have been set up.
使用此方法,已设置好用于配置 GitHub 页面链接到您的作品集的 GitHub 仓库和主分支。

Task 2 : Adding the project files and folders to your Github repository 任务 2:将项目文件和文件夹添加到您的 GitHub 仓库

  1. Click on Add file and then click on Upload files .
    点击 Add file ,然后点击 Upload files 。
  2. Drag and drop index.html, style.css and script.js files from where they are stored, to add them.
    拖拽 index.html 、 style.css 和 script.js 文件从存储位置,以添加它们。
  3. Add an appropriate commit message and click on Commit Changes.
    添加适当的提交信息并点击 Commit Changes 。
  4. Click on Add File->Create New and enter html_finalprojimages/readme.md as filename. This will create a directory html_finalprojimages for us to upload the image files. You can add a one-line information in the readme.
    点击 Add File->Create New ,输入 html_finalprojimages/readme.md 作为文件名。这将为我们创建一个目录 html_finalprojimages 用于上传图片文件。您可以在 readme 中添加一行信息。
  5. Add an appropriate commit message and click on Commit Changes. This will create the html_finalprojimages images directory.
    添加适当的提交信息并点击 Commit Changes 。这将创建 html_finalprojimages 图片目录。
  6. Click on Add file, and then click on Upload files, and upload all the files by dragging and dropping them from where they are stored.
    点击 Add file ,然后点击 Upload files ,从存储位置拖动所有文件进行上传。
  7. Add an appropriate commit message and click on Commit Changes.
    添加适当的提交信息并点击 Commit Changes 。

With this, the project files and folders have been added.
因此,项目文件和文件夹已添加。

  1. Go to the main page of your repository.
    前往您的仓库主页面。
  2. Go to Settings and select Pages.
    前往 Settings 并选择 Pages 。
  3. Your Github pages link should be visible as below
    您的 Github 页面链接应如下所示
  4. Clicking on Visit site will take you to the page where your Portoflio is published.
    点击 Visit site 将带您进入您作品集发布的页面。

Congratulations! In this lab, you have successfully published your Portfolio on Github Pages.
恭喜!在这个实验室,您已成功在 Github Pages 上发布您的作品集。

Author(s) 作者(们)

K Sundararajan

Other Contributors 其他贡献者

Lavanya T S 拉瓦尼亚·T·S