V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
kmahyyg
V2EX  ›  问与答

问几个 GitHub pages 和 hexo 的问题

  •  
  •   kmahyyg · 2016-05-27 15:23:06 +08:00 via Android · 1585 次点击
    这是一个创建于 2950 天前的主题,其中的信息可能已经有所发展或是发生改变。
    Rt
    1.如何让 hex 使用本地图片?不想用 CDN 和图床。
    2.有什么办法访问 用户名.GitHub.io 时强制客户端使用 HTTPS 吗?

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

    [reference]( http://www.tuicool.com/articles/umEBVfI )
    kawaiiushio
        1
    kawaiiushio  
       2016-05-28 00:31:39 +08:00
    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
       2016-05-28 17:11:59 +08:00 via Android
    thanks @kawaiiushio
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3080 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 11:54 · PVG 19:54 · LAX 04:54 · JFK 07:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.