登陆linux vps,安装nodejs.
然后npm install -g metalsmith
git clone https://github.com/blakeembrey/blakeembrey.com /usr/local/blakeembrey.com-site/
cd /usr/local/blakeembrey.com-site/
root@AR:/usr/local/blakeembrey.com-site# ls
config readme.md templates
build.js LICENSE package.json src
root@AR:/usr/local/blakeembrey.com-site# npm install
(因为目录中有package.json文件,于是运行 npm install来安装该程序的一些依赖/模块)
root@AR:/usr/local/blakeembrey.com-site# ls
config node_modules readme.md templates
build.js LICENSE package.json src
root@AR:/usr/local/blakeembrey.com-site#
(运行 npm install后,就会生成node_modules目录)
root@AR:/usr/local/blakeembrey.com-site# node build.js (这个就是生成静态网站的命令)
root@AR:/usr/local/blakeembrey.com-site# ls
build config node_modules readme.md templates
build.js LICENSE package.json src
(生成了build目录)
root@AR:/usr/local/blakeembrey.com-site# cd build
root@AR:/usr/local/blakeembrey.com-site/build# ls
articles CNAME css favicon.ico feed.xml index.html page vendor
(/usr/local/blakeembrey.com-site/build/目录里有index.html文件,可见/usr/local/blakeembrey.com-site/build/目录就是静态网站的根目录,你可绑定域名到该目录)
新建源贴:
root@AR:/usr/local/blakeembrey.com-site/build# cd ..
root@AR:/usr/local/blakeembrey.com-site# cd src
root@AR:/usr/local/blakeembrey.com-site/src# ls
articles CNAME css favicon.ico feed.xml vendor
root@AR:/usr/local/blakeembrey.com-site/src# cd articles
root@AR:/usr/local/blakeembrey.com-site/src/articles# ls
2011 2012 2013 2014 2015 2016
root@AR:/usr/local/blakeembrey.com-site/src/articles# cd 2016
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# ls
01
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# cd 01
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01# ls
intro-to-free-style-css-in-js
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01# cd intro-to-free-style-css-in-js
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js# ls
index.md
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js#
按/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js/index.md文件的格式,操作如下:
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js# cd /usr/local/blakeembrey.com-site/src/articles/2016/
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# mkdir 07
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# cd 07
oot@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07# mkdir marriage
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07# cd marriage
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# nano index.md
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# cat index.md
---
title: 周国平谈女人,爱情,婚姻
date: 2016-07-23 13:07
author: brite
template: article.jade
github: blakeembrey/free-style
npm: free-style
---
此处写正文。
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# cd /usr/local/blakeembrey.com-site
root@AR:/usr/local/blakeembrey.com-site# node build.js
演示网站:http://be.smt.biz.st/, http://be.bright.biz.st/
项目地址:https://github.com/metalsmith/metalsmith
https://github.com/blakeembrey/blakeembrey.com
git clone https://gitlab.com/ev/blog/ ev-metalwork-blog
cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
index.js package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# npm install
root@AR:/usr/local# cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
index.js node_modules package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# node index.js (这就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local# cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
build index.js node_modules package.json readme.md src templates
(生成了build目录)
root@AR:/usr/local/ev-metalwork-blog# cd build
root@AR:/usr/local/ev-metalwork-blog/build# ls
404 evbogue-badass.jpg metalwork rss.xml
blog index.html node.jpg static
root@AR:/usr/local/ev-metalwork-blog/build#
(可见/usr/local/ev-metalwork-blog/build就是静态网站的根目录)
新建源帖:
root@AR:/usr/local/ev-metalwork-blog/build# cd ..
root@AR:/usr/local/ev-metalwork-blog# ls
build index.js node_modules package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# cd src
root@AR:/usr/local/ev-metalwork-blog/src# ls
404.md blog evbogue-badass.jpg index.md metalwork.md node.jpg static
root@AR:/usr/local/ev-metalwork-blog/src# cd blog
root@AR:/usr/local/ev-metalwork-blog/src/blog# nano test-1.md
root@AR:/usr/local/ev-metalwork-blog/src/blog# cat test-1.md
---
title: 测试1
date: 2017-01-08T19:28:50.703Z
collection: blog
template: post.jade
---
这是测试1.
看看如何?
root@AR:/usr/local/ev-metalwork-blog/src/blog# cd ../..
root@AR:/usr/local/ev-metalwork-blog# node index.js
演示网站:http://mw.bright.biz.st
项目地址:https://gitlab.com/ev/blog/ (或者https://github.com/evbogue/evbogue.com.old,这2个仓库里的源码是一样的。)
演变版的项目地址:https://github.com/evbogue/evbogue.com
演示网站:http://eb.bright.biz.st
(Metalwork
Here is a list of plugin links.
Here are the plugins featured on the Metalsmith.io website. If you want to add yours, submit a pull request!
----------------------
https://github.com/charlgottschalk/coppersmith 这个源码也是基于 metalsmith.
然后npm install -g metalsmith
git clone https://github.com/blakeembrey/blakeembrey.com /usr/local/blakeembrey.com-site/
cd /usr/local/blakeembrey.com-site/
root@AR:/usr/local/blakeembrey.com-site# ls
config readme.md templates
build.js LICENSE package.json src
root@AR:/usr/local/blakeembrey.com-site# npm install
(因为目录中有package.json文件,于是运行 npm install来安装该程序的一些依赖/模块)
root@AR:/usr/local/blakeembrey.com-site# ls
config node_modules readme.md templates
build.js LICENSE package.json src
root@AR:/usr/local/blakeembrey.com-site#
(运行 npm install后,就会生成node_modules目录)
root@AR:/usr/local/blakeembrey.com-site# node build.js (这个就是生成静态网站的命令)
root@AR:/usr/local/blakeembrey.com-site# ls
build config node_modules readme.md templates
build.js LICENSE package.json src
(生成了build目录)
root@AR:/usr/local/blakeembrey.com-site# cd build
root@AR:/usr/local/blakeembrey.com-site/build# ls
articles CNAME css favicon.ico feed.xml index.html page vendor
(/usr/local/blakeembrey.com-site/build/目录里有index.html文件,可见/usr/local/blakeembrey.com-site/build/目录就是静态网站的根目录,你可绑定域名到该目录)
新建源贴:
root@AR:/usr/local/blakeembrey.com-site/build# cd ..
root@AR:/usr/local/blakeembrey.com-site# cd src
root@AR:/usr/local/blakeembrey.com-site/src# ls
articles CNAME css favicon.ico feed.xml vendor
root@AR:/usr/local/blakeembrey.com-site/src# cd articles
root@AR:/usr/local/blakeembrey.com-site/src/articles# ls
2011 2012 2013 2014 2015 2016
root@AR:/usr/local/blakeembrey.com-site/src/articles# cd 2016
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# ls
01
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# cd 01
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01# ls
intro-to-free-style-css-in-js
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01# cd intro-to-free-style-css-in-js
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js# ls
index.md
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js#
按/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js/index.md文件的格式,操作如下:
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/01/intro-to-free-style-css-in-js# cd /usr/local/blakeembrey.com-site/src/articles/2016/
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# mkdir 07
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016# cd 07
oot@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07# mkdir marriage
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07# cd marriage
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# nano index.md
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# cat index.md
---
title: 周国平谈女人,爱情,婚姻
date: 2016-07-23 13:07
author: brite
template: article.jade
github: blakeembrey/free-style
npm: free-style
---
此处写正文。
root@AR:/usr/local/blakeembrey.com-site/src/articles/2016/07/marriage# cd /usr/local/blakeembrey.com-site
root@AR:/usr/local/blakeembrey.com-site# node build.js
演示网站:http://be.smt.biz.st/, http://be.bright.biz.st/
项目地址:https://github.com/metalsmith/metalsmith
https://github.com/blakeembrey/blakeembrey.com
Resources
- IRC Channel - it's
#metalsmith
on freenode! - Slack Channel
- Getting to Know Metalsmith - a great series about how to use Metalsmith for your static site.
- Building a Blog With Metalsmith - a blog post about how to create a basic blog with Metalsmith. Check out the related video of the talk too!
- Awesome Metalsmith - great collection of resources, examples, and tutorials
git clone https://gitlab.com/ev/blog/ ev-metalwork-blog
cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
index.js package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# npm install
root@AR:/usr/local# cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
index.js node_modules package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# node index.js (这就是生成/更新静态网站的根目录的命令)
root@AR:/usr/local# cd ev-metalwork-blog
root@AR:/usr/local/ev-metalwork-blog# ls
build index.js node_modules package.json readme.md src templates
(生成了build目录)
root@AR:/usr/local/ev-metalwork-blog# cd build
root@AR:/usr/local/ev-metalwork-blog/build# ls
404 evbogue-badass.jpg metalwork rss.xml
blog index.html node.jpg static
root@AR:/usr/local/ev-metalwork-blog/build#
(可见/usr/local/ev-metalwork-blog/build就是静态网站的根目录)
新建源帖:
root@AR:/usr/local/ev-metalwork-blog/build# cd ..
root@AR:/usr/local/ev-metalwork-blog# ls
build index.js node_modules package.json readme.md src templates
root@AR:/usr/local/ev-metalwork-blog# cd src
root@AR:/usr/local/ev-metalwork-blog/src# ls
404.md blog evbogue-badass.jpg index.md metalwork.md node.jpg static
root@AR:/usr/local/ev-metalwork-blog/src# cd blog
root@AR:/usr/local/ev-metalwork-blog/src/blog# nano test-1.md
root@AR:/usr/local/ev-metalwork-blog/src/blog# cat test-1.md
---
title: 测试1
date: 2017-01-08T19:28:50.703Z
collection: blog
template: post.jade
---
这是测试1.
看看如何?
root@AR:/usr/local/ev-metalwork-blog/src/blog# cd ../..
root@AR:/usr/local/ev-metalwork-blog# node index.js
演示网站:http://mw.bright.biz.st
项目地址:https://gitlab.com/ev/blog/ (或者https://github.com/evbogue/evbogue.com.old,这2个仓库里的源码是一样的。)
演变版的项目地址:https://github.com/evbogue/evbogue.com
演示网站:http://eb.bright.biz.st
(Metalwork
Metalwork is a built out Metalsmith blog that works.
I'm using a slightly customized version of Metalwork at evbogue.com
Metalwork requires Node.js, Bower, and npm.
To get started:
npm install -g metalwork bower
cd /usr/local
metalwork metalwork-site (此命令会在当前目录下,生成
metalwork-site目录)
cd metalwork-site
root@AR:/usr/local/metalwork-site# ls
bower.json index.js node_modules readme.md
layouts package.json src
root@AR:/usr/local/metalwork-site# bower install --allow-root
root@AR:/usr/local/metalwork-site# node index.js
root@AR:/usr/local/metalwork-site# ls
bower.json index.js node_modules readme.md
build layouts package.json src
(生成了build目录)
root@AR:/usr/local/metalwork-site# cd build
root@AR:/usr/local/metalwork-site/build# ls
evbogue-badass.jpg metalwork rss.xml writeablog
index.html node.jpg
root@AR:/usr/local/metalwork-site/build#
(可见
/usr/local/metalwork-site/build就是静态网站的根目录)
新建源帖:
root@AR:/usr/local/metalwork-site/build# cd ../src
root@AR:/usr/local/metalwork-site/src# nano test-1.md
root@AR:/usr/local/metalwork-site/src# cat test-1.md
---
title: 测试1
layout: post.jade
date: 2017-01-10 18:00:00
collection: blog
---
这是测试1.
看看如何?
root@AR:/usr/local/metalwork-site/src# cd ..
root@AR:/usr/local/metalwork-site# node index.js或
npm start
演示网站:http://mw-demo.bright.biz.st/
项目地址:https://gitlab.com/ev/metalwork
Tutorials
Using Metalsmith
- Exploring Metalsmith, 06/06/2014
- Setting up the Forge (1/3), 04/14/2014
- Shaping the Metal (2/3), 04/18/2014
- Refining our Tools (3/3), 04/29/2014
- Building a Blog with Metalsmith (blakeembrey), 09/2014
- Metalsmith on GitHub Pages, 09/05/2014
- Way of Metalsmith, 09/09/2014
- Rebuilding Keetology, 10/21/2014
- Building a Blog with Metalsmith (azurelogic), 03/30/2015
- Building a Blog with Metalsmith (okaythree), 03/12/2015
- Understanding Metalsmith, 5/16/2015
- Building a Blog in ES6 with Metalsmith (cameronjroe) 11/05/2015
- Introduction to Metalsmith, 08/12/2015
- Creating Static Sites with Metalsmith, 09/18/2015
- Using Node and Metalsmith, 10/04/2015
- Building Technical Documentation with Metalsmith, 10/20/2015
- Mastering metalsmith: best practices for static sites, 11/4/2015
- Rebuilding davidosomething.com as a static site, 12/28/2015
Building Plugins
- Creating a Metalsmith Tab Plugin, 08/09/2014
- Metalsmith Plugins, 07/23/2015
- Metalsmith: Hover Plugin to Show Gifs, 07/13/2015
- metalsmith-polyglot, 11/15/2015
Plugins
Here is the GitHub query for "metalsmith".Here is a list of plugin links.
Here are the plugins featured on the Metalsmith.io website. If you want to add yours, submit a pull request!
Generator
Examples
Blogs
- Neustadt.fr (or on GitHub)
- mrkiffie.com (or on GitHub)
Site
- RedStarIT (or on GitHub)
- blue Systems Research Group (or on GitHub)
- Revermont.bike (or on GitHub)
Repository
- Metalsmith-boilerplates, a collection of ready to use boilerplates for various metalsmith plugins.
- Metalsmith-base, A base starter for a Metalsmith project used at Evocode.com
----------------------
https://github.com/charlgottschalk/coppersmith 这个源码也是基于 metalsmith.