Skip to content

Commit

Permalink
[docs] Use package-based Hexo theme, rather than a Git submodule. (#500)
Browse files Browse the repository at this point in the history
* docs: Use `devDependencies` instead of `dependencies`.

It's safe to mark all dependencies of this theme as 'dev' dependencies, as
none of them are needed to be installed in a production setting.

This was done automatically, so in some cases, this merges existing
`devDependencies`, and may also have added a missing `nodemon` `devDependency`
in cases where it was missing.  In other cases, this commit may not have
made such a change.

* docs: Remove _config.yml options now covered by global theme config.

* docs: Add `db.json` to docs `.gitignore`.

This file is an artifact of docs generation which need not be committed.

* docs: Add `_multiconfig.yml`, a build artifact, to docs `.gitignore`.

* docs: Use theme from npm, rather than submodule, using `chexo`.

The theme which the docs in this repository are based on
([`hexo-theme-meteor`](https://github.com/meteor/hexo-theme-meteor)) has been
published to npm.

Additionally, most of the configuration which was once present in this
repository's `_config.yml` file, has been moved into an Apollo-centric theme
configuration npm,
[`apollo-hexo-config`](https://www.npmjs.com/package/apollo-hexo-config) (and
similarly, [GitHub](https://github.com/apollographql/apollo-hexo-config)).

The theme bundled in this npm is a converged version of the two `apollo`
and `master` branches on the `hexo-theme-meteor` repository, which is a result
of the work undertaken in meteor/meteor-theme-hexo#51.

Lastly, this makes use of a new `chexo` npm which acts as a wrapper for `hexo`
but permits the use of an inherited configuration from npm, rather than a
statically defined CLI file parameter (previously with `--config a,b`).

* docs: Upgrade Hexo to 3.6.0.

* docs: Upgrade Hexo generator/tag/server dependencies.

* docs: Add Renovate configuration.

While some repositories which host Hexo docs alongside other code may not have
Renovate setup, it's anticipated that they will in the future, at the very
least for the docs portions of the respective repositories.

By having this `renovate` section in the `package.json` for the Hexo docs, we
can ensure that they will receive the proper treatment and minimize the amount
of manual work necessary on those repositories.

Additionally, this ensures that there is a single point of upstream Apollo-docs
Renovate configuration through the use of the
[`renovate-config-apollo-docs`](https://npm.im/renovate-config-apollo-docs)
package, which inherits further from
[`renovate-config-mdg-docs`](https://npm.im/renovate-config-mdg-docs).

Repositories which already have Renovate setup should benefit automatically
from this new docs-specific configuration.
  • Loading branch information
abernix authored Mar 16, 2018
1 parent f835a3e commit 6aa39e9
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 87 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
db.json
_multiconfig.yml
2 changes: 0 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
To run:

```
git submodule init
git submodule update
npm install
npm start
```
72 changes: 1 addition & 71 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# Hexo Configuration
## Docs: http://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: Apollo Angular
propertytitle: Using GraphQL in Angular
subtitle: Angular Guide
description: A guide to using the Apollo GraphQL Client with Angular.
author:
language:
timezone:
versions:
- '1'

Expand Down Expand Up @@ -48,71 +40,9 @@ sidebar_categories:
github_repo: apollographql/apollo-angular
content_root: docs/source

social_links:
github: 'https://github.com/apollographql'
twitter: '@apollographql'

# API keys
apis:
segment: wgrIo8Bul0Ujl8USETG3DB6hONdy4kTg
gtm: GTM-PNFDVBB

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://www.apollographql.com/docs/angular
root: /docs/angular/
permalink: :year/:month/:day/:title/
permalink_defaults:

# Directory
source_dir: source
public_dir: public/docs/angular
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link: true # Open external links in new tab
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: true
tab_replace:

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Extensions
## Plugins: http://hexo.io/plugins/
## Themes: http://hexo.io/themes/
theme: meteor

# Deployment
## Docs: http://hexo.io/docs/deployment.html
deploy:
type:
public_dir: public/docs/angular
22 changes: 15 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,34 @@
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.5.0"
"version": "3.6.0"
},
"dependencies": {
"devDependencies": {
"apollo-hexo-config": "^1.0.2",
"chexo": "^1.0.4",
"handlebars": "^4.0.5",
"hexo": "3.5.0",
"hexo": "3.6.0",
"hexo-generator-archive": "0.1.5",
"hexo-generator-category": "^0.1.2",
"hexo-generator-category": "0.1.3",
"hexo-generator-index": "0.2.1",
"hexo-generator-tag": "0.2.0",
"hexo-renderer-ejs": "0.3.1",
"hexo-renderer-less": "^0.2.0",
"hexo-renderer-less": "0.2.0",
"hexo-renderer-marked": "0.3.2",
"hexo-server": "0.3.1",
"lodash": "^4.13.1",
"meteor-theme-hexo": "^1.0.1",
"showdown": "^1.4.2"
},
"scripts": {
"start": "hexo serve",
"build": "hexo generate",
"start": "npm run build && chexo apollo-hexo-config -- server",
"build": "chexo apollo-hexo-config -- generate",
"clean": "hexo clean",
"test": "npm run clean; npm run build"
},
"renovate": {
"extends": [
"apollo-docs"
]
}
}
1 change: 0 additions & 1 deletion docs/themes/meteor
Submodule meteor deleted from f2e7d6

0 comments on commit 6aa39e9

Please sign in to comment.