当前位置: 首页 > news >正文

公司网站建设费用入什么费用wordpress调用多说

公司网站建设费用入什么费用,wordpress调用多说,工程项目挂网在什么网站上看,做电影网站的流程版权归作者所有,如有转发,请注明文章出处:https://cyrus-studio.github.io/blog/ 使用 Chocolatey 安装 Hugo Chocolatey 是一个 Windows 软件包管理器,使用 PowerShell 和 NuGet 作为基础。它可以自动化软件的安装、升级和卸载过…

版权归作者所有,如有转发,请注明文章出处:https://cyrus-studio.github.io/blog/

使用 Chocolatey 安装 Hugo

Chocolatey 是一个 Windows 软件包管理器,使用 PowerShell 和 NuGet 作为基础。它可以自动化软件的安装、升级和卸载过程。

安装 Chocolatey(如果还没有安装)

Chocolatey 允许你通过设置环境变量来更改默认安装路径。在安装 Chocolatey 之前,你需要设置 ChocolateyInstall 环境变量来指定新的安装路径。

打开 PowerShell(以管理员身份运行),并执行以下命令指定自定义安装路径:

1. [System.Environment]::SetEnvironmentVariable('ChocolateyInstall', 'D:\App\chocolatey', [System.EnvironmentVariableTarget]::Machine)
  1. 如果不设置默认安装路径为:C:\ProgramData\chocolatey

设置完 ChocolateyInstall 环境变量后,重新打开一下会话,执行下面的命令检查一下是否设置成功

Get-Item Env:ChocolateyInstall

打开 PowerShell(以管理员身份运行),执行以下命令安装 Chocolatey:

1. Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

检查是否安装成功

choco -h

安装 Hugo

在 PowerShell 中运行以下命令安装 Hugo:
安装软件包:

choco install hugo -confirm

升级软件包:

choco upgrade hugo

卸载软件包:

choco uninstall hugo

验证安装:

1. hugo version

创建 Hugo 网站

1. 创建 Hugo 网站

打开终端或命令行,执行以下命令:

1. # 导航到目标目录
2. cd D:/# 创建目标目录并进入
mkdir hugo
cd hugo# 在当前目录下创建 Hugo 站点 cyrus
hugo new site cyrus

2. 添加主题

官方主题网站:https://themes.gohugo.io/

你可以选择一个喜欢的主题并添加到你的 Hugo 网站。例如:

1. git init
2. git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke

在 hugo.toml 文件中添加 theme = “ananke”,表示使用 themes 下的 ananke 主题
image.png

由于 ananke 主题使用 SCSS/SASS,Hugo标准版是不支持的。
Hugo 的扩展版包含了对 SCSS/SASS 等高级功能的支持,通过以下命令升级到扩展版

choco upgrade hugo-extended -confirm

3. 创建内容

生成一个新的博客文章:

1. hugo new posts/my-first-post.md
  1. 编辑 content/posts/my-first-post.md 文件,添加你的文章内容。

4. 本地预览

运行以下命令来本地预览你的博客:

1. # 启动服务器
2. hugo server
3. # 或
4. # 启动本地开发服务器,包括草稿内容在内。
5. hugo server -D
  1. 打开浏览器访问 http://localhost:1313 查看你的博客。

5. 生成静态文件

hugo

生成的静态文件会放在 public 目录中。

部署到 GitHub Pages

1. 创建 GitHub 仓库

在 GitHub 上创建一个新的仓库,命名为 blog。

2. 配置 Hugo 部署

在你的 Hugo 项目中,创建 .github/workflows/hugo.yaml 文件,内容如下:

# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pageson:# Runs on pushes targeting the default branchpush:branches:- main# Allows you to run this workflow manually from the Actions tabworkflow_dispatch:# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:contents: readpages: writeid-token: write# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:group: "pages"cancel-in-progress: false# Default to bash
defaults:run:shell: bashjobs:# Build jobbuild:runs-on: ubuntu-latestenv:HUGO_VERSION: 0.128.0steps:- name: Install Hugo CLIrun: |wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \&& sudo dpkg -i ${{ runner.temp }}/hugo.deb          - name: Install Dart Sassrun: sudo snap install dart-sass- name: Checkoutuses: actions/checkout@v4with:submodules: recursivefetch-depth: 0- name: Setup Pagesid: pagesuses: actions/configure-pages@v5- name: Install Node.js dependenciesrun: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"- name: Build with Hugoenv:HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cacheHUGO_ENVIRONMENT: productionTZ: America/Los_Angelesrun: |hugo \--gc \--minify \--baseURL "${{ steps.pages.outputs.base_url }}/"          - name: Upload artifactuses: actions/upload-pages-artifact@v3with:path: ./public# Deployment jobdeploy:environment:name: github-pagesurl: ${{ steps.deployment.outputs.page_url }}runs-on: ubuntu-latestneeds: buildsteps:- name: Deploy to GitHub Pagesid: deploymentuses: actions/deploy-pages@v4

Host on GitHub Pages:https://gohugo.io/hosting-and-deployment/hosting-on-github/

修改 baseURL = ‘https://your-username.github.io/blog/’
image.png

3. 提交代码并推送到 GitHub

初始化 git 仓库并将代码推送到 GitHub:

1. git add .
2. git commit -m "Initial commit"
3. git branch -M main
4. git remote add origin https://github.com/your-username/your-username.github.io.git
5. git push -u origin main

代码上传完成后,打开【Settings】【Pages】,修改【Source】和【Branch】如下:
image.png

4. 查看博客

image.png

GitHub Actions 会自动构建并部署你的博客,等待workflow run完,你可以通过 https://your-username.github.io/blog 访问你的博客。

image.png
总结

通过以上步骤,你可以使用 Hugo 和 GitHub Pages 0成本地搭建一个博客。这个方法不需要购买域名和托管服务,使用的工具和平台都是免费的。你可以根据需要选择和定制主题,添加内容,并通过 GitHub Pages 免费托管和发布你的博客。

http://www.yayakq.cn/news/204044/

相关文章:

  • 网站建设管理工作的总结做一个网站维护多少钱
  • 自己做网站 有名6天津市网站建设管理办法
  • 公司网站开发需要什么证书路由器安装wordpress
  • 黑龙江生产建设兵团知青网站网站用php与asp哪个好
  • 设计网站官网有哪些可以做兼职翻译的网站
  • 新加坡二手手机网站大全wordpress 公众号采集
  • 租凭境外服务器做违规网站装修公司十大排行榜
  • 个人站长做什么网站好1+官网商城
  • 商城网站建设公司招聘wordpress筛选热门列表
  • 官网源码下载seo推广优化费用
  • 网站建设客户常见问题村网通为每个农村建设了网站
  • 网站建设工程设计图app下载页面
  • 网站建设功能要求WordPress企业响应式主题
  • 南昌网站维护制作在什么网站上做外贸
  • 怎么制作网站app手机应用商店下载app
  • 网站备案 怎么加网站关键词选取
  • 石英石台面做网单有什么网站精品网站做爆款
  • 怎么做家政的网站网站公司做网站修改会收费吗
  • 网站底部 设计一般做推广网站的客户需求仕什么
  • 徐州智能模板建站电子商务都是做网站的吗
  • 购物网站开发教程视频外贸网站推广有哪些
  • 北京网站建设联系兴田德润兰州seo快速排名
  • 各大搜索引擎提交网站入口大全新能源汽车价格表
  • 搜索公司信息的网站网站链接做二维码
  • 分销网站手机模板wordpress当前版本
  • 网站开发学习课程湖南建筑网
  • 上海手机网站建设报价做网盘搜索网站
  • 公司做网站哪家好织梦欧美网站模板
  • 长春网站建设优势吉网传媒好网站备案表上面的开办单位写什么
  • 傻瓜式网站制作软件东莞市品牌网站建设平台