Mastodon-Material

Material Design Native Theme for Mastodon
授权协议 AGPL-3.0 License
开发语言 Java
所属分类 手机/移动开发、 Android UI 组件
软件类型 开源软件
地区 不详
投 递 者 赖翰
操作系统 Android
开源组织
适用人群 未知
 软件概览

Mastodon Material

Language | 言語

日本語 (Japanese)

Overview

Mastodon Material is the native theme for Mastodon, which based on Material Design. Development policy is here (Japanese).

Screenshots

show/hide

v1-light + material-v1

v1-dark + material-v1

black + material-v1

v2-light + material-v2

v2-dark + material-v2

mastodon-light + material-v1

mastodon-dark + material-v1

Requirement

How to install

  1. Copy these files of this repository into app/javascript/styles of Mastodon source directory.

    • /src/mastodon-material/
    • /src/mastodon-material.scss
  2. Add the below code on config/themes.yml

    default: styles/application.scss
    contrast: styles/contrast.scss
    mastodon-light: styles/mastodon-light.scss
    
    # Added theme
    mastodon-material: styles/mastodon-material.scss # add this line
  3. If you want to change the display theme name in your language, add localization strings to config/locales/{lang}.yml like below (At least config/locales/en.yml is REQUIRED)

    themes:
     contrast: High contrast
     default: Mastodon
     mastodon-light: Mastodon (light)
    
     # Added theme
     mastodon-material: Mastodon Material # add this line
  4. If you configure to use the webfont on Google Fonts (default) or on GitHub, you need to add an exception to CSP (Content Security Policy). Make sure to change config/initializers/content_security_policy.rb :

    def host_to_url(str)
     "http#{Rails.configuration.x.use_https ? 's' : ''}://#{str}" unless str.blank?
    end
    base_host = Rails.configuration.x.web_domain
    assets_host = Rails.configuration.action_controller.asset_host
    assets_host ||= host_to_url(base_host)
    media_host = host_to_url(ENV['S3_ALIAS_HOST'])
    media_host ||= host_to_url(ENV['S3_CLOUDFRONT_HOST'])
    media_host ||= host_to_url(ENV['S3_HOSTNAME']) if ENV['S3_ENABLED'] == 'true'
    media_host ||= assets_host
    Rails.application.config.content_security_policy do |p|
     p.base_uri :none
     p.default_src :none
     p.frame_ancestors :none
     p.font_src :self, assets_host
     p.img_src :self, :https, :data, :blob, assets_host
     p.style_src :self, :unsafe_inline, assets_host
     p.media_src :self, :https, :data, assets_host
     p.frame_src :self, :https
     p.manifest_src :self, assets_host

    into

    def host_to_url(str)
     "http#{Rails.configuration.x.use_https ? 's' : ''}://#{str}" unless str.blank?
    end
    base_host = Rails.configuration.x.web_domain
    assets_host = Rails.configuration.action_controller.asset_host
    assets_host ||= host_to_url(base_host)
    media_host = host_to_url(ENV['S3_ALIAS_HOST'])
    media_host ||= host_to_url(ENV['S3_CLOUDFRONT_HOST'])
    media_host ||= host_to_url(ENV['S3_HOSTNAME']) if ENV['S3_ENABLED'] == 'true'
    media_host ||= assets_host
    
    # custom host
    github_host = "https://raw.githubusercontent.com" # GitHub
    google_fonts_host = "https://fonts.gstatic.com" # Google Fonts
    
    Rails.application.config.content_security_policy do |p|
     p.base_uri :none
     p.default_src :none
     p.frame_ancestors :none
     p.font_src :self, assets_host, github_host, google_fonts_host
     p.img_src :self, :https, :data, :blob, assets_host
     p.style_src :self, :unsafe_inline, assets_host
     p.media_src :self, :https, :data, assets_host
     p.frame_src :self, :https
     p.manifest_src :self, assets_host

    Diff

    def host_to_url(str)
     "http#{Rails.configuration.x.use_https ? 's' : ''}://#{str}" unless str.blank?
    end
    base_host = Rails.configuration.x.web_domain
    assets_host = Rails.configuration.action_controller.asset_host
    assets_host ||= host_to_url(base_host)
    media_host = host_to_url(ENV['S3_ALIAS_HOST'])
    media_host ||= host_to_url(ENV['S3_CLOUDFRONT_HOST'])
    media_host ||= host_to_url(ENV['S3_HOSTNAME']) if ENV['S3_ENABLED'] == 'true'
    media_host ||= assets_host
    
    + # custom host
    + github_host = "https://raw.githubusercontent.com" # GitHub
    + google_fonts_host = "https://fonts.gstatic.com" # Google Fonts
    
    Rails.application.config.content_security_policy do |p|
     p.base_uri :none
     p.default_src :none
     p.frame_ancestors :none
    - p.font_src :self, assets_host
    + p.font_src :self, assets_host, github_host, google_fonts_host
     p.img_src :self, :https, :data, :blob, assets_host
     p.style_src :self, :unsafe_inline, assets_host
     p.media_src :self, :https, :data, assets_host
     p.frame_src :self, :https
     p.manifest_src :self, assets_host

Customization

Customization Guide

Stylus/Stylish theme

You can use our theme on any server by the browser extension, Stylus or Stylish.

License

This theme and the Stylish/Stylus theme can be used under AGPL-3.0. Material Icons font is available under Apache license version 2.0. (This repository does not include Material Icons font.)

The header image was made by using Noto Sans and mastodon.privacyfilter.user.styl.

 相关资料
  • Mastodon 是开源且免费的社交网络服务器,任何人都可以基于它创建类似推特/微博的产品(可以理解为搭建“私服微博/推特”)。但 Mastodon 与常见的社交网络不一样,其定位是去中心化的社交平台——可作为商业平台的替代方案,避免了单个公司垄断你沟通的风险。 基于 Mastodon 搭建的站点被称为“实例 (instance)”,这些“实例”既相互独立,又彼此关联(因为不同站点的用户可以毫无阻

  • A bot posting the Hacker News stories with 100+ points to Mastodon. https://hackertribe.io/@HackerNewsBot Usage Create an account for the bot. For convenience you can use youremail+hnbot@gmail.com, to

  • Code has been removed, there is no more need for follow bots, just use a relay like https://relay.mastodon.host for example.

  • Mastodon Bot Bots Hagh Hagh reblogs certain toots to itself creating a Hagh page. Users from local instance are able to make a toot hagh. Setup Have go and GNUMake installed. Copy the env var sample a

  • mastodon-apod it's a mastodon bot that posts the most recent image from NASA's Astronomy Picture of the Day it uses ananas how to use (optional) create a venv to isolate dependencies from the system $

  • mastodon-terraform Boilerplate for running Mastodon on AWS using Terraform and CircleCI. ┌---------------┐| Web Browser |└---------------┘▲ ▲| |(HTTPS) (WSS)|