chen-gary / hugo-theme-academic-old Goto Github PK
View Code? Open in Web Editor NEWThe old version of Hugo academic theme | 旧版Hugo学术主题
License: MIT License
The old version of Hugo academic theme | 旧版Hugo学术主题
License: MIT License
以下API在**大陆访问不稳定,导致网站访问速度变慢:
https://fonts.googleapis.com/css?family=Montserrat:400,700%7CRoboto:400,400italic,700%7CRoboto+Mono&display=swap
替换上述API为国内镜像。值得一提的是,Academic主题中使用的外部库链接不是 hard write 在主题中的。这个主题更像是一个框架,最终生成的网站会用到哪些外部链接,取决于用户启用了哪些功能。这也使得我们很通过难预先下载被调用的库,来避免访问外部链接。
你可以通过比较main和api-cn两个分支来查看我做的修改,核心修改在commit: 48df1ff 和 d2af2d2。我没有把接下来的每一步修改分开commit,这导致直接查看上述的核心commit比较困难。我下文提供的修改样例来自我另一个账号 @iGaryCC 的repo,请参考。
替换 fonts.googleapis.com => fonts.lug.ustc.edu.cn (注:这步似乎并没有实际效果,仍会出现之前地报错。下一步更为关键)
修改样例
删掉config文件中应用fonts.googleapis的部分
修改样例
替换 cdnjs.cloudflare.com => cdn.bootcdn.net (或 cdnjs.loli.net)
修改样例
直接注释掉(这个API的作用似乎是启用Academic主题内置的CMS,我们不会使用这个功能)
修改样例
这个仓库是 Hugo academic theme 的一个fork,并且版本被退回至 commit id: 464a10d
(由于这个仓库与原仓库的发展方向完全不同,未来不会向原仓库提交PR,且为了更方便地添加说明文字,本仓库已由fork转换成standalone)
*选择退回这个版本是因为academic主题的开发者在这次commit前修复了一个感知明显的bug——导航栏明暗模式显示问题。并且目前 (2021.7.2) 这个主题新旧版在核心功能上没有太大差别,旧版也足够好用。
Hugo academic 主题的开发者对这个主题进行了一次比较大的改动。新版的Hugo academic 主题使用Hugo Modules,这使得搭建博客变得“更简单”,但也使用户几乎无法进一步定制这个主题,之后会举一个例子。而这个版本使用“传统的”Hugo themes,用户自由度更高。
正如上面说的:这个版本使用“传统的”Hugo themes。所以只需:
themes/academic
目录(如果clone,记得把文件夹重命名为academic
,并删除.git
)exampleSite
到博客根目录hugo server
预览效果请注意,你需要确保你使用的是Hugo extended,这个主题在“hugo extended v0.83.1”上实测可用,更旧一些的版本应该也会可用,但一定要使用Hugo extended。
没有“直接的”文档。Hugo academic 主题的开发者把旧版的文档删除了,并且他们似乎在有意将自己与Hugo剥离(新版主题已经不附带指向Hugo官网的链接了)。
旧版和新版在feature上并没有很大差别(核心feature基本一致),新版的文档有很大的参考价值。
当然,我认为最快速的方法是直接阅读并修改exampleSite,里面提供的注释还算详细。
你需要修改的全部文件都在博客根目录的以下文件夹中:
api-cn
分支是什么?原主题使用的部分api在**大陆访问不稳定,导致网站访问速度很慢。我将这些造成“访问速度慢”的api替换成了国内的镜像。具体修改请看这个issue。
如果你认为访问你主页的人大多来自**大陆,请考虑使用api-cn
分支的主题。
新版academic主题做的很棒,按官方教程几乎对代码/命令没有要求,强烈建议大家试试。如果你仍然想要使用旧版主题,你可能是这样的人:
api-cn
分支的主题)不会。。。前端也太难了吧😭
真的很感谢 Hugo academic theme 的团队,他们把这个主题开发得非常很棒。请访问他们最新的网站,看看他们提供的服务是否符合你的需求。
Well... If you do not read Chinese, the key point is this repo is the old version of Hugo academic theme. Like other "traditional" Hugo themes, clone this repo to themes/
in the root folder of you blog, rename it to "academic", and delete .git
. Then you are free to go.
This repo is tested in hugo extended v0.83.1, and you may expected it works in some other Hugo versions. But make sure you are using Hugo extended.
I have explained why you may need the old version of Hugo academic theme above in Chinese. If you really want to read the details, please try Google translate at this point. I will try to provide the English translation... Maybe... Or may not...
(As you found this repo, you have got your own reasons why to choose the old version right? 😏)
This repo is made standalone instead of a fork now. Since this repo parts ways with the original one and will not open any PR to the original repo, making it standalone allow me to add additional specifications easier.
I really want to thank the great work by the team of Hugo academic theme. Please check their new website, and see if that suits your needs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.