127 lines
12 KiB
Vue
127 lines
12 KiB
Vue
<template><div><p>以下是将你的内容改为中文并添加 Git 教程的版本:</p>
|
||
<hr>
|
||
<h1 id="快速开始" tabindex="-1"><a class="header-anchor" href="#快速开始"><span>快速开始</span></a></h1>
|
||
<p>这是一个普通页面,包含 VuePress 的基础知识。</p>
|
||
<h2 id="页面" tabindex="-1"><a class="header-anchor" href="#页面"><span>页面</span></a></h2>
|
||
<p>你可以在 VuePress 项目目录中添加 Markdown 文件,每个 Markdown 文件都会被转换为站点中的一个页面。</p>
|
||
<p>更多详细信息请参考<a href="https://vuejs.press/guide/page.html#routing" target="_blank" rel="noopener noreferrer">路由</a>。</p>
|
||
<h2 id="内容" tabindex="-1"><a class="header-anchor" href="#内容"><span>内容</span></a></h2>
|
||
<p>每个 Markdown 文件<a href="https://vuejs.press/guide/page.html#content" target="_blank" rel="noopener noreferrer">将会被渲染为 HTML,然后转换为一个 Vue 单文件组件</a>。</p>
|
||
<p>VuePress 支持基础的 Markdown 语法和<a href="https://vuejs.press/guide/markdown.html#syntax-extensions" target="_blank" rel="noopener noreferrer">一些扩展语法</a>,你还可以在其中<a href="https://vuejs.press/guide/markdown.html#using-vue-in-markdown" target="_blank" rel="noopener noreferrer">使用 Vue 的功能</a>。</p>
|
||
<h2 id="配置" tabindex="-1"><a class="header-anchor" href="#配置"><span>配置</span></a></h2>
|
||
<p>VuePress 使用 <code v-pre>.vuepress/config.js</code>(或 <code v-pre>.ts</code>)文件作为<a href="https://vuejs.press/guide/configuration.html#client-config-file" target="_blank" rel="noopener noreferrer">站点配置</a>,可以用它来配置你的站点。</p>
|
||
<p>对于<a href="https://vuejs.press/guide/configuration.html#client-config-file" target="_blank" rel="noopener noreferrer">客户端配置</a>,你可以创建 <code v-pre>.vuepress/client.js</code>(或 <code v-pre>.ts</code>)文件。</p>
|
||
<p>同时,你还可以通过 <a href="https://vuejs.press/guide/page.html#frontmatter" target="_blank" rel="noopener noreferrer">frontmatter</a> 在每个页面上添加页面级别的配置。</p>
|
||
<h2 id="布局与自定义" tabindex="-1"><a class="header-anchor" href="#布局与自定义"><span>布局与自定义</span></a></h2>
|
||
<p>以下是 <code v-pre>@vuepress/theme-default</code> 主题中常用的布局配置:</p>
|
||
<ul>
|
||
<li><a href="https://vuejs.press/reference/default-theme/config.html#navbar" target="_blank" rel="noopener noreferrer">导航栏</a></li>
|
||
<li><a href="https://vuejs.press/reference/default-theme/config.html#sidebar" target="_blank" rel="noopener noreferrer">侧边栏</a></li>
|
||
</ul>
|
||
<p>有关完整的主题配置参考,请查阅<a href="https://vuejs.press/reference/default-theme/" target="_blank" rel="noopener noreferrer">默认主题文档</a>。</p>
|
||
<p>你还可以通过 <code v-pre>.vuepress/styles/index.scss</code> 文件<a href="https://vuejs.press/reference/default-theme/styles.html#style-file" target="_blank" rel="noopener noreferrer">添加额外的样式</a>。</p>
|
||
<h2 id="git-教程" tabindex="-1"><a class="header-anchor" href="#git-教程"><span>Git 教程</span></a></h2>
|
||
<p>以下是一个简单的 Git 教程,帮助你快速上手 Git 版本管理工具。</p>
|
||
<h3 id="安装-git" tabindex="-1"><a class="header-anchor" href="#安装-git"><span>安装 Git</span></a></h3>
|
||
<ol>
|
||
<li>从 <a href="https://git-scm.com/" target="_blank" rel="noopener noreferrer">Git 官网</a> 下载并安装 Git。</li>
|
||
<li>安装完成后,打开终端并运行以下命令以验证安装:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> <span class="token parameter variable">--version</span></span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
</ol>
|
||
<h3 id="初始化仓库" tabindex="-1"><a class="header-anchor" href="#初始化仓库"><span>初始化仓库</span></a></h3>
|
||
<ol>
|
||
<li>创建一个新的项目文件夹:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">mkdir</span> my-project</span>
|
||
<span class="line"><span class="token builtin class-name">cd</span> my-project</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div></li>
|
||
<li>初始化 Git 仓库:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> init</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
</ol>
|
||
<h3 id="添加和提交文件" tabindex="-1"><a class="header-anchor" href="#添加和提交文件"><span>添加和提交文件</span></a></h3>
|
||
<ol>
|
||
<li>创建一个文件:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token builtin class-name">echo</span> <span class="token string">"Hello Git"</span> <span class="token operator">></span> README.md</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
<li>添加文件到暂存区:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> <span class="token function">add</span> README.md</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
<li>提交文件到仓库:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> commit <span class="token parameter variable">-m</span> <span class="token string">"首次提交"</span></span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
</ol>
|
||
<h3 id="关联远程仓库" tabindex="-1"><a class="header-anchor" href="#关联远程仓库"><span>关联远程仓库</span></a></h3>
|
||
<ol>
|
||
<li>访问 <a href="https://github.com/" target="_blank" rel="noopener noreferrer">GitHub</a> 或其他代码托管平台,创建一个新的仓库。</li>
|
||
<li>将本地仓库与远程仓库关联:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> remote <span class="token function">add</span> origin https://github.com/your-username/your-repository.git</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
<li>推送代码到远程仓库:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> push <span class="token parameter variable">-u</span> origin main</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
</ol>
|
||
<h3 id="克隆仓库" tabindex="-1"><a class="header-anchor" href="#克隆仓库"><span>克隆仓库</span></a></h3>
|
||
<p>从远程仓库克隆代码到本地:</p>
|
||
<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> clone https://github.com/your-username/your-repository.git</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h3 id="常用命令" tabindex="-1"><a class="header-anchor" href="#常用命令"><span>常用命令</span></a></h3>
|
||
<ul>
|
||
<li>查看当前状态:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> status</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
<li>查看提交记录:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> log</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div></li>
|
||
<li>创建新分支:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> branch new-branch</span>
|
||
<span class="line"><span class="token function">git</span> checkout new-branch</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div></li>
|
||
<li>合并分支:<div class="language-bash line-numbers-mode" data-highlighter="prismjs" data-ext="sh" data-title="sh"><pre v-pre><code><span class="line"><span class="token function">git</span> checkout main</span>
|
||
<span class="line"><span class="token function">git</span> merge new-branch</span>
|
||
<span class="line"></span></code></pre>
|
||
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div></li>
|
||
</ul>
|
||
<p>更多详细信息,请参考 <a href="https://git-scm.com/doc" target="_blank" rel="noopener noreferrer">Git 官方文档</a>。</p>
|
||
<hr>
|
||
<h2 id="参考链接" tabindex="-1"><a class="header-anchor" href="#参考链接"><span>参考链接</span></a></h2>
|
||
<ul>
|
||
<li><a href="https://vuejs.press/guide/page.html#routing" target="_blank" rel="noopener noreferrer">路由</a></li>
|
||
<li><a href="https://vuejs.press/guide/page.html#content" target="_blank" rel="noopener noreferrer">内容渲染</a></li>
|
||
<li><a href="https://vuejs.press/guide/markdown.html#syntax-extensions" target="_blank" rel="noopener noreferrer">语法扩展</a></li>
|
||
<li><a href="https://vuejs.press/guide/markdown.html#using-vue-in-markdown" target="_blank" rel="noopener noreferrer">使用 Vue 功能</a></li>
|
||
<li><a href="https://vuejs.press/guide/configuration.html#client-config-file" target="_blank" rel="noopener noreferrer">站点配置</a></li>
|
||
<li><a href="https://vuejs.press/guide/configuration.html#client-config-file" target="_blank" rel="noopener noreferrer">客户端配置</a></li>
|
||
<li><a href="https://vuejs.press/guide/page.html#frontmatter" target="_blank" rel="noopener noreferrer">Frontmatter</a></li>
|
||
<li><a href="https://vuejs.press/reference/default-theme/config.html#navbar" target="_blank" rel="noopener noreferrer">导航栏配置</a></li>
|
||
<li><a href="https://vuejs.press/reference/default-theme/config.html#sidebar" target="_blank" rel="noopener noreferrer">侧边栏配置</a></li>
|
||
<li><a href="https://vuejs.press/reference/default-theme/" target="_blank" rel="noopener noreferrer">默认主题文档</a></li>
|
||
<li><a href="https://vuejs.press/reference/default-theme/styles.html#style-file" target="_blank" rel="noopener noreferrer">样式自定义</a></li>
|
||
</ul>
|
||
<hr>
|
||
<h3 id="链接说明" tabindex="-1"><a class="header-anchor" href="#链接说明"><span>链接说明</span></a></h3>
|
||
<ul>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
<li></li>
|
||
</ul>
|
||
<hr>
|
||
<h3 id="修改说明" tabindex="-1"><a class="header-anchor" href="#修改说明"><span>修改说明</span></a></h3>
|
||
<ol>
|
||
<li>将内容翻译为中文。</li>
|
||
<li>添加了一个简单的 Git 教程,包含安装、基本使用和常用命令。</li>
|
||
<li>保留了原始参考链接,方便用户查阅详细文档。</li>
|
||
</ol>
|
||
<p>你可以直接将此内容粘贴到 VuePress 项目的 Markdown 文件中使用。</p>
|
||
</div></template>
|
||
|
||
|