Hello World

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment

Fediverse生态应用

Mastodon is an open source decentralized social network - by the people for the people. Join the federation and take back control of your social media!

Pixelfed is an activitypub based image sharing platform.

Funkwhale is a community-driven project that lets you listen and share music and audio within a decentralized, open network.

PeerTube developed by Framasoft, is the free and decentralized alternative to video platforms, providing you over 400,000 videos published by 60,000 users and viewed over 15 million times.

WriteFreely is free and open source software for easily publishing writing on the web. Use it to start a personal blog — or an entire community.


参考: 活用 Bulma 美化 Icarus 文章

Hexo整合Matataki用Fan票打赏Blog文章

Hexo整合Matataki用Fan票打赏Blog文章

修改记录

  • 2020-12-14 初稿
  • 2020-12-15 修改方案,支持在目录页打赏

概述

在文章之后留下打赏地址/链接/二维码已经是一种很主流的激励创作者的形式了,Matataki的主站也支持用Fan票进行打赏。那么在站外我们能否用上Fan票呢?答案是肯定的。

如果已经有MetaMask这样的钱包,可以使用Fan票折跃门,把托管在平台上的Fan票转到我们自己的钱包,这样Blog上只要留下钱包地址即可转账打赏。

使用钱包仍然有些门槛,本文介绍了一种方法,可以当作站外使用Fan票场景的简单补充。这篇文章的成果很大程度上是基于

的研究:

使用的样例工程也是上文中提到的https://github.com/nekomeowww/hexo-plugin-matataki-example
这个方法工作量不大,只要做脚本集成就可以了,相对地,对Matataki的主站有依赖。

步骤

  1. FanLocker一样,我们在_config.yml里做好配置:
1
2
matataki:
userId: 4382

一般情况下整个Blog的文章都是自己的,打赏对象都是同一个人,所以不需要每篇文章分开来配置。这个userId可以在Matataki的个人主页看到,比如 https://www.matataki.io/user/4382

  1. 新建文件themes/landscape/layout/matataki.ejs,为Blog目录和每篇文章增加脚本片段
1
2
3
4
5
6
7
8
9
10
11
12
13
<script>
var mttk = {
userId: '<%- config.matataki.userId %>',
open: function (href) {
window.open(href, 'hexo-mttk',
'width=445,height=700,resizable=no,menubar=no,status=no,scrollbars=yes');
},
openUserHome: function () {
let href = 'https://matataki.io/user/' + mttk.userId;
mttk.open(href);
}
};
</script>

然后在themes/landscape/layout/_partial/header.ejs里添加引用

1
2
3
4
<head>
<meta charset="utf-8">
<%- partial('matataki') %>

这样就在每个页面都声明了mttk对象

  1. 在博客的分享脚本里增加打开Matataki的链接。这个主题是在themes/landscape/source/js/script.js。找到Share部分,增加动态html脚本
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Share
$('body').on('click', function(){
// ...

var html = [
'<div id="' + id + '" class="article-share-box">',
'<input class="article-share-input" value="' + url + '">',
'<div class="article-share-links">',
'<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
'<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
'<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="article-share-pinterest" target="_blank" title="Pinterest"></a>',
'<a href="javascript:mttk.openUserHome()" class="article-share-matataki" title="Matataki"></a>',
'</div>',
'</div>'
].join('');

//...
});

就是 '<a href="javascript:mttk.openUserHome()" class="article-share-matataki" title="Matataki"></a>',这句了。因为现在Matataki还不支持带入分享链接,先这样没有入参也是可以的

为了article-share-matataki这个样式,我们再调整一下css

  1. 打开themes/landscape/source/css/_partial/article.styl,增加如下样式:
1
2
3
4
5
6
7
.article-share-matataki
@extend $article-share-link
&:before
content: "\f087"
&:hover
background: color-google
text-shadow: 0 1px darken(color-google, 20%)

content这里是字体图标,可以去http://www.fontawesome.com.cn/faicons/找个自己喜欢的,比如:http://www.fontawesome.com.cn/icons/thumbs-o-up/,把里面的Unicode填到content:后就可以了,注意要加一个反斜杠 \

5.看看效果

image.png

image.png
这个点赞图标就是我们加上的打开Matataki页面的链接了。点击之后会弹出窗口,打开博主在Matataki的个人主页,也就是上面配置的userId

image.png

因为实际就是主站点,登录和转账的方式都是一样的

留言可以留博客链接

image.png

链接

体验地址

结语

这样一些希望能有完整的文章管理权而自建博客的用户也可以接入Fan票生态了。这种方案的中心化程度比较高,不过个人认为先小规模使用Fan票,熟悉之后再用【Fan票迁跃门】体验更进一步的去中心化也有其意义所在。

另一方面算是对Matataki和Fan票的关系的一种确认。这篇文章涉及到的应用场景和“在Matataki平台上写文章”没什么关系,只涉及到了Fan票相关的部分。也就是说这个基于Fan票打赏的博客也是Fan票宇宙的一部分,但和Matataki更像邻居(相当大程度是账号权限系统没分离,所以体感上都在Matataki的域名和页面的缘故)

理论上可以做到在web3层面开发直接对接Fan票的dAPP来为博客构建打赏方案,不过现在文档和工具都不完善,门槛还是过高了些,期待Matataki进一步发展后这方面能有所改善

Alice in Wonderland

The rabbit-hole went straight on like a tunnel for some way, and then dipped suddenly down, so suddenly that Alice had not a moment to think about stopping herself before she found herself falling down a very deep well.

Either the well was very deep, or she fell very slowly, for she had plenty of time as she went down to look about her and to wonder what was going to happen next. First, she tried to look down and make out what she was coming to, but it was too dark to see anything; then she looked at the sides of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a jar from one of the shelves as she passed; it was labelled ‘ORANGE MARMALADE’, but to her great disappointment it was empty: she did not like to drop the jar for fear of killing somebody, so managed to put it into one of the cupboards as she fell past it.

‘Well!’ thought Alice to herself, ‘after such a fall as this, I shall think nothing of tumbling down stairs! How brave they’ll all think me at home! Why, I wouldn’t say anything about it, even if I fell off the top of the house!’ (Which was very likely true.)

Down, down, down. Would the fall NEVER come to an end! ‘I wonder how many miles I’ve fallen by this time?’ she said aloud. ‘I must be getting somewhere near the centre of the earth. Let me see: that would be four thousand miles down, I think—’ (for, you see, Alice had learnt several things of this sort in her lessons in the schoolroom, and though this was not a VERY good opportunity for showing off her knowledge, as there was no one to listen to her, still it was good practice to say it over) ‘—yes, that’s about the right distance—but then I wonder what Latitude or Longitude I’ve got to?’ (Alice had no idea what Latitude was, or Longitude either, but thought they were nice grand words to say.)

Presently she began again. ‘I wonder if I shall fall right THROUGH the earth! How funny it’ll seem to come out among the people that walk with their heads downward! The Antipathies, I think—’ (she was rather glad there WAS no one listening, this time, as it didn’t sound at all the right word) ‘—but I shall have to ask them what the name of the country is, you know. Please, Ma’am, is this New Zealand or Australia?’ (and she tried to curtsey as she spoke—fancy CURTSEYING as you’re falling through the air! Do you think you could manage it?) ‘And what an ignorant little girl she’ll think me for asking! No, it’ll never do to ask: perhaps I shall see it written up somewhere.’

Down, down, down. There was nothing else to do, so Alice soon began talking again. ‘Dinah’ll miss me very much to-night, I should think!’ (Dinah was the cat.) ‘I hope they’ll remember her saucer of milk at tea-time. Dinah my dear! I wish you were down here with me! There are no mice in the air, I’m afraid, but you might catch a bat, and that’s very like a mouse, you know. But do cats eat bats, I wonder?’ And here Alice began to get rather sleepy, and went on saying to herself, in a dreamy sort of way, ‘Do cats eat bats? Do cats eat bats?’ and sometimes, ‘Do bats eat cats?’ for, you see, as she couldn’t answer either question, it didn’t much matter which way she put it. She felt that she was dozing off, and had just begun to dream that she was walking hand in hand with Dinah, and saying to her very earnestly, ‘Now, Dinah, tell me the truth: did you ever eat a bat?’ when suddenly, thump! thump! down she came upon a heap of sticks and dry leaves, and the fall was over.

Alice was not a bit hurt, and she jumped up on to her feet in a moment: she looked up, but it was all dark overhead; before her was another long passage, and the White Rabbit was still in sight, hurrying down it. There was not a moment to be lost: away went Alice like the wind, and was just in time to hear it say, as it turned a corner, 'Oh my ears and whiskers, how late it's getting!' She was close behind it when she turned the corner, but the Rabbit was no longer to be seen: she found herself in a long, low hall, which was lit up by a row of lamps hanging from the roof.

There were doors all round the hall, but they were all locked; and when Alice had been all the way down one side and up the other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again.

Source: https://www.cs.cmu.edu/~rgs/alice-I.html

Placeholder text by Fillerati. Photography by UNSPLASH.