Skip to content

Commit b639ad5

Browse files
committed
1 parent c54eaf0 commit b639ad5

File tree

319 files changed

+22640
-34023
lines changed

Some content is hidden

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

319 files changed

+22640
-34023
lines changed

Diff for: .eslintrc

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"extends": "apostrophe",
33
"ignorePatterns": [
44
"**/node_modules",
5-
"**/public/modules",
6-
"!/docs/**"
5+
"!/docs/**",
6+
"*.md",
7+
"**/docs/.vitepress/dist/**/*",
8+
"**/docs/.vitepress/cache/**/*"
79
]
8-
}
10+
}

Diff for: .gitignore

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# ignore vim swapfiles
2-
*.swp
3-
*.DS_Store
4-
dist
5-
npm-debug.log
61
node_modules
7-
.vscode
2+
.DS_Store
3+
docs/.vitepress/cache
4+
docs/.vitepress/dist

Diff for: README.md

+26-16
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# How to update Apostrophe CMS documentation
2-
========================
32

4-
This project contains [the documentation site](https://docs.apostrophecms.com)
3+
4+
This project contains [the documentation site](https://docs.apostrophecms.org/)
55
for [ApostropheCMS](https://apostrophecms.com).
66

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
7+
You don't need to read this page to read the documentation! This page
98
is about *contributing to* the documentation.
109

1110
## Building the docs
@@ -15,11 +14,11 @@ is about *contributing to* the documentation.
1514
Clone the repo.
1615

1716
```bash
18-
$ git clone https://github.com/apostrophecms/a3-docs.git
19-
$ cd a3-docs
17+
$ git clone https://github.com/apostrophecms/a3-vitepress-docs.git
18+
$ cd a3-vitepress-docs
2019
```
2120

22-
Next, install the dependencies for the main Vuepress documentation build.
21+
Next, install the dependencies for the main Vitepress documentation build.
2322

2423
```
2524
npm install
@@ -36,8 +35,24 @@ For testing, or
3635
```
3736
npm run build
3837
```
38+
followed by
39+
```
40+
npm run preview
41+
```
42+
Note that the build version is *less* tolerant of errors in your markdown files, so it is important to do this step before deployment.
43+
44+
For deployment (requires credentials of course), you can select to deploy to staging, production, or both. For deployment to staging only, for example, you would use
45+
46+
```
47+
ENV=staging npm run deploy
48+
```
49+
For deployment to production only (unusual), change the `NODE_ENV` environment variable to `production`.
50+
51+
For deployment to both,
3952

40-
Before deployment with the `deploy` script (requires credentials of course).
53+
```
54+
npm run deploy-all
55+
```
4156

4257
### 2. Editing content
4358

@@ -49,7 +64,7 @@ Images should be added to `images/assets` and embedded with relative paths, like
4964
![](../../../images/assets/user-menu.png)
5065
```
5166

52-
**If you add a new top level page,** you will need to edit `docs/.vuepress/config.js`. **If you add a new deeper page,** you will need to edit `docs/.vuepress/sidebar.json`. Otherwise it will not appear in the navigation.
67+
**If you add a new top level page,** you will need to edit `docs/.vitepress/config.js`. Otherwise it will not appear in the navigation.
5368

5469
### 3. Linking to other pages
5570

@@ -61,13 +76,8 @@ directory. So you would link to `docs/devops/email.md` with
6176

6277
### 4. Submit for review
6378

64-
First, make sure you've built and reviewed your documentation locally (`npm run dev`) and
79+
First, make sure you've built and reviewed your documentation locally using build and preview (`npm run build && npm run preview`) and
6580
confirmed that your links work properly. Submit your changes as a pull request
66-
on the [a3-docs](https://github.com/apostrophecms/a3-docs/)
81+
on the [a3-vitepress-docs](https://github.com/apostrophecms/a3-vitepress-docs/)
6782
repository. Please include as much context for the change as is reasonable in
6883
the PR description.
69-
70-
## Notes about using the Apostrophe Vuepress theme
71-
This site uses [`vuepress-theme-apostrophe`](https://github.com/apostrophecms/vuepress-theme-apostrophe), which imports *stylesheets, components, and plugins (and their configurations)*. Other modifications, like enhancements to the markdown parser, must be present at project level across all vuepress sites that need them.
72-
73-
Use this space to make other notes particular to the theme's shared resources

Diff for: deploy

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ else
1919
exit 1
2020
fi
2121

22-
rsync -av --delete --exclude '.git' --exclude '**/node_modules' ./ nodeapps@$ipAddress:/opt/static/a3-docs &&
22+
rsync -av --delete --exclude '.git' --exclude '**/node_modules' ./docs/.vitepress/dist nodeapps@$ipAddress:/opt/static/a3-docs &&
2323
echo "Synced up to $ENV"

Diff for: docs/.vitepress/components/AposCodeBlock.vue

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<figure>
3+
<slot></slot>
4+
<figcaption v-if="hasCaption">
5+
<slot name="caption"></slot>
6+
</figcaption>
7+
</figure>
8+
</template>
9+
10+
<script setup>
11+
import { ref, onMounted, useSlots } from 'vue';
12+
13+
const hasCaption = ref(false);
14+
const slots = useSlots();
15+
16+
onMounted(() => {
17+
hasCaption.value = !!slots.caption;
18+
});
19+
</script>
20+
21+
<style lang="stylus" scoped>
22+
figure {
23+
position: relative;
24+
margin: 0;
25+
padding: 0;
26+
}
27+
28+
figcaption {
29+
z-index: 1;
30+
position: absolute;
31+
top: 0.85em;
32+
left: 3em;
33+
width: calc(100% - 6em);
34+
color: #fff;
35+
font-family: Hack, monospace;
36+
font-size: 0.85rem;
37+
text-align: center;
38+
}
39+
40+
</style>

Diff for: docs/.vitepress/components/AposCtaButton.vue

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<template>
2+
<div
3+
class="cta-button tip custom-block"
4+
@click="navigate"
5+
@keydown.enter.prevent="handleEnter"
6+
@keydown.space.prevent="handleSpace"
7+
:class="{ 'clickable': url }"
8+
role="button"
9+
tabindex=0
10+
>
11+
<p class="cta-button__detail-heading">{{ detailHeading }}</p>
12+
<p class="cta-button__title">{{ title }}</p>
13+
<p>{{ content }}<span v-if="url"> &#8594</span> </p>
14+
</div>
15+
</template>
16+
17+
<script>
18+
export default {
19+
props: {
20+
detailHeading: String,
21+
title: String,
22+
content: String,
23+
url: {
24+
type: String,
25+
default: null,
26+
}
27+
},
28+
methods: {
29+
navigate() {
30+
if (this.url) {
31+
window.location.href = this.url;
32+
}
33+
},
34+
handleEnter() {
35+
this.navigate();
36+
},
37+
handleSpace(event) {
38+
if (event.target === event.currentTarget) {
39+
this.navigate();
40+
}
41+
},
42+
}
43+
}
44+
</script>
45+
46+
<style scoped>
47+
.cta-button {
48+
height: 100%;
49+
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
50+
border: 1px solid var(--vp-c-divider);
51+
background-color: transparent;
52+
color: var(--vp-c-text-1);
53+
font-size: 14px;
54+
}
55+
56+
.cta-button__detail-heading {
57+
color: var(--vp-c-text-2);
58+
font-size: 14px;
59+
font-weight: 600;
60+
margin-bottom: 12px;
61+
}
62+
63+
.cta-button__title {
64+
color: var(--vp-c-text-1);
65+
font-size: 18px;
66+
font-weight: 600;
67+
margin-bottom: 16px;
68+
}
69+
70+
.clickable {
71+
cursor: pointer;
72+
}
73+
74+
.cta-button:not(.clickable) {
75+
cursor: default;
76+
}
77+
78+
@media (min-width: 960px) {
79+
.cta-button.clickable:hover {
80+
border: 1px solid var(--vp-custom-block-tip-border);
81+
background-color: var(--vp-custom-block-tip-bg);
82+
}
83+
}
84+
85+
@media (max-width: 959px) {
86+
.cta-button {
87+
margin-bottom: 0;
88+
margin-top: 0;
89+
}
90+
}
91+
92+
/* DARK */
93+
</style>

0 commit comments

Comments
 (0)