Skip to content

Commit 5517018

Browse files
committed
first commit
0 parents  commit 5517018

23 files changed

+14162
-0
lines changed

.eslintrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "apostrophe",
3+
"ignorePatterns": [
4+
"**/node_modules",
5+
"**/public/modules",
6+
"!/docs/**"
7+
]
8+
}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# ignore vim swapfiles
2+
*.swp
3+
*.DS_Store
4+
npm-debug.log
5+
node_modules

HOW_TO_UPDATE_THE_DOCUMENTATION.md

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# How to update Apostrophe CMS documentation
2+
========================
3+
4+
This project contains [the documentation site](https://docs.apostrophecms.com)
5+
for [ApostropheCMS](https://apostrophecms.com).
6+
7+
You don't need to read this page to read the documentation! [Read the
8+
actual documentation here.](https://docs.apostrophecms.com) This page
9+
is about *contributing to* the documentation.
10+
11+
## Building the docs
12+
13+
### 1. Setup
14+
15+
Clone the repo.
16+
17+
```sh
18+
$ git clone https://github.com/apostrophecms/apostrophe-documentation.git
19+
$ cd apostrophe-documentation
20+
```
21+
22+
Next, install the dependencies for the main Vuepress documentation as well as
23+
for the module documentation generator (see below). The `install` script file
24+
will do both with single command.
25+
26+
```
27+
./install
28+
```
29+
30+
### 2. Updating the modules documentation from the source code
31+
32+
The reference docs for the modules are based on comments inline in the code,
33+
which makes writing reference documentation easy and encourages us to do so.
34+
Comments above the module's source go into the `README.md` for the module's
35+
folder; comments above each method document that method. Helpers, routes and
36+
regular methods (`self.something = function()...`) are all automatically
37+
discovered. Frontend moog classes and methods, too.
38+
39+
Here's how to generate the docs:
40+
41+
> First make sure you are not running anything locally on port 3000.
42+
43+
```
44+
./generate
45+
```
46+
47+
NOTE: this will `npm update` the version of `apostrophe` being documented first, so the docs are always for the **latest published release**.
48+
49+
Now commit the changes, as you would if you had made them manually.
50+
51+
### 3. Making edits to other pages
52+
53+
We make changes to other pages by hand and commit them to master.
54+
55+
**If you add a new page,** you will need to edit `docs/.vuepress/config.js` in the root of the project. Otherwise it will not appear in the sidebar navigation.
56+
57+
### 4. Submit for review
58+
59+
First, make sure you've run the documentations locally (`npm run dev`) and
60+
confirmed that your links work properly. Submit your changes as a pull request
61+
on the [apostrophe-documentation](https://github.com/apostrophecms/apostrophe-documentation/)
62+
repository. Please include as much context for the change as is reasonable in
63+
the PR description.
64+
65+
### Note on internal doc links
66+
67+
When creating links in the body of a documentation page that point to another
68+
page of documentation, either make sure the link is relative and pointing to the
69+
`.md` extension OR use the file path starting starting after the `docs`
70+
directory. So you would link to `docs/devops/email.md` with
71+
`[link text](/devops/email.md)`.

LICENSE.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2020 Apostrophe Technologies, Inc.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

deploy

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
if [ -z "$ENV" ]; then
4+
echo "💁‍♀️ Usage: ENV=staging npm run deploy"
5+
echo "(or as appropriate)"
6+
echo
7+
rm -r ./dist
8+
exit 1
9+
fi
10+
11+
read -p "THIS WILL CRUSH THE SITE'S CONTENT ON $ENV. Are you sure? " -n 1 -r
12+
echo
13+
if [[ ! $REPLY =~ ^[Yy]$ ]]
14+
then
15+
exit 1
16+
fi
17+
18+
if [ $ENV == "staging" ]
19+
then
20+
ipAddress=34.207.22.194
21+
elif [ $ENV == "production" ]
22+
then
23+
ipAddress=100.24.96.198
24+
else
25+
echo "🤷‍♀️ Target unknown"
26+
exit 1
27+
fi
28+
29+
rsync -av --delete --exclude '.git' --exclude '**/node_modules' ./ nodeapps@$ipAddress:/opt/static/a3-docs &&
30+
echo "Synced up to $ENV"

docs/.vuepress/config.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
const { sidebar } = require('./sidebar.json');
2+
3+
module.exports = {
4+
title: 'ApostropheCMS Developer Documentation',
5+
plugins: {
6+
'@vuepress/google-analytics': {
7+
ga: 'UA-106613728-3'
8+
},
9+
sitemap: {
10+
hostname: 'https://docs.apostrophecms.com'
11+
}
12+
},
13+
themeConfig: {
14+
repo: 'https://github.com/apostrophecms/apostrophe',
15+
docsRepo: 'https://github.com/apostrophecms/apostrophe-documentation',
16+
docsBranch: 'master',
17+
docsDir: 'docs',
18+
lastUpdated: 'Last updated',
19+
nextLinks: true,
20+
prevLinks: true,
21+
editLinks: true,
22+
sidebar,
23+
feedbackWidget: {
24+
docsRepoIssue: 'apostrophecms/apostrophe-documentation'
25+
},
26+
logo: '/images/a2-lockup.png',
27+
nav: [
28+
{
29+
text: 'Docs Home',
30+
link: '/'
31+
},
32+
{
33+
text: 'Getting Started',
34+
link: '/getting-started/'
35+
},
36+
{
37+
text: 'Reference',
38+
link: '/reference/'
39+
},
40+
{
41+
text: 'Community',
42+
link: 'https://apostrophecms.com/community',
43+
rel: false
44+
},
45+
{
46+
text: 'Demo',
47+
link: 'http://demo.apostrophecms.com',
48+
rel: false
49+
},
50+
{
51+
text: 'Main Site',
52+
link: 'https://apostrophecms.com',
53+
rel: false
54+
}
55+
],
56+
algolia: {
57+
apiKey: 'e11d95029c6a9ac596343664b7f622e4',
58+
indexName: 'apostrophecms'
59+
}
60+
},
61+
head: [
62+
// <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/6104347.js"></script>
63+
['script', {
64+
type: 'text/javascript',
65+
id: 'hs-script-loader',
66+
async: 'true',
67+
defer: 'true',
68+
src: '//js.hs-scripts.com/6104347.js'
69+
}]
70+
]
71+
};

docs/.vuepress/enhanceApp.js

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
const { entries } = require('./gitbook-redirects.json');
2+
3+
export default ({ router }) => {
4+
router.addRoutes([
5+
// Redirect the old, extra /apostrophe/ path.
6+
{
7+
path: '/apostrophe/*',
8+
redirect: '/*'
9+
},
10+
// Redirect the deprecated /tutorials subdirectory
11+
{
12+
path: '/tutorials/*',
13+
redirect: to => {
14+
if (to.params && to.params.pathMatch) {
15+
const leadRegex = /^tutorials/;
16+
return to.params.pathMatch.replace(leadRegex, '');
17+
}
18+
return '/';
19+
}
20+
},
21+
// Redirect the funky old devops path.
22+
{
23+
path: '/apostrophe-devops/devops/',
24+
redirect: '/devops/'
25+
},
26+
{
27+
path: '/apostrophe-devops/devops/*',
28+
redirect: '/devops/*'
29+
},
30+
// Not sure how this one is coming up often.
31+
{
32+
path: '/devops/apostrophe-devops/devops/*',
33+
redirect: '/devops/*'
34+
},
35+
// Redirect the funky old howtos path.
36+
{
37+
path: '/howtos/howtos/',
38+
redirect: '/howtos/'
39+
},
40+
{
41+
path: '/howtos/howtos/*',
42+
redirect: '/howtos/*'
43+
},
44+
// There were duplicate devops/howtos pages. Redirect the deprecated ones.
45+
{
46+
path: '/devops/windows',
47+
redirect: '/howtos/windows'
48+
},
49+
{
50+
path: '/devops/docker',
51+
redirect: '/howtos/docker'
52+
},
53+
{
54+
path: '/devops/migration',
55+
redirect: '/howtos/migration'
56+
},
57+
{
58+
path: '/devops/storing-sessions-in-redis',
59+
redirect: '/howtos/storing-sessions-in-redis'
60+
},
61+
{
62+
path: '/howtos/email',
63+
redirect: '/devops/email'
64+
},
65+
{
66+
path: '/howtos/multicore',
67+
redirect: '/devops/multicore'
68+
},
69+
// Redirect deployment and cloud, which used to be in howtos
70+
{
71+
path: '/howtos/deployment/',
72+
redirect: '/devops/deployment/'
73+
},
74+
{
75+
path: '/howtos/deployment/*',
76+
redirect: to => {
77+
if (to.params && to.params.pathMatch) {
78+
const leadRegex = /^howtos\/deployment/;
79+
return to.params.pathMatch.replace(leadRegex, 'devops/deployment');
80+
}
81+
return '/devops/deployment';
82+
}
83+
},
84+
{
85+
path: '/howtos/cloud/',
86+
redirect: '/devops/cloud/'
87+
},
88+
{
89+
path: '/howtos/cloud/*',
90+
redirect: to => {
91+
if (to.params && to.params.pathMatch) {
92+
const leadRegex = /^howtos\/cloud/;
93+
return to.params.pathMatch.replace(leadRegex, 'devops/cloud');
94+
}
95+
return '/devops/cloud';
96+
}
97+
},
98+
{
99+
path: '/other/glossary',
100+
redirect: '/reference/glossary'
101+
},
102+
{
103+
path: '/other/core-server',
104+
redirect: '/reference/core-server'
105+
},
106+
{
107+
path: '/other/core-browser',
108+
redirect: '/reference/core-browser'
109+
}
110+
].concat(entries));
111+
};

0 commit comments

Comments
 (0)