适用情况
按文档部署的,没用docker。用docker的可以参考这位。
嘟文字数修改
- 以mastodon用户(如果当初是按文档建在mastodon用户下的话)进入
live
:su - mastodon
cd live
- 编辑
status_length_validator.rb
:nano app/validators/status_length_validator.rb
- 将
MAX_CHARS = 500
改成想要的字数,并保存
- 编译前端
RAILS_ENV=production bundle exec rails assets:precompile
- 重启
su -
systemctl restart mastodon-web mastodon-sidekiq mastodon-streaming
长嘟文折叠
-
同以上1
-
编辑
mastodon-light.scss
(也可能是mastodon.scss
)-
cd app/javascript/styles
-
nano mastodon-light.scss
-
添加以下代码并保存
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
.status__content { max-height: 250px; /* 设置最大高度,可调整,我决定250或者300就挺好 */ overflow: hidden; position: relative; } .status__content::after { content: '... 点击展开'; display: block; text-align: center; background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0)); position: absolute; bottom: 0; width: 100%; height: 30px; line-height: 30px; cursor: pointer; } .status__content.expanded { max-height: none; }
-
-
同上。
-
同上。