Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Oct 17, 2023
1 parent 095bfd7 commit 4f5f922
Show file tree
Hide file tree
Showing 59 changed files with 995 additions and 149 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/DevelopServerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,9 @@ jobs:
- name: Build hugo docs
run: |
docker run \
-v "${GITHUB_WORKSPACE}/doc:/site/doc" \
-v "${GITHUB_WORKSPACE}/themes:/site/themes" \
-v "${GITHUB_WORKSPACE}/config.toml:/site/config.toml" \
-v "/var/www/dev.wikigdrive.com:/site/dist/hugo" \
--env CONFIG_TOML="/site/config.toml" --env BASE_URL="https://dev.wikigdrive.com" \
-v "${GITHUB_WORKSPACE}/hugo:/site" \
-v "/var/www/dev.wikigdrive.com:/dist/hugo" \
--env CONFIG_TOML="/site/config/_default/config.toml" --env BASE_URL="https://dev.wikigdrive.com" \
wgd-action-runner:develop /steps/step_render_hugo
- name: Start
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ node_modules
dist
content
.hugo*
hugo/resources
hugo_stats.json

2 changes: 1 addition & 1 deletion README.md
1 change: 0 additions & 1 deletion apps/ui/assets/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ body,
.mainbar__content {
flex: 1 1 auto;
text-overflow: ellipsis;
white-space: nowrap;
height: calc(100vh - var(--navbar-height));
overflow: auto;
}
Expand Down
1 change: 0 additions & 1 deletion apps/ui/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ nav {
justify-content: space-between;
display: flex;
align-items: center;
background-color: #2196F3;
color: #FFF;
}

Expand Down
28 changes: 0 additions & 28 deletions apps/ui/index.html

This file was deleted.

1 change: 1 addition & 0 deletions apps/ui/index.html
17 changes: 16 additions & 1 deletion apps/ui/src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,22 @@
<router-link :to="{ name: 'home' }">WikiGDrive</router-link>
</span>
</span>
<slot></slot>
<slot>
<ul class="navbar-nav mr-auto align-items-center justify-content-start">
<li class="nav-item">
<a class="nav-link" :class="{'active': $route.path.startsWith('/docs')}" href="/docs">Documentation</a>
</li>
<li class="nav-item" v-if="isLogged">
<a class="nav-link" :class="{'active': $route.path.startsWith('/drive')}" href="/drive">Drives</a>
</li>
</ul>
<ul class="navbar-nav mr-auto align-items-center">
<li>
<button v-if="!isLogged" class="btn btn-secondary" @click="login">Sign in</button>
<button v-if="isLogged" class="btn btn-secondary" @click="logout">Logout User</button>
</li>
</ul>
</slot>
</nav>
</template>
<script>
Expand Down
2 changes: 1 addition & 1 deletion apps/ui/src/components/StaticContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default {
},
computed: {
isHtml() {
return (this.$route.path.endsWith('.html') || this.$route.path === '/');
return (this.$route.path.endsWith('.html') || this.$route.path === '/' || this.$route.path.startsWith('/docs'));
}
},
methods: {
Expand Down
5 changes: 3 additions & 2 deletions apps/ui/src/components/UtilsMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const UtilsMixin = {
const driveId = this.driveId ? this.driveId : 'none';
const urlSearchParams = new URLSearchParams();
// urlSearchParams.set('redirectTo', '/drive/' + (req['driveId'] || ''));
urlSearchParams.set('redirectTo', window.location.pathname);
urlSearchParams.set('redirectTo', window.location.pathname && window.location.pathname.startsWith('/drive') ? window.location.pathname : '/drive');
const authPath = '/auth/' + driveId + '?' + urlSearchParams.toString();
this.openAuthRedirWindow(authPath, callback);
},
Expand All @@ -284,7 +284,8 @@ export const UtilsMixin = {
},
return_error: true
});
await this.fetch();
// await this.fetch();
this.$router.push('/');
}
}
};
12 changes: 11 additions & 1 deletion apps/ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,17 @@ const router = VueRouter.createRouter({
{
path: '/',
name: 'home',
component: () => import('./pages/MainView.vue')
component: () => import('./pages/StaticView.vue')
},
{
path: '/docs',
name: 'docs',
component: () => import('./pages/StaticView.vue')
},
{
path: '/docs/:pathMatch(.*)*',
name: 'docs',
component: () => import('./pages/StaticView.vue')
},
{
path: '/:pathMatch(.*)*',
Expand Down
8 changes: 8 additions & 0 deletions apps/ui/src/pages/MainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
<BaseLayout>
<template v-slot:navbar="{ sidebar, collapsed, collapse }">
<NavBar :sidebar="sidebar" :collapsed="collapsed" @collapse="collapse">
<ul class="navbar-nav mr-auto align-items-center justify-content-start">
<li class="nav-item">
<a class="nav-link" :class="{'active': $route.path.startsWith('/docs')}" href="/docs">Documentation</a>
</li>
<li class="nav-item" v-if="isLogged">
<a class="nav-link" :class="{'active': $route.path.startsWith('/drive')}" href="/drive">Drives</a>
</li>
</ul>
<ul class="navbar-nav mr-auto align-items-center">
<li>
<button v-if="!isLogged" class="btn btn-secondary" @click="login">Sign in</button>
Expand Down
109 changes: 109 additions & 0 deletions apps/ui/src/pages/StaticView.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<template>
<BaseLayout>
<template v-slot:navbar="{ sidebar, collapsed, collapse }">
<NavBar :sidebar="sidebar" :collapsed="collapsed" @collapse="collapse">
<ul class="navbar-nav mr-auto align-items-center justify-content-start">
<li class="nav-item">
<a class="nav-link" :class="{'active': $route.path.startsWith('/docs')}" href="/docs">Documentation</a>
</li>
<li class="nav-item" v-if="isLogged">
<a class="nav-link" :class="{'active': $route.path.startsWith('/drive')}" href="/drive">Drives</a>
</li>
</ul>
<ul class="navbar-nav mr-auto align-items-center">
<li>
<button v-if="!isLogged" class="btn btn-secondary" @click="login">Sign in</button>
<button v-if="isLogged" class="btn btn-secondary" @click="logout">Logout User</button>
</li>
</ul>
</NavBar>
</template>

<template v-slot:default>
<div class="container">
<StaticContent />
</div>
</template>
</BaseLayout>
</template>
<script>
import {markRaw} from 'vue';
import {UtilsMixin} from '../components/UtilsMixin';
import BaseLayout from '../layout/BaseLayout.vue';
import ShareModal from '../components/ShareModal.vue';
import StaticContent from '../components/StaticContent.vue';
import NavBar from '../components/NavBar.vue';
import {awaitValue} from '@swc/helpers';

Check warning on line 36 in apps/ui/src/pages/StaticView.vue

View workflow job for this annotation

GitHub Actions / test

'awaitValue' is defined but never used
export default {
mixins: [ UtilsMixin ],
components: {
BaseLayout, StaticContent, NavBar
},
data() {
return {
url: '',
drivesShared: [],
drivesNotShared: [],
loading: false
};
},
async created() {
await this.fetch();
},
methods: {
async fetch() {
await this.$root.fetchUser();
if (!this.isLogged) {
this.drivesShared = [];
this.drivesNotShared = [];
return;
}
this.loading = true;
try {
const drives = await this.DriveClientService.getDrives();
this.drivesShared = drives.filter(d => !!d.exists);
this.drivesNotShared = drives.filter(d => !d.exists);
} finally {
this.loading = false;
}
},
selectDrive(driveId) {
this.$router.push('/drive/' + driveId);
},
goToGDrive(folderId) {
window.open('https://drive.google.com/drive/u/0/folders/' + folderId);
},
async submit() {
try {
const json = await this.authenticatedClient.fetchApi('/api/share_drive', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: this.url
})
});
if (json.driveId) {
await this.$router.push({ name: 'drive', params: { driveId: json.driveId } });
} else {
alert('Error sharing drive');
}
} catch (err) {
console.error(err);
}
},
share(driveId) {
this.$root.$addModal({
component: markRaw(ShareModal),
props: {
driveId
},
});
}
}
};
</script>
4 changes: 0 additions & 4 deletions config.toml

This file was deleted.

14 changes: 14 additions & 0 deletions hugo/config/_default/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title = "WikiGDrive"
theme="wgd-bootstrap"
contentDir="../website"
publishDir="../dist/hugo"
#uglyURLs="true"
uglyURLs = false

[build]
writeStats = true

[module]
[[module.mounts]]
source = './themes/wgd-bootstrap/layouts/_default/_markup'
target = 'layouts/_default/_markup'
32 changes: 32 additions & 0 deletions hugo/config/_default/params.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#customCSS = null # To use: uncomment and replace null with value
#customJS = null # To use: uncomment and replace null with value
dateFormat = ":date_long"
description = "Google Drive to MarkDown synchronization"
keywords = "GDrive, CLI, MarkDown, Google Docs, Wiki"
math = true
titleCase = true
viewer = true

[actionsPanel]
disabled = true

[post]
featuredImage = true
numberifyHeadings = true
numberifyHeadingsSeparator = "."

[sidebar]
archives = false
authors = false
fixed = true
recentPosts = false
taxonomiesToggle = false

[siteVerification]
#baidu = null # To use: uncomment and replace null with value
#baiduUnion = null # To use: uncomment and replace null with value
#bing = null # To use: uncomment and replace null with value
#google = null # To use: uncomment and replace null with value
#shenma = null # To use: uncomment and replace null with value
#so = null # To use: uncomment and replace null with value
#sogou = null # To use: uncomment and replace null with value
3 changes: 3 additions & 0 deletions hugo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/mieweb/wikiGDrive

go 1.21.1
File renamed without changes.
6 changes: 6 additions & 0 deletions hugo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dependencies": {},
"devDependencies": {},
"name": "wikiGDrive",
"version": "0.1.0"
}
33 changes: 33 additions & 0 deletions hugo/static/images/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions hugo/themes/wgd-bootstrap/layouts/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- define "main" }}
Not found
{{- end -}}
Loading

0 comments on commit 4f5f922

Please sign in to comment.