hugo

利用 Hexo 或者 hugo 搭建个人博客

旧巷老猫 提交于 2020-02-26 05:09:52
我们无法选择生活的样子,但我们可以记下来。 博客的开始 其实,一切都是为了更好的装逼。好吧,我着相了。 最开始想做一个自己博客,主要是因为看到了很多人都有,觉得自己没有太 Low 了。于是申请了 CSDN 的用户,但是太丑了,于是又申请了博客园,感觉这些都不是我想要的,而做为一个 Emacser 不使用 Github 搭建一个自己的博客,感觉就已经落伍了。 于是就有这最初的一个,相当简陋的利用 Emacs 的 Org-mode 搭建的博客,后来看了 Org-page 这个包,但是,我配置不好啊!为什么为什么! 最后,从 Hugo 和 Hexo 之间,我选择了 Hexo,虽然 Hugo 在 Windows 上使用起来更方便,但是我还是觉得 Hexo 更适合我。 利用 Hexo 的坑 有些插件需要翻墙,有些不用,我也不记得哪个用哪个不用了,实在不行可以使用淘宝的 npm 源进行安装。 环境配置好之后,最好更新一下模板,把一些常用的内容写到 Hexo 的模板里,这样在后续的使用中,可以快速的增加标签、分类和简介等内容。 学习 Markdown , 这个并不是一个坑,而是一个忠告,作为一个常年游荡在 GitHub 的好同志来说,但是对于一个 Emacser 来说,我更喜欢 Org-mode ,但是 Org-mode 并不能直接用来发布 Hexo 博客,有些人会说可以利用一些工具

Create a table of contents (toc) in a post with blogdown package

谁都会走 提交于 2020-02-25 05:47:46
问题 I know the short answer, add the following in the metadata toc: TRUE But when I create a post with the blogdown package that have a table of content, I have problems with the url (redirection) behind the table options. The links for the table of content are of the following form: http://home-website/#tree-terminology Instead to be: http://home-website/post_name/#tree-terminology How can reference the name of the post correctly in the url to generate the proper url in the table of content? In

Create a table of contents (toc) in a post with blogdown package

心已入冬 提交于 2020-02-25 05:47:45
问题 I know the short answer, add the following in the metadata toc: TRUE But when I create a post with the blogdown package that have a table of content, I have problems with the url (redirection) behind the table options. The links for the table of content are of the following form: http://home-website/#tree-terminology Instead to be: http://home-website/post_name/#tree-terminology How can reference the name of the post correctly in the url to generate the proper url in the table of content? In

Hugo template formatting in VS Code

房东的猫 提交于 2020-02-25 01:35:45
问题 The auto format in VS Code is making my code unreadable by removing indentations. I don't know how to turn this off for handlebars only. Input: {{ range ... }} {{ if .... }} {{if ... }} <tag></tag> {{end}} {{end}} {{end}} Output {{ range ... }} {{ if .... }} {{if ... }} <tag></tag> {{end}} {{end}} {{end}} Any way to prevent this? 回答1: I couldn't find a clean way to do this, but the kludgy work around I found is to use the html.format.contentUnformatted setting in my workspace with a custom

【hugo】- hugo 监听浏览器切换title

不打扰是莪最后的温柔 提交于 2020-01-30 12:52:57
hugo 博客 监听浏览器title 动态改变浏览器title标题 找到head.html themes/maupassant/layouts/partials/head.html 添加监听js 可以从html中发现,分为home页面和其他页面,两种展示的不同,所以需要改这两部分 {{ if .IsHome -}} <title>{{ .Site.Title }} | {{ .Site.Params.subtitle}}</title> <meta property="og:title" content="{{ .Site.Title }} | {{ .Site.Params.subtitle}}"> <meta property="og:type" content="website"> <meta name="Keywords" content="{{.Site.Params.keywords}}"> <meta name="description" content="{{ .Site.Params.description }}"> <!--添加部分-start--> <script> document.addEventListener('visibilitychange',function(){ if( document.visibilityState == 'hidden'

Unable to create new site using (hugo) Academic theme

拜拜、爱过 提交于 2020-01-21 05:38:04
问题 I am new to blogdown and working my way through the fabulous resource to guide me. Unfortunately, I am unable to use the academic theme in hugo. To create a new site I have: Created a new (empty) project in a brand new working directory. Installed blogdown and hugo, as recommended Tried to create a new site by running the following: blogdown::new_site(theme = "gcushen/hugo-academic") Unfortunately, I then encounter the following errors: Error: Unable to find theme Directory: C:\Users

Control index.xml for Atom/RSS (hugo / blogdown generates feed with relative links)

牧云@^-^@ 提交于 2020-01-10 04:00:27
问题 Which parameters in config.toml or which files in /layouts control the generation of index.xml ? When I validate my Atom feed, I get a number of errors, pretty much all of them due to links not being complete links. https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ftaraskaduk.com%2Findex.xml Example: <title>My first shiny app: calculating your hourly rate as a consultant</title> <link>/post/2018-01-shiny-rate/shiny_rate/</link> <pubDate>Sat, 13 Jan 2018 00:00:00 +0000</pubDate> My

hugo搭建个人博客

浪尽此生 提交于 2020-01-07 14:25:39
本地先安装git 1. 下载 hugo ,并配置好环境变量 我这里win7 64位,选择该版本下载 将解压后的hugo.exe,配置到环境变量中,如下图所示表明配置成功 hugo version 2. 生成本地站点 hugo new site wiki 3. 选择 主题 这里选择其中一款 cd wiki cd themes git clone https://github.com/dplesca/purehugo.git 4. 新建文章 hugo new post/my_first_blog.md 写入markdown内容 5. 预览 hugo server --theme=purehugo --buildDrafts http://localhost:1313/purehugo/ 至此本地编写博客基本完成 6. 创建码云项目 可以参考该 文档 这里创建项目名应为an1993不需要an1993.gitee.io 配置config.toml baseurl = "https://an1993.gitee.io/" languageCode = "zh-CN" title = "足迹人生" theme = "purehugo" Paginate = 10 disqusShortname = "john" [params] 7. 生成静态页面 hugo --theme=purehugo

Bad rendering of the local index.html from public folder using HUGO

孤街醉人 提交于 2020-01-06 11:44:40
问题 The bounty expires in 4 days . Answers to this question are eligible for a +50 reputation bounty. Dev P wants to draw more attention to this question. I am creating a web using RStudio and HUGO, by means of the Blogdown package. When serving the site locally in RStudio, it seems to be rendered properly. All the files are created within the folder /public . However, when I open the file index.html from the /public folder, I get this appearance. I am employing the theme Mainroad with this base

How to use the container Hugo version with One Click Netlify CMS example

别等时光非礼了梦想. 提交于 2020-01-06 09:56:29
问题 In the Netlify CMS community chat, the question keeps coming up how to manage the Hugo version without a bin folder and executable. The one-click-hugo-cms example is a deploy to generate a Hugo static site and use Netlify CMS to be able to add posts for the site. The Issue : The site setup uses a bin folder to store the Hugo executable for simplicity, but the developer wants to use a different version of Hugo and keep it up to date without having to keep copying new executables to the Hugo