Skip to content

Commit 9e87f46

Browse files
committed
chore: sync template from mainstream
1 parent 27bf07b commit 9e87f46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+481
-384
lines changed

3.1-billion-in-a-day.html

+3-3
Large diffs are not rendered by default.

404.html

+3-3
Large diffs are not rendered by default.

7-zip-portable.html

+3-3
Large diffs are not rendered by default.

7zip-sourceforge-cca07.html

+3-3
Large diffs are not rendered by default.

_amsf/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,6 @@ bower_components
3535
# Project specified
3636
_site
3737
_app/assets/css
38+
39+
# Uncomment the following if you want to gitignore current user config
40+
# _config.yml

_amsf/Gruntfile.coffee

+52-35
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = (grunt) ->
1111
grunt.initConfig
1212
config:
1313
cfg: grunt.file.readYAML("_config.yml")
14-
var: grunt.file.readYAML("./_app/_data/var.yml")
1514
pkg: grunt.file.readJSON("package.json")
1615
app: "<%= config.cfg.source %>"
1716
dist: "<%= config.cfg.destination %>"
@@ -105,6 +104,7 @@ module.exports = (grunt) ->
105104
removeCommentsFromCDATA: true
106105
removeCDATASectionsFromCDATA: true
107106
collapseWhitespace: true
107+
conservativeCollapse: true
108108
collapseBooleanAttributes: true
109109
removeAttributeQuotes: false
110110
removeRedundantAttributes: true
@@ -198,19 +198,19 @@ module.exports = (grunt) ->
198198
stdout: true
199199

200200
server:
201-
command: "jekyll serve --watch --future"
201+
command: "jekyll serve --watch --future --drafts --config _config.yml,_config.dev.yml"
202202

203203
dist:
204204
command: "jekyll build"
205205

206206
archive:
207-
command: "jekyll build -d <%= config.cfg.destination %><%= config.var.base %>/"
207+
command: "jekyll build -d <%= config.cfg.destination %><%= config.cfg.base %>/"
208208

209209
sync:
210-
command: "rsync -avz --delete --progress <%= config.var.ignore_files %> <%= config.dist %>/ <%= config.var.remote_host %>:<%= config.var.remote_dir %> > rsync.log"
210+
command: "rsync -avz --delete --progress <%= config.cfg.ignore_files %> <%= config.dist %>/ <%= config.cfg.remote_host %>:<%= config.cfg.remote_dir %> > rsync.log"
211211

212212
s3:
213-
command: "s3cmd sync -rP --guess-mime-type --delete-removed --no-preserve --cf-invalidate --exclude '.DS_Store' <%= config.var.static_files %> <%= config.var.s3_bucket %>"
213+
command: "s3cmd sync -rP --guess-mime-type --delete-removed --no-preserve --cf-invalidate --exclude '.DS_Store' <%= config.cfg.static_files %> <%= config.cfg.s3_bucket %>"
214214

215215
concurrent:
216216
options:
@@ -233,7 +233,6 @@ module.exports = (grunt) ->
233233
dist:
234234
src: [
235235
".tmp"
236-
"<%= config.dist %>"
237236
]
238237

239238
postDist:
@@ -246,39 +245,56 @@ module.exports = (grunt) ->
246245
dist:
247246
src: ["<%= config.dist %>/**/*"]
248247

