kmahyyg
V2EX  ›  问与答

问几个 GitHub pages 和 hexo 的问题

  •  
  •   kmahyyg · May 27, 2016 via Android · 1995 views
    This topic created in 3696 days ago, the information mentioned may be changed or developed.
    Rt
    1.如何让 hex 使用本地图片?不想用 CDN 和图床。
    2.有什么办法访问 用户名.GitHub.io 时强制客户端使用 HTTPS 吗?

    下方是查到的教程,并没看懂
    本地是 win7 msysgit nodeJs

    [reference]( http://www.tuicool.com/articles/umEBVfI )
    kawaiiushio
        1
    kawaiiushio  
       May 28, 2016
    1./theme/你用的主題文件夾 /source 下面新建個文件夾並重命名為 img
    那麼 img 文件夾下的圖片文件 url 會是 {yourdomain}/img/xxx.{jpg|png|gif|etc...}

    2.如果是跳轉 https://{githubusername}.github.io 你可以使用 js

    <script>
    var url = window.location.href;
    if (url.indexOf("https") < 0) {
    url = url.replace("http:", "https:");
    window.location.replace(url);
    }
    </script>

    如果是跳轉自有域名 https 免費的你可以使用 kloudsec 收費的自己買 vps 或者其他方式
    kmahyyg
        2
    kmahyyg  
    OP
       May 28, 2016 via Android
    thanks @kawaiiushio
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2815 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 14:51 · PVG 22:51 · LAX 07:51 · JFK 10:51
    ♥ Do have faith in what you're doing.