Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zdying committed Sep 16, 2017
1 parent ea7a479 commit 966ed48
Show file tree
Hide file tree
Showing 254 changed files with 22,340 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,9 @@ typings/
# dotenv environment variables file
.env

# System
.DS_Store

# hexo
.deploy*/

38 changes: 38 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
title: hiproxy
subtitle: "A lightweight and powerful proxy tool for front-end developer based on Node.js."
description: "hiproxy is a lightweight proxy tool for Front-End developers based on Node.js that supports an NGINX-like configuration."
author: hiproxy
language: en
timezone: UTC

url: http://hiproxy.org/
root: /
permalink: :title/
archive_dir: news
code_dir: downloads/code
new_post_name: :title.md # File name of new posts
post_asset_folder: false
per_page: 0
default_layout: page

theme: navy
deploy:
type: git
repo: https://github.com/hiproxy/documentation.git
branch: gh-pages

highlight:
enable: true
line_number: true

# disqus_shortname: hiproxy
google_analytics: UA-103231920-1
# algolia:
# en:
# api_key:
# index_name: hiproxy
# zh-cn:
# api_key:
# index_name: hiproxy_zh-cn
twitter: zhangdaiying
github: hiproxy/hiproxy
1 change: 1 addition & 0 deletions db.json

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
'use strict';

var gulp = require('gulp');
var gulpIf = require('gulp-if');
var gulpRev = require('gulp-rev');
var gulpRevCollector = require('gulp-rev-collector');
var gulpRevReplace = require('gulp-rev-replace');
var gulpUglify = require('gulp-uglify');
var gulpUniqueFiles = require('gulp-unique-files');
var gulpUseRef = require('gulp-useref');
var gulpCleanCSS = require('gulp-clean-css');
var gulpResponsive = require('gulp-responsive');
var gulpCheerio = require('gulp-cheerio');
var del = require('del');
var rename = require('rename');

var dirs = {
public: 'public',
screenshots: 'public/build/screenshots'
};

gulp.task('useref', ['screenshot'], function() {
var assets = gulpUseRef.assets({
searchPath: 'public'
});

return gulp.src('public/**/*.html')
.pipe(assets)
.pipe(gulpUniqueFiles())
.pipe(gulpIf('*.css', gulpCleanCSS()))
.pipe(gulpIf('*.js', gulpUglify()))
.pipe(gulpRev())
.pipe(assets.restore())
.pipe(gulpUseRef())
.pipe(gulpRevReplace({
prefix: '/'
}))
.pipe(gulp.dest('public'));
});

gulp.task('screenshot:clean', function() {
return del([dirs.screenshots + '/**/*']);
});

gulp.task('screenshot:rev', ['screenshot:clean'], function() {
return gulp.src('public/themes/screenshots/*.png')
.pipe(gulpRev())
.pipe(gulp.dest(dirs.screenshots))
.pipe(gulpRev.manifest())
.pipe(gulp.dest(dirs.screenshots));
});

gulp.task('screenshot:revreplace', ['screenshot:rev'], function() {
var destDir = '/build/screenshots';

return gulp.src([dirs.screenshots + '/rev-manifest.json', 'public/themes/index.html'])
.pipe(gulpRevCollector({
replaceReved: true,
dirReplacements: {
'/themes/screenshots': destDir
}
}))
.pipe(gulpCheerio(function($, file) {
$('img.plugin-screenshot-img.lazyload').each(function() {
var img = $(this);
var src = img.attr('data-src') || img.attr('data-org');
if (!src) return;

var jpgPath = replaceBackSlash(rename(src, {extname: '.jpg'}));
var jpg2xPath = replaceBackSlash(rename(jpgPath, {suffix: '@2x'}));
var srcset = [
jpgPath,
jpg2xPath + ' 2x'
].join(', ');

img.attr('data-src', jpgPath)
.attr('data-srcset', srcset)
.attr('data-org', src);
});
}))
.pipe(gulp.dest('public/themes'));
});

gulp.task('screenshot:resize', ['screenshot:rev'], function() {
return gulp.src(dirs.screenshots + '/*.png')
.pipe(gulpResponsive({
'*.png': [
{
width: '50%',
rename: {
extname: '.jpg'
}
},
{
rename: {
suffix: '@2x',
extname: '.jpg'
}
}
]
}, {
progressive: true,
format: 'jpeg',
quality: 70,
stats: false
}))
.pipe(gulp.dest(dirs.screenshots));
});

gulp.task('screenshot', ['screenshot:rev', 'screenshot:resize', 'screenshot:revreplace']);
gulp.task('default', ['useref', 'screenshot']);

function replaceBackSlash(str) {
return str.replace(/\\/g, '/');
}
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.3.9"
},
"scripts": {
"build": "hexo generate && gulp",
"eslint": "eslint .",
"deploy": "hexo deploy"
},
"dependencies": {
"hexo": "^3.3.9",
"hexo-deployer-git": "^0.3.1",
"hexo-generator-archive": "^0.1.4",
"hexo-generator-feed": "^1.1.0",
"hexo-generator-sitemap": "^1.1.2",
"hexo-renderer-jade": "^0.4.1",
"hexo-renderer-marked": "^0.2.10",
"hexo-renderer-stylus": "^0.3.1",
"hexo-server": "^0.2.0",
"lodash": "^4.5.1",
"lunr": "^2.1.2"
},
"devDependencies": {}
}
148 changes: 148 additions & 0 deletions public/2014-07-13-test/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>test | hiproxy</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Canonical links -->
<link rel="canonical" href="http://hiproxy.org/2014-07-13-test/index.html">
<!-- Alternative links -->

<!-- Icon -->
<link rel="icon" type="image/png" href="/icons/favicon-196x196.png" sizes="196x196">
<link rel="icon" type="image/png" href="/icons/favicon-160x160.png" sizes="160x160">
<link rel="icon" type="image/png" href="/icons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/icons/favicon-16x16.png" sizes="16x16">
<link rel="icon" type="image/png" href="/icons/favicon-32x32.png" sizes="32x32">
<link rel="apple-touch-icon" sizes="76x76" href="/icons/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="120x120" href="/icons/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/icons/apple-touch-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon-180x180.png" />
<link rel="apple-touch-icon" sizes="58x58" href="/icons/android-touch-icon.png" />
<!-- CSS -->
<!-- build:css build/css/navy.css -->
<link rel="stylesheet" href="/css/navy.css">
<!-- endbuild -->
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css">
<!-- RSS -->
<link rel="alternate" href="/atom.xml" title="hiproxy">
<!-- Google Analytics -->

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-103231920-1', 'auto');
ga('send', 'pageview');
</script>

</head>

<body>
<div id="container">
<header id="header" class="wrapper">
<div id="header-inner" class="inner">
<h1 id="logo-wrap">
<a href="/" id="logo">hiproxy</a>
</h1>
<nav id="main-nav">
<a href="/" class="main-nav-link">Home</a><a href="/get_started/" class="main-nav-link">Get Started</a><a href="/configuration/" class="main-nav-link">Configuration</a><a href="/rewrite/" class="main-nav-link">Rewrite</a><a href="/api/" class="main-nav-link">API</a><a href="/developers/" class="main-nav-link">Developers</a><a href="/faqs/" class="main-nav-link">FAQs</a>
<a href="https://github.com/hiproxy/hiproxy" class="main-nav-link"><i class="fa fa-github-alt"></i></a>
<div id="search-input-wrap">
<div id="search-input-icon">
<i class="fa fa-search"></i>
</div>
<input type="search" id="search-input" placeholder="Search...">
</div>
</nav>
<div id="lang-select-wrap">
<label id="lang-select-label"><i class="fa fa-globe"></i><span>English</span></label>
<select id="lang-select" data-canonical="2014-07-13-test/index.html">

<option value="zh-cn">简体中文</option>

<option value="en" selected>English</option>

</select>
</div>
<a id="mobile-nav-toggle">
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
<span class="mobile-nav-toggle-bar"></span>
</a>
</div>
</header>

<div id="content-wrap">
<div class="wrapper">
<div class="inner">
<article class="article post" itemscope itemtype="http://schema.org/Article">
<header class="article-header">

<h1 class="article-title" itemprop="name">test</h1>

<a href="/2014-07-13-test/" class="article-date"><time datetime="2017-09-15T13:21:42.000Z">2017-09-15</time></a>
</header>
<div class="article-content" itemprop="articleBody">
<p>Test</p>

</div>

</article>

</div>
</div>
</div>
<footer id="footer" class="wrapper">
<div class="inner">
<div id="footer-copyright">
&copy; 2017 <a href="https://github.com/hiproxy/hiproxy/graphs/contributors" target="_blank">hiproxy</a><br>
Documentation licensed under <a href="http://creativecommons.org/licenses/by/4.0/" target="_blank">CC BY 4.0</a>.
</div>
<div id="footer-links">
<a href="https://twitter.com/zhangdaiying" class="footer-link" target="_blank"><i class="fa fa-twitter"></i></a>
<a href="https://github.com/hiproxy/hiproxy" class="footer-link" target="_blank"><i class="fa fa-github-alt"></i></a>
</div>
</div>
</footer>

</div>
<div id="mobile-nav-dimmer"></div>
<nav id="mobile-nav">
<div id="mobile-nav-inner">
<ul id="mobile-nav-list">
<a href="/" class="mobile-nav-link">Home</a><a href="/get_started/" class="mobile-nav-link">Get Started</a><a href="/configuration/" class="mobile-nav-link">Configuration</a><a href="/rewrite/" class="mobile-nav-link">Rewrite</a><a href="/api/" class="mobile-nav-link">API</a><a href="/developers/" class="mobile-nav-link">Developers</a><a href="/faqs/" class="mobile-nav-link">FAQs</a>
<li class="mobile-nav-item">
<a href="https://github.com/hiproxy/hiproxy" class="mobile-nav-link" rel="external" target="_blank">GitHub</a>
</li>
</ul>

</div>
<div id="mobile-lang-select-wrap">
<span id="mobile-lang-select-label"><i class="fa fa-globe"></i><span>English</span></span>
<select id="mobile-lang-select" data-canonical="2014-07-13-test/index.html">

<option value="zh-cn">简体中文</option>

<option value="en" selected>English</option>

</select>
</div>
</nav>
<!-- Scripts -->
<!-- build:js build/js/main.js -->
<script src="/js/lang_select.js"></script>
<script src="/js/toc.js"></script>
<script src="/js/mobile_nav.js"></script>
<!-- endbuild -->

<!-- Algolia -->


</body>
</html>
1 change: 1 addition & 0 deletions public/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hiproxy.js.org
Loading

0 comments on commit 966ed48

Please sign in to comment.