249-
# Fire up a server on local machine for development
250-
grunt.registerTask "serve", [
248+
replace:
249+
availability:
250+
src: ["<%= config.app %>/_data/availability.yml"]
251+
dest: "<%= config.app %>/_data/availability.yml"
252+
replacements: [
253+
{
254+
from: /(free:)(.+)/g
255+
to: "$1 true"
256+
}
257+
]
258+
259+
grunt.registerTask "reset", "Reset user availability", (target) ->
260+
grunt.config.set "replace.availability.replacements.0.to", "$1 true"
261+
grunt.task.run [
262+
"replace"
263+
]
264+
265+
grunt.registerTask "serve", "Fire up a server on local machine for development", [
251266
"clean"
252267
"less:server"
253268
"concurrent:server"
254269
]
255270

256-
# Test task
257-
grunt.registerTask "test", [
271+
grunt.registerTask "test", "Build test task", [
258272
"build"
259273
# "csslint"
260274
"validation"
261275
]
262276

263-
# Build site with `jekyll`
264-
grunt.registerTask "build", [
265-
"clean"
266-
"coffeelint"
267-
"useminPrepare"
268-
"less:dist"
269-
"autoprefixer"
270-
"csscomb"
271-
"shell:dist"
272-
"rev"
273-
"usemin"
274-
"concurrent:dist"
275-
"smoosher"
276-
"usebanner"
277-
"clean:postDist"
278-
]
279-
280-
# Archive old version with specific URL prefix, all old versions goes to http://sparanoid.com/lab/version/
281-
grunt.registerTask "archive", [
277+
grunt.registerTask "build", "Build site with `jekyll`, use `--busy` to set availability to false", (target) ->
278+
grunt.config.set "replace.availability.replacements.0.to", "$1 false" if grunt.option("busy")
279+
grunt.task.run [
280+
"replace"
281+
"clean"
282+
"coffeelint"
283+
"useminPrepare"
284+
"less:dist"
285+
"autoprefixer"
286+
"csscomb"
287+
"shell:dist"
288+
"rev"
289+
"usemin"
290+
"concurrent:dist"
291+
"smoosher"
292+
"usebanner"
293+
"clean:postDist"
294+
"reset"
295+
]
296+
297+
grunt.registerTask "archive", "Archive old version with specific URL prefix, all old versions goes to http://sparanoid.com/lab/version/", [
282298
"clean"
283299
"less:dist"
284300
"autoprefixer"
@@ -287,14 +303,15 @@ module.exports = (grunt) ->
287303
"concurrent:dist"
288304
]
289305

290-
# Build site + rsync static files to remote server
291-
grunt.registerTask "sync", [
306+
grunt.registerTask "sync", "Build site + rsync static files to remote server", [
292307
"build"
293308
"shell:sync"
294309
]
295310

296-
# Sync image assets with `s3cmd`
297-
grunt.registerTask "s3", ["shell:s3"]
311+
grunt.registerTask "s3", "Sync image assets with `s3cmd`", [
312+
"shell:s3"
313+
]
298314

299-
# Default task aka. build task
300-
grunt.registerTask "default", ["build"]
315+
grunt.registerTask "default", "Default task aka. build task", [
316+
"build"
317+
]

_amsf/README.md

+14-31
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,24 @@
77

88
**Table of Contents**
99

10-
- [Features](#c1)
11-
- [Setup](#c2)
12-
- [Managing Media](#c3)
13-
- [Upgrading](#c4)
14-
- [Tips](#c5)
15-
- [Avaiable Styles](#c6)
16-
- [`.note`, `.store`, and `.download`](#c6-1)
17-
- [`.browser`](#c6-2)
18-
- [`.largetype`](#c6-3)
19-
- [Avaiable Settings](#c7)
20-
- [Demo](#c8)
21-
- [GitHub Pages Setup Guide](#c9)
22-
- [The Problem](#c9-1)
23-
- [The Solution](#c9-2)
10+
- [Features](#features)
11+
- [Setup](#setup)
12+
- [Managing Media](#managing-media)
13+
- [Upgrading](#upgrading)
14+
- [Tips](#tips)
15+
- [Avaiable Styles](#avaiable-styles)
16+
- [`.note`, `.store`, and `.download`](#note-store-and-download)
17+
- [`.browser`](#browser)
18+
- [`.largetype`](#largetype)
19+
- [Avaiable Settings](#avaiable-settings)
20+
- [Demo](#demo)
21+
- [GitHub Pages Setup Guide](#github-pages-setup-guide)
22+
- [The Problem](#the-problem)
23+
- [The Solution](#the-solution)
2424
- [Donate](#donate)
2525
- [Author](#author)
2626
- [Licenses](#licenses)
2727

28-
<a name="c1"></a>
2928
## Features
3029

3130
- **Almace Scaffolding** ships a sleek responsive theme, a variant of [sparanoid.com](http://sparanoid.com/), looking great on any mordern browsers
@@ -50,7 +49,6 @@
5049

5150
*: Well, only when your posts don’t have fancy sliders or other external media files.
5251

53-
<a name="c2"></a>
5452
## Setup
5553

5654
1. [Fork](https://github.com/sparanoid/almace-scaffolding/fork) this project, checkout to your local machine.
@@ -60,7 +58,6 @@
6058

6159
Still can't get things working? Why not try my [video tutorials](http://www.youtube.com/watch?v=5NV6Rdv1a3I).
6260

63-
<a name="c3"></a>
6461
## Managing Media
6562

6663
Media files are located in `./assets/` and grouped by different formats:
@@ -72,12 +69,10 @@ Media files are located in `./assets/` and grouped by different formats:
7269
- `./js/`: JavaScript files, put all needed sctipts in this directoy will just work fine. I don't expect to have many scripts so no complex `vender`, `lib`, or other fancy structures used for this project.
7370
- `./svg/`: The same as `./img/`.
7471

75-
<a name="c4"></a>
7672
## Upgrading
7773

7874
Upgrading templates is hard, it will be easy if you are're a casual blogger and keep every template file untouched. Just copy and paste all template files in `_assets`, `_includes`, and `_layouts`. If you change the templates directly, you have to compare them side to side.
7975

80-
<a name="c5"></a>
8176
## Tips
8277

8378
- Additional variables are stored in [`./_app/_data/`](/_app/_data) directory. They can be accessed by Jekyll. ([More info](http://jekyllrb.com/docs/datafiles/))
@@ -88,12 +83,10 @@ Upgrading templates is hard, it will be easy if you are're a casual blogger and
8883
- Customize your site using `custom.less`.
8984
- Some tasks in `Gruntfile.coffee` are not used in this project, they're copied from my own [website](https://github.com/sparanoid/sparanoid.com), I'll keep them untouched in case you need these.
9085

91-
<a name="c6"></a>
9286
## Avaiable Styles
9387

9488
I've written some useful CSS classes for you, see below:
9589

96-
<a name="c6-1"></a>
9790
### `.note`, `.store`, and `.download`
9891

9992
A paragraph block with a thin border line.
@@ -110,7 +103,6 @@ Usage:
110103
</p>
111104
```
112105

113-
<a name="c6-2"></a>
114106
### `.browser`
115107

116108
A simple browser frame using pure CSS.
@@ -123,7 +115,6 @@ Usage:
123115
</p>
124116
```
125117

126-
<a name="c6-3"></a>
127118
### `.largetype`
128119

129120
Make normal paragraph text large enough.
@@ -136,22 +127,18 @@ Usage:
136127
</p>
137128
```
138129

139-
<a name="c7"></a>
140130
## Avaiable Settings
141131

142132
All custom settings can be configured at [`_app/_data/var.yml`](_app/_data/var.yml), it's well commented so you should really check it out.
143133

144-
<a name="c8"></a>
145134
## Demo
146135

147136
Live demo available at [amsf.github.io](http://amsf.github.io/)
148137

149138
You can also see a more complex live demo using this framework at [my site](http://sparanoid.com/).
150139

151-
<a name="c9"></a>
152140
## GitHub Pages Setup Guide
153141

154-
<a name="c9-1"></a>
155142
### The Problem
156143

157144
Unfortunately this project doesn't work with GitHub Pages or GitHub Pages for projects. There're some factors that prevent it from generating pages:
@@ -160,7 +147,6 @@ Unfortunately this project doesn't work with GitHub Pages or GitHub Pages for pr
160147
- Almace Scaffolding uses the latest pre-release Jekyll, so not all features are supported by GitHub Pages renderers.
161148
- GItHub Pages build server [overwrites the `source` settings](https://help.github.com/articles/pages-don-t-build-unable-to-run-jekyll#source-setting). This prevent it generating pages from current file structure.
162149

163-
<a name="c9-2"></a>
164150
### The Solution
165151

166152
I know this can be tricky and more verbose than uploading your Jekyll site directly to your repository. However GitHub Pages support static HTML pages, a workaround solution for using Almace Scaffolding on GitHub Pages is treating your Jekyll site as static pages:
@@ -176,20 +162,17 @@ If you'd like to keep all things under Git control, you can try the following fi
176162

177163
You can see this [live demo](http://github.com/amsf/amsf.github.io/) how to make them friends.
178164

179-
<a name="donate"></a>
180165
## Donate
181166

182167
Wanna buy me a cup of coffee? [Great](http://sparanoid.com/donate/).
183168

184-
<a name="author"></a>
185169
## Author
186170

187171
**Tunghsiao Liu**
188172

189173
- Twitter: @[tunghsiao](http://twitter.com/tunghsiao)
190174
- GitHub: @[sparanoid](http://github.com/sparanoid)
191175

192-
<a name="licenses"></a>
193176
## Licenses
194177

195178
Following files, directories and their contents are copyright Tunghsiao Liu and licensed under a [CC BY-NC-ND 3.0](http://creativecommons.org/licenses/by-nc-nd/3.0/). You may not reuse anything therein without permission:

_amsf/_app/_data/var.yml

-89
This file was deleted.

0 commit comments

Comments
 (0